|
-
Dec 14th, 2001, 07:04 PM
#1
Thread Starter
Addicted Member
Simple animation using timer only.
Hi, I remember there is a way to do simple animation using only a timer and a picture box. Where you load in a picture into the box every whatever seconds and it makes an animation. Does anybody know how to do that. I remember it's something like:
Timer1.interval - tickcount..blah balh blah.
Please help. Thanks!
-
Dec 16th, 2001, 10:59 AM
#2
-
Dec 16th, 2001, 12:06 PM
#3
Thread Starter
Addicted Member
Actually I'm doing this for a DirectX game. I just want to know the simple logic.
Thanks
-
Dec 17th, 2001, 11:04 AM
#4
Frenzied Member
For a DirectX game you should use GetTickCount. Here's the pice of code I'm using; it's in the beggining of the main loop (inside the Do...Loop thingy):
VB Code:
'Slow down the FPS...
Do
DoEvents
Loop Until GetTickCount() >= LastTick + TicksPerFrame
LastTick = GetTickCount()
You'll have to declare LastTick and TicksPerFrame as Long (unless you wanna use another slow type ). TicksPerFrame is the number of miliseconds that each frame will last - usually 30 is a good number
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
|