Hello, as a new user of giderosmobile (just found it 2 days ago), looking at the API, I can see there is no simple solution for time-based animations. But the problem is there are many devices with different processor speed, some of them overclocked (faster), in battery-saving mode (slower) etc, so I think there is a need for one.
I suggest adding a parameter to indicate how much time has passed since last frame. So, for example:
function Ball:onEnterFrame(event)
local dt=event.dt
local speed=100
-- self:setX(self:getX() + 1) -- frame based
self:setX(self:getX() + speed*dt) --time based
end
What do you think?
Also, related question: what happens with running timers when the application is suspended? Are they "frozen" or not? I could not find info on this.
Comments
event.deltaTime or event.time ?
And I know, even.time is nowhere mentioned in the docs and deltaTime only inside a code sample there.
Likes: chipster123
But I think it's better to pause the timers when application moves to background by default.
Likes: GregBUG
www.tntengine.com
And currently I don't know if we ever support for background running timers.
:-O
So you don't need to pause timers when the app will be going into the background? They get paused automatically! Before you said the opposite. You can really confuse the people.
I mean...
Assume that you create a 10 second timer then suspend the app. After that wait >11 seconds then resume the app. After resuming your timer should be dispatched after 10 seconds, not just after resuming. (I hope I explained this time)
...yes you could make an App with it but in which case i think is better to use some other (and appropiate) toolkit i think...
... my 2 cents ...
www.tntengine.com
Assume that you create a 10 second timer and after 5 seconds suspend the app. After that wait any seconds then resume the app. After resuming your timer should be dispatched after 5 seconds, not just after resuming. Is that right? And nothing to be done for developers currently?
https://sites.google.com/site/xraystudiogame
If you start a timer and then the application is suspended, such as hitting the home button on my device, the timer will still run in the background, if the timer completes while in the background, it will trigger the event as soon as its brought to the foreground.
The proposed idea of pausing the timers on suspend by default makes sense to me, but I'm sure there could be some use cases for keeping a timer running even when an app is suspended, so maybe that should still be an option.
Hope I got this right and that it makes sense? >-
For example ,change the timeline after create the movieclip.
As an example, if you have character have some frames for idle state and some frames for jump state, and as it jump,the position will be changed Continuously.These can not be finished by the single movieclip.
https://sites.google.com/site/xraystudiogame
https://github.com/gideros/GTween
(not really understanding the issue, but I had more success with gtween when I was experimenting a couple of months ago.)