I am using Actuate for targeting js. I recognized animations are running a bit 'choppy' and investigated a little bit. In SimpleActuator.hx I found this:
#if !actuate_manual_update
#if (flash || nme || openfl)
Lib.current.stage.addEventListener (Event.ENTER_FRAME, stage_onEnterFrame);
#elseif lime
Application.current.onUpdate.add (stage_onEnterFrame);
#else
timer = new Timer (Std.int(1000 / 30));
timer.run = stage_onEnterFrame;
#end
#end
So it seems that stage_onEnterFrame() is called with 30fps. Instead I would rather use requestAnimationFrame() instead.
I guess I can somehow set "actuate_manual_update" somehow and call stage_onEnterFrame myself somehow. But how would I do that? Is "actuate_manual_update" some kind of compiler argument?
Or is there any other way to make Actuate use requestAnimationFrame() instead of its own timer?
Thanks in advanced.
I would prefer some way though without changing code inside Actuate itself, so I do not lock myself out of updates.
It seems to me your design provided a way to call stage_onEnterFrame() from outside by using these conditionals. Maybe it would better to leverage that? Since stage_onEnterFrame() is static I just could throw it inside my loop() function. But for that I would have to set "actuate_manual_update" to true somehow. How do I do that?
Cheers
For anybody else interested: just use compiler flag "-D actuate_manual_update". Then just call "motion.actuators.SimpleActuator.stage_onEnterFrame()" in your requestAnimationFrame handler and Voila.. Actuate runs in glorious 60fps :)
Thanks