|
-
Dec 14th, 2001, 12:34 PM
#1
Thread Starter
Fanatic Member
Loop Until Timer > t + 0.5
I know there's going to be some guffaws from the gallery, but hey, I'm a newbie where graphics are concerned . . .
Okay, I searched to try to get a real basic example of bitblt but I couldn't find a basic enough example that I could paste in and see how it works and I didn't really know how to make a bunch of frames tacked on side by side in a single pic.
That being said, I tried this method:
Code:
Private Sub Command1_Click()
For a = 0 To 4
t = Timer
Do
DoEvents
If a > 0 Then pic(a - 1).Visible = False
Loop Until Timer > t + 0.5
Next a
End Sub
Why is it so damn slow? I thought Loop Until Timer > t + 0.5 would give me a pretty accurate 1/2 second frame rate.
-
Dec 14th, 2001, 01:22 PM
#2
PowerPoster
Try this:
Code:
Private Sub Command1_Click()
Dim A As Long
Dim Temp As Single
While A < 5
If Temp < Timer Then
Temp = Timer + 0.5
pic(A).Visible = False
A = A + 1
End If
DoEvents
Wend
End Sub
'Code improved by vBulletin Tool 2.0
Last edited by Fox; Dec 14th, 2001 at 01:26 PM.
-
Dec 14th, 2001, 01:37 PM
#3
Thread Starter
Fanatic Member
DUDE! That's awesome. I'll have to read up on those singles and figure out why it works on a single and not on a long.
-
Dec 14th, 2001, 03:46 PM
#4
Good Ol' Platypus
Actually, the reason is it's always checking agains an old number.
In your code, it looks for this:
Code:
t = 1000: timer = 1500: execute code.
t = 1000: timer = 2000: execute code.
If you had updated t each time it matched t + 0.5, your code would have worked.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
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
|