44 #ifndef __CU_ANIMATION_NODE_H__
45 #define __CU_ANIMATION_NODE_H__
47 #include "CUPolygonNode.h"
48 #include "../math/CURect.h"
49 #include "../renderer/CUTexture.h"
55 #pragma mark AnimationNode
89 #pragma mark Constructors
148 bool initWithFilmstrip(
const std::shared_ptr<Texture>& texture,
int rows,
int cols,
int size);
152 #pragma mark Static Constructors
169 static std::shared_ptr<AnimationNode>
alloc(
const std::shared_ptr<Texture>& texture,
170 int rows,
int cols) {
171 std::shared_ptr<AnimationNode> node = std::make_shared<AnimationNode>();
172 return (node->initWithFilmstrip(texture,rows,cols) ? node :
nullptr);
194 static std::shared_ptr<AnimationNode>
alloc(
const std::shared_ptr<Texture>& texture,
195 int rows,
int cols,
int size) {
196 std::shared_ptr<AnimationNode> node = std::make_shared<AnimationNode>();
197 return (node->initWithFilmstrip(texture,rows,cols,size) ? node :
nullptr);
201 #pragma mark Attribute Accessors
unsigned int getFrame() const
Definition: CUAnimationNode.h:214
int _frame
Definition: CUAnimationNode.h:84
int _cols
Definition: CUAnimationNode.h:80
bool initWithFilmstrip(const std::shared_ptr< Texture > &texture, int rows, int cols)
Definition: CUAnimationNode.h:126
Definition: CUPolygonNode.h:79
int getSize() const
Definition: CUAnimationNode.h:207
Rect _bounds
Definition: CUAnimationNode.h:86
static std::shared_ptr< AnimationNode > alloc(const std::shared_ptr< Texture > &texture, int rows, int cols)
Definition: CUAnimationNode.h:169
static std::shared_ptr< AnimationNode > alloc(const std::shared_ptr< Texture > &texture, int rows, int cols, int size)
Definition: CUAnimationNode.h:194
Definition: CUAnimationNode.h:52
int _size
Definition: CUAnimationNode.h:82
Definition: CUAnimationNode.h:77
~AnimationNode()
Definition: CUAnimationNode.h:108