如何学习“COCOS2D中的动画” [英] how to learn "Animations in COCOS2D"

查看:139
本文介绍了如何学习“COCOS2D中的动画”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是cocos2d动画的新手,我想学习它,因为我总是在cocos2d制作iPhone游戏时停下动画。

I am new to cocos2d animations and I want to learn it , as always I stops at the point of animation while making iPhone games in cocos2d.

建议我学习这种动画的方式,这样游戏动画制作将变得容易。

Can any one suggest me the way to learn such animations, so that games animation creating will become easy to make.

谢谢。

推荐答案

似乎有两种方法 - 或者你的sprite以常规的方式布局,所以可以通过程序化的方式从sprite表中获取,就像第一个例子。另一种方法是使用像Zwoptex这样的工具创建sprite工作表和一个相应的plist,告诉Cocos2d在工作表中查找图像的位置。参见第二个示例。

Seems like there are 2 ways to go - either your sprites are laid out in a regular fashion and so can be picked off the sprite sheet in a programmatic way, like this first example. The other way is to use a tool like Zwoptex to create the sprite sheet and a corresponding plist that tells Cocos2d where to find the images on the sheet, see second example.

使用常规布局获取sprite的教程:

Tutorial for getting sprites off a sheet, using a regular layout:

http://getsetgames.com/2010/04/18/how-to-animate-sprites-in-cocos2d/

基本信息如下:


  1. 将图片合并成一张大图片/纹理

  2. 使用该纹理创建CCSpriteSheet

  3. 使用sprite表中的某个图片创建CCSprite

  4. 创建CCAnimation并用CCSpriteFrame填充它 - 每个都代表动画中的一个框架

  5. 创建一个CCAnimate动作以管理显示每个框架并在sprite上运行它。

  1. Get your images into one large image/texture
  2. Create a CCSpriteSheet using that texture
  3. Create a CCSprite using one of the images in your sprite sheet
  4. Create a CCAnimation and populate it with CCSpriteFrame's - each representing a frame in the animation
  5. Create a CCAnimate action to manage showing each frame and run it on sprite, voila.

另一种方法是使用像 Zwoptex 这样的工具

The alternative is to use a tool like Zwoptex to configure your images on a sheet which will export the sprite sheet and a plist of details of the images on it.

本教程的前三分之一解释了:

The first third of this tutorial explains it:

http://www.raywenderlich.com/606/how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone

希望有帮助,
Chris

Hope that helps, Chris

这篇关于如何学习“COCOS2D中的动画”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆