Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Game Programming > Create something from nothing?


Reply
 
Thread Tools Display Modes
  #1  
Old 04-22-2006, 02:58 PM
Fork501's Avatar
Fork501 Fork501 is offline
Freshman
 
Join Date: Mar 2006
Location: Weston, Fl
Posts: 48
Unhappy Create something from nothing?


I know that this is probably a very basic thing to do, but I can't figure out how to word it to search the forums and internet:

I'm just goofing off with VB and want to make it so that when I move my mouse, a new circle object is left where my mouse was just at (same principle as when you paint)

I have the circle following my mouse already, but I can't figure out for the life of me how to make another shape get left where my mouse was. I created a second object with an index of 0, since I'm sure I will have to use this to make all of the new objects.

Again, I'm just goofing off with VB and this is probably going to bug me all night if I don't figure it out lol

Thanx in advance!

~Derek
Reply With Quote
  #2  
Old 04-22-2006, 05:04 PM
MacroPc MacroPc is offline
Centurion
 
Join Date: Sep 2005
Location: Wisconsin
Posts: 131
Default

Instead of using shapes, try using VB's .Circle function.
Reply With Quote
  #3  
Old 04-22-2006, 06:06 PM
AdrianDeAngelis's Avatar
AdrianDeAngelis AdrianDeAngelis is offline
Contributor
 
Join Date: May 2005
Location: Australia
Posts: 549
Default

also try drawing onto the form without clearing...
__________________
Automation error... What do you mean automation error you %#@*&!$ thing!

Star Admiral: 3D tactical space sim *** New Version 0.38 10/01/09 ***
Damage, shields and special weapons systems
Reply With Quote
  #4  
Old 04-23-2006, 02:56 AM
zBlade1's Avatar
zBlade1 zBlade1 is offline
Centurion
 
Join Date: Mar 2005
Location: Croatia
Posts: 143
Default

put this code in a new project:

Code:
Const r = 10 'radius Private Sub Form_Load() Me.ScaleMode = vbPixels End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Me.Circle (X - r / 2, Y - r / 2), r End If End Sub
Reply With Quote
  #5  
Old 04-23-2006, 07:08 AM
Fork501's Avatar
Fork501 Fork501 is offline
Freshman
 
Join Date: Mar 2006
Location: Weston, Fl
Posts: 48
Default

Quote:
Originally Posted by zBlade1
put this code in a new project:

Code:
Const r = 10 'radius Private Sub Form_Load() Me.ScaleMode = vbPixels End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Me.Circle (X - r / 2, Y - r / 2), r End If End Sub
iiiinnnnnsssssaaaannnnneeeee

lol Thanx! =)

~Derek
Reply With Quote
  #6  
Old 04-23-2006, 07:48 AM
Vladimir - SV Vladimir - SV is offline
Regular
 
Join Date: Mar 2006
Location: San Salvador, El Salvador
Posts: 54
Default

As a suggestion, put the "AutoRedraw" forms property to "True", so losing the focus don't lead to image erasing
__________________
sorry my english
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->