Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 39
Registered: ‎06-13-2011
My Device: playbook, torch 9810 and Alpha device!
My Carrier: digi

Animation on playbook

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?

Developer
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: Animation on playbook

Lee Brimelow has a 3-part tutorial on blitting: http://www.gotoandlearn.com/play.php?id=140

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Contributor
Posts: 39
Registered: ‎06-13-2011
My Device: playbook, torch 9810 and Alpha device!
My Carrier: digi

Re: Animation on playbook

What if the animations consists of very large graphics which almost fill up the whole playbook's 1024x600 screen?

Do I need to use a very big canvas and fit all my animation graphics inside?

And how's the performance of it? Because I tried to make a flash movie of such big size, and when I play it on my playbook it's very laggy.

I've been told Adobe AIR on the Playbook isn't hardware accelerated, so any AIR based graphic intensive app isn't possible on the playbook/ wouldn't run smoothly, am I right?
Highlighted
Developer
Posts: 1,008
Registered: ‎12-12-2010
My Device: Passport (Red Limited Edition)
My Carrier: Mobile Vikings

Re: Animation on playbook

They can be hardware accelerated if you set the rendermode to gpu. Add this to the *-app.xml:

 

<initialWindow> 
    <renderMode>gpu</renderMode> 
</initialWindow> 

 

 

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Contributor
Posts: 39
Registered: ‎06-13-2011
My Device: playbook, torch 9810 and Alpha device!
My Carrier: digi

Re: Animation on playbook

[ Edited ]

There are limitations using that tag, as it's not fully supported yet.
http://help.adobe.com/en_US/as3/mobile/WS901d38e593cd1bac-3d719af412b2b394529-8000.html

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.