Quick-cocos2d-x Spine Skeletal Animation (1)

Source: Internet
Author: User
Tags split win32 sublime text

This article is to help many novice less detours, the great God do not bother. Do not like to spray.


Go straight to the chase:

To use spine skeletal animation, first install a runtime environment, download address: https://github.com/EsotericSoftware/spine-runtimes

You need to register for a github account to download. Log in after registration, click "Download ZIP" (recommended to use the agent when downloading), unzip as shown in the figure:

Double click to open, go to the Spine-c folder, we need everything inside.


Then go to Quick-cocos2d-x's extensions directory, for example: Create a new folder named Spine.


Put Spine-runtimes-master\spine-c\include\spine (. h file), Spine-runtimes-master\spine-c\src\spine (. c file) And all the files under Spine-runtimes-master\spine-cocos2dx\2\src\spine are copied to the Extensions\spine directory above;


Then open the Player.sln under D:\quick-cocos2d-x-2.2.5\player\proj.win32, and under Cocos2dx_2012\cocos2d-x\extensions, right-click to add a spine folder ( The Chinese version of the translation is called the filter) (if it is already deleted), and then right-add the existing item, the Extensions\spine under the entire file to add to the spine filter.


Save all to build the solution.

If there is an error: "Ccnodergba": Not "cocos2d" members, the Ccnodergba all changed to Ccnode. Rebuild the solution.

---------------------------------------Gorgeous split-line---------------------------------------------------

Continue configuration:

(1) Under Quick-cocos2d-x-2.2.5\lib\luabinding\extensions, create a new. Tolua file, such as Skeletonanimation.tolua, to put the interface you want to export in this file;

(2) Add the new Tolua file path in the Cocos-ext.tolua under Quick-cocos2d-x-2.2.5\lib\luabinding\extensions, for example: $pfile "extensions/ Skeletonanimation.tolua ".

(3) Double-click Quick-cocos2d-x-2.2.5\lib\luabinding under the BUILD.bat, normal words after a few seconds the cmd window flashed and died.

(4) Build the solution again.

(5) Find Quick-cocos2d-x-2.2.5\player\win under the Player.exe, change a name such as Player1.exe;

Quick-cocos2d-x-2.2.5\player\proj.win32\debug under the Player.exe copy to Quick-cocos2d-x-2.2.5\player\win, if the previous name is overwritten.

---------------------------------------Gorgeous split-line---------------------------------------------------

(1) Put the finished Bone animation folder (for example, named: Test) into the Res directory

(2) The tool I used was sublime Text, adding a statement to the import resource in the Myapp.lua Myapp:run function: Ccfileutils:sharedfileutils (): Addsearchpath ("res/sg_hz/ ")

(3) Add skeletal animations to the ctor function in the game's startup scene.

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.