123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #ifndef __CCPARALLAX_NODE_H__
- #define __CCPARALLAX_NODE_H__
- #include "2d/CCNode.h"
- NS_CC_BEGIN
- struct _ccArray;
- class CC_DLL ParallaxNode : public Node
- {
- public:
-
- static ParallaxNode * create();
-
- using Node::addChild;
-
- void addChild(Node * child, int z, const Vec2& parallaxRatio, const Vec2& positionOffset);
-
- void setParallaxArray( struct _ccArray *parallaxArray) { _parallaxArray = parallaxArray; }
-
- struct _ccArray* getParallaxArray() { return _parallaxArray; }
- const struct _ccArray* getParallaxArray() const { return _parallaxArray; }
-
-
-
- virtual void addChild(Node * child, int zOrder, int tag) override;
- virtual void addChild(Node * child, int zOrder, const std::string &name) override;
- virtual void removeChild(Node* child, bool cleanup) override;
- virtual void removeAllChildrenWithCleanup(bool cleanup) override;
- virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override;
- CC_CONSTRUCTOR_ACCESS:
-
- ParallaxNode();
-
- virtual ~ParallaxNode();
- protected:
- Vec2 absolutePosition();
- Vec2 _lastPosition;
- struct _ccArray* _parallaxArray;
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParallaxNode);
- };
- NS_CC_END
- #endif
|