How to run .gif file in cocos2d - cocos2d-iphone

Is it possible to run .gif file in cocos2d for iphone

CCSpriteSheet works really well for animating with spritesheets, you'll need a way to generate the spritesheet from the animated gif.
Read this.

I assume you mean an animated GIF. If so, no, not directly, but you could extract the frames and run them using any of the usual animation classes.

Related

How to load and display an animated png

I have an animated png that I want to load in my MFC project to show it animated. I need this because it's a loading animation, and I would love to know how to do it. Would love if you can tell me how this works for png files.
Maybe this is what you want:
http://www.codeproject.com/Articles/1427/Add-GIF-animation-to-your-MFC-and-ATL-projects-wit

How to render QGraphicsScene animations out to a movie file?

Does anybody know how to render an animation from QGraphicsView / QGraphicsScene out to a movie file format (AVI, MPG, MP4, MOV, something) on disk? I've seen examples for rendering the scene out to an image file with QPrinter. Any ideas on if rendering animations to movies is possible?
I suppose worst case would be to step frame-by-frame and save images, then combine the images into a movie with some external tool... Any better suggestions? Is it possible to do this from QT directly somehow?
Thanks!
- Brian
I think one of the ways is to use QPixmap for capturing the images,
QPixmap pixMap = QPixmap::grabWidget(view);
Use QPixmap::toImage() to convert it to QImage.
And using QtFFmpegWrapper for creating the video directly from QImage.
You do not need to use an external tool. Just an external library.

Using Tiled app to create Cocos2d .plist

I'm trying to use the Tiled application on OSX to create a tile background for a 2d iPhone game I'm working on. I need some way to export the completed background to a .plist file so that I can use it directly with cocos2d and the app I'm writing. Unfortunately, the only export options available are:
.dat
.txt
.json
.lua
.wlk
Is there any way to easily convert any of the above formats to a more usable .plist format? Thanks a lot for your help!
You mean the Tiled Map Editor? Cocos2d iPhone supports the TMX maps natively. Just save the TMX and load it with the CCTMXTiledMap class.

How to add .swf file in cocos2d

I want to add an animation in starting screen of my game. I did that animation in flash. how to load it in cocos2d
Don't think you're going to be able to do this. Flash has never been able to run on the iPhone/iPod and very likely never will at least for the foreseeable future. Someone would have to write a custom SWF file loader and player specifically for Cocos (no small task). Even then I doubt Apple would allow such an application to be approved. I would suggest converting your SWF to an iPhone/iPod compatible movie format. QuickTime (mov) for sure is supported, mpg and avi may work as well.
There is and will be no Flash support on the iPhone. You'd have to to convert the animation into single images and use cocos2d's animation system.
The thing you wanted four years ago has released! It's called GAF This is library and a converter for flash animations.

I have a wxwidgets that I want to add some cool effects. Using GDI would be impossibly hard. Could I use flash or something else?

I have an application that I want add some cool animations to show state changes. However, wxwidgets would be difficult because I'd have to program these animations in straight gdi. What's the best way to add these effect windows? Should I open a flash window and run a flash sequence or is maybe some other technology? Does .net have something I could code into a dll and run from my wxwidgets binary? I need something that is super easy to draw and set up the animation.
It's hard to say what the best approach would be to achieve "cool effects", but in most cases you would want a double-buffered drawing surface. That's what I've used in similar-sounding situations.
In wxWidgets, you would want wxBufferedDC.
You could prepare animation as a bunch of images (wxImage loaded from PNG, GIF, JPG or whatever files), and then use a timer and paint them on a control. Maybe it sounds like too much, you I believe you could do it in 50-70 lines of code.
Perhaps you just could make a single widget that has a custom paint-event that hand-draws the various widgets inside it? Then you could draw them at the appropriate locations/sizes without having to involve wxwidgets at all, it would just be a bunch of line-draw/rectangle-draw/text-draw commands to update the display for each frame of animation.