timer keeps going
i still have problem timer doesn't stop. program has timer counts backward 5 secs should stop. keeps going.
when timer reaches 0 fires clockend sub.
dim sb new storyboard
..
myclock = new classclock(canvas3, canvas4)
myclock.start_clock(0, 5)
sb.begin()
addhandler myclock.clockend, addressof clock_end
addhandler sb.completed, addressof me.sb_complete
end sub
private sub clock_end()
myclock.start_clock(0, 5)
sb.stop() ''wont stop resets sub
end sub
private sub sb_complete(byval sender system.object, byval e system.eventargs)
dim loopspan timespan
elooptime = now
loopspan = elooptime.subtract(slooptime)
'30fps
myclock.testclock()
if loopspan.milliseconds > 33 then
maingameloop()
slooptime = now
end if
sb.begin()
end sub
private sub maingameloop()
end sub
Silverlight > Getting Started with Silverlight
Comments
Post a Comment