|
-
Aug 12th, 2002, 03:48 PM
#1
Thread Starter
Addicted Member
1-Twip vs. 3-Pixel HELP!
Sub DoBall()
Speed = 5
xFlag = 1
yFlag = 1
If xFlag = 1 Then
Ball.X = Ball.X + Speed
Else
Ball.X = Ball.X - Speed
End If
If yFlag = 1 Then
Ball.Y = Ball.Y + Speed
Else
Ball.Y = Ball.Y - Speed
End If
If Ball.X >= Form1.width Then
xFlag = 0
End If
If Ball.X <= 100 Then
xFlag = 1
End If
If Ball.Y >= Form1.height Then
yFlag = 0
End If
If Ball.Y <= 100 Then
yFlag = 1
End If
End Sub
The above code works when Form property is set to 1-Twip, but when I change it to 3-Pixel the code no longer works. The ball flies of the form. Why? Please help!
Thanks
-
Aug 12th, 2002, 04:13 PM
#2
Frenzied Member
The number of pixels is the resolution like 768 X 1024.
Twips are fixed at 1440 per inch. As you change resolution you get a different number of twips per pixel. Pixels are always much bigger than twips. So if you move your ball 150 twips - it isn't far, but 150 pixels can be 1/6 of the entire screen width, nearly as big as a form.
Last edited by jim mcnamara; Aug 12th, 2002 at 04:35 PM.
-
Aug 12th, 2002, 04:46 PM
#3
Thread Starter
Addicted Member
Oh ok. Thanks for clearing that up for me. Yeh, I just change all my numbers to much lower numbers and everything works!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|