Thursday 15 March 2012

Showing Text for a sertain amount of seconds in lua -



Showing Text for a sertain amount of seconds in lua -

my question is: there way in lua display text sertain amount of seconds?? trying create little gui , want display logo (i used print statement --'s create it) 3 seconds. plz help me!! thanks!

the solution simple: (1) show logo, (2) wait 3 seconds, (3) hide logo. if know how steps 1 , 3, step 2 have couple of options.

if have access library luasocket, may utilize select phone call wait number of seconds:

socket.select(nil, nil, 3)

if library not available, can "busy" loop:

local start = os.time() while os.time() < start + 3 end

this not best alternative , keeps cpu busy , doesn't guarantee wait time 3 seconds depending on grab current timer, may not matter in case.

this partially tongue-in-cheek, if need answers on how steps 1 , 3, need much more specific in question there no general way , reply much depends on libraries using or have access to.

lua

No comments:

Post a Comment