44 #ifndef __CU_ANIMATION_NODE_H__
45 #define __CU_ANIMATION_NODE_H__
47 #include <cugl/2d/CUPolygonNode.h>
48 #include <cugl/math/CURect.h>
49 #include <cugl/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);
175 #pragma mark Static Constructors
192 static std::shared_ptr<AnimationNode>
alloc(
const std::shared_ptr<Texture>& texture,
193 int rows,
int cols) {
194 std::shared_ptr<AnimationNode> node = std::make_shared<AnimationNode>();
195 return (node->initWithFilmstrip(texture,rows,cols) ? node :
nullptr);
217 static std::shared_ptr<AnimationNode>
alloc(
const std::shared_ptr<Texture>& texture,
218 int rows,
int cols,
int size) {
219 std::shared_ptr<AnimationNode> node = std::make_shared<AnimationNode>();
220 return (node->initWithFilmstrip(texture,rows,cols,size) ? node :
nullptr);
245 const std::shared_ptr<JsonValue>& data) {
246 std::shared_ptr<AnimationNode> result = std::make_shared<AnimationNode>();
247 if (!result->initWithData(loader,data)) { result =
nullptr; }
248 return std::dynamic_pointer_cast<Node>(result);
253 #pragma mark Attribute Accessors