Use SWF/Flash in cocos2d-x; cocos2d (cocos2d-x) direct playback flash/

Source: Internet
Author: User

Some time ago, we transplanted a browser game to the mobile game. The original browser game project contains more than 1000 Flash characters, pet animations, and special effects.

If this is all done again, are you still tired? So I want to play the SWF file directly in Cocos2d (x. (Including scene, scene animation, character, pet actions)

 


The idea is as follows: parse swf and then draw the various tags in swf. sprite uses opengl es to draw.

Previously, I worked on Flash in the MP4 era. However, in that era, the cpu did not support opengl es and the memory was still 16 Mb.

So you must learn opengl es, NeHe, Redbook, Blue Book, and graphics again... Swf_file_format_spec... You can drop a few large parts in a month.

Then, we will spend another month to complete the code. And integrate the code into cocos2d (x ....

 


Tired of a word!

 


Integrated into Cocos2d and Cocos2dx, supports es 1.0 2.0:

CCFlashNode * fn = CCFlashNode: create ("dog.swf ");

Fn-> setPosition (ccp (100,100 ));

Fn-> setScale (0.8f );

Fn-> setFlipx (true );

F n-> setRepeat (true );

Fn-> runAction (true );

AddChild (fn );

 


Fn-> setFrameEvent (-1, CC_SELECTOR (: fun ));

Fn-> stopAction ();

 


 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.