sbhhbs / Hello-LWF-Cocos2d-x

Sample code for cocos2d-x backed animation in android fragment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample code for cocos2d-x backed animation in android fragment

This repo is forked from splhack/Hello-LWF-Cocos2d-x and is the sample code for this blog post, which explains how to use cocos2d-x to support animations in a fragment.

How to use

If you just want to run the demo. Open the project under BabyAnimationDemo.

To modify the animation part, you can:

  1. Open the project under proj.ios_mac or proj.win32;
  2. Make changes. Note that if you added or removed C++ files, Android.mk should also be updated;
  3. Run ./build_native.py -b release under proj.android to compile for android platform;
  4. Copy files under proj.android/libs/ to BabyAnimationDemo/app/src/main/libs/;
  5. Re-run BabyAnimationDemo

在 Android Fragment 中使用 Cocosd-x 的示例代码

该项目是从 splhack/Hello-LWF-Cocos2d-x fork 出来的。是这一篇 Blog 的示例代码。

如何使用

如果你只是想要打开看看效果,打开 BabyAnimationDemo 下的项目。

如果要对动画部分作出更改:

  1. 打开 proj.ios_macproj.win32 下的项目;
  2. 作出更改。 注意,如果你添加或删除了 C++ 的源文件, Android.mk 也需要做相应的更新;
  3. proj.android 目录下运行 ./build_native.py -b release 进行编译;
  4. proj.android/libs/ 目录下的文件拷贝到 BabyAnimationDemo/app/src/main/libs/;
  5. 重新运行 BabyAnimationDemo

About

Sample code for cocos2d-x backed animation in android fragment


Languages

Language:C++ 57.6%Language:Objective-C 19.5%Language:C 11.3%Language:Java 5.7%Language:Objective-C++ 2.3%Language:CMake 1.4%Language:Python 0.6%Language:GLSL 0.3%Language:Lua 0.3%Language:C# 0.2%Language:Shell 0.2%Language:Makefile 0.2%Language:PowerShell 0.1%Language:JavaScript 0.1%