#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default animation

I have created a hangman type game where you guess letters which make up a
word.

This has some basic animation in the form of a bear whose eyes follow the
mouse and who blinks randomly.
The blinking is done by increasing the height of a label and reducing it
again using a loop
eg
dim i as double
for i = 0 to 9 step 0.5
labelblink.height = i
doevents
next

Is there anyway of making the speed of this independent of the processor
speed, as currently it is painfully slow on some PC's and far too fast on
others?

Many thanks
Libby

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default animation

Libby try adding this

What this will do is force a delay before the loop. It's something I have
used in the past to show a colour change in a map. The original idea came
from a far smarter individual than I but can't remember there name.

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)



for i = 0 to 9 step 0.5
labelblink.height = i
doevents



'calls the sleep function and delays macro by 1/2 second

Sleep 500 'adjust this for the dealy. Max 1000 for one second

next



"Libby" wrote in message
...
I have created a hangman type game where you guess letters which make up a
word.

This has some basic animation in the form of a bear whose eyes follow the
mouse and who blinks randomly.
The blinking is done by increasing the height of a label and reducing it
again using a loop
eg
dim i as double
for i = 0 to 9 step 0.5
labelblink.height = i
doevents

Is there anyway of making the speed of this independent of the processor
speed, as currently it is painfully slow on some PC's and far too fast on
others?

Many thanks
Libby



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Animation Weave New Users to Excel 1 December 7th 05 02:21 PM
Animation Andy pop Excel Programming 2 November 16th 04 02:41 PM
Animation No Name Excel Programming 2 July 15th 04 11:14 PM
Animation Adam Klee Excel Programming 3 August 12th 03 01:15 PM
animation Adam Klee Excel Programming 0 August 12th 03 08:04 AM


All times are GMT +1. The time now is 05:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"