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

Native Development

Reply
Contributor
Irina_p
Posts: 10
Registered: ‎10-18-2012
My Device: Dev Alpha
My Carrier: T
Accepted Solution

Playing Image Sequence

Hi, I have png image sequences in my asset folder, and I would like to "play" it. Is it possible to do that?

 

Thanks

Please use plain text.
Contributor
Irina_p
Posts: 10
Registered: ‎10-18-2012
My Device: Dev Alpha
My Carrier: T

Re: Playing Image Sequence

[ Edited ]

Maybe the relevant question should be, Is it possible to create an Animated sprite within a Cascades application?

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Playing Image Sequence

The latest version supports animated GIF files, so you could just use some third-party tool to build an animated GIF out of your images, and then use that. I haven't used it myself so I don't know the degree to which we have any control over it.

If that doesn't work, you could simply use a QTimer and modify the source for your image repeatedly... that ought to work similarly though perhaps with slightly more overhead.

The term "Animated sprite" suggests maybe that you're looking at doing a game... that may imply other constraints (performance) which will affect your choice and what options are most suitable.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
Irina_p
Posts: 10
Registered: ‎10-18-2012
My Device: Dev Alpha
My Carrier: T

Re: Playing Image Sequence

Thanks for the reply peter9477,

Animated gifs would do, except I need to control the playback, and gif only supports 256 colors which is not good enough.

 

Now that you mention it, I am not doing a game, but some kind of "Entertainment App" sort of thing.

It strikes me, is it possible to use cascades along with cocos2d-x in my app??

 

It might be an "overkill" but I dont think that there's any alternative solution left.

 

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Playing Image Sequence

You may be able to do something like that, using a ForeignWindowControl. This is outside my area of expertise but maybe someone else with more knowledge there can chime in.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
igosoft
Posts: 71
Registered: ‎09-19-2012
My Device: Z10 very soon
My Carrier: Play

Re: Playing Image Sequence

 

Hi

 

How many frames per second you would like to be rendered ?

How smooth it should be ?

How many png images do you have in your assets folder ?

Are you planning to use more then one "animated sprite" ?

 

Please use plain text.
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha
My Carrier: -

Re: Playing Image Sequence

depending on the number of images, quality of images and delay between each image, you could probably get away with simply using a QTimer.

 

although i haven't tried that with cascades/bb10, i did that with older BBOS and almost never ran into performance issues ...

 

in a nutsheel, store an array of images....then configure your QTimer (ex. every 1 second) to display images from this array using a circular counter.

Please use plain text.
Contributor
Irina_p
Posts: 10
Registered: ‎10-18-2012
My Device: Dev Alpha
My Carrier: T

Re: Playing Image Sequence

@igosoft, about 10 fps. Only one "sprite" 

Please use plain text.
Contributor
Irina_p
Posts: 10
Registered: ‎10-18-2012
My Device: Dev Alpha
My Carrier: T

Re: Playing Image Sequence

@lew, nice suggestion, if the old OS could handle this, it should be not a problem for OS 10. thanksss

Please use plain text.