12-30-2011 03:54 AM
Hi there, I created an animation in my app, which users can tap on it and the animation will be played. Similar to a gun simulator app, when the trigger is pressed, it plays the animations of a gun firing.
I have created my own animations in a series of png files. The method which i plays the animations is through changing the image frame by frame, and I've already cached the png files. However, the performance is laggy and there is some noticeble lag between each frame.
How can I play the animations smoothly, and if can, uses the GPU of the playbook? My png files are very big in size, and I tried to animate it using flash it appear to be working fine on the PC, but very laggy when it's on the playbook.
Any best practice in this kind of animations?
01-13-2012 10:42 AM
01-13-2012 11:45 AM
They can be hardware accelerated if you set the rendermode to gpu. Add this to the *-app.xml:
<initialWindow> <renderMode>gpu</renderMode> </initialWindow>
01-13-2012 12:48 PM - edited 01-13-2012 01:10 PM
There are limitations using that tag, as it's not fully supported yet.
And I've tried to add the tag to my code, but it's performance still the same.
Correction: There are improvement on the animations, but the first run is choppy, and start from the 2nd run it becomes smooth.