|
virtual bool | isFrameDisplayed (SpriteFrame *frame) const |
| Returns whether or not a SpriteFrame is being displayed.
|
|
virtual SpriteFrame * | getSpriteFrame () const |
| Returns the current displayed frame.
|
|
V3F_C4B_T2F_Quad | getQuad () const |
| Returns the quad (tex coords, vertex coords and color) information.
|
|
bool | isTextureRectRotated () const |
| Returns whether or not the texture rectangle is rotated.
|
|
unsigned int | getAtlasIndex () const |
| Returns the index used on the TextureAtlas.
|
|
void | setAtlasIndex (unsigned int atlasIndex) |
| Sets the index used on the TextureAtlas.
|
|
const Rect & | getTextureRect () const |
| Returns the rect of the Sprite in points.
|
|
TextureAtlas * | getTextureAtlas () const |
| Gets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode.
|
|
virtual void | setProgramState (backend::ProgramState *programState) override |
| Set ProgramState.
|
|
virtual backend::ProgramState * | getProgramState () const override |
| Get current ProgramState.
|
|
void | setTextureAtlas (TextureAtlas *textureAtlas) |
| Sets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode.
|
|
const Vec2 & | getOffsetPosition () const |
| Gets the offset position of the sprite.
|
|
bool | isFlippedX () const |
| Returns the flag which indicates whether the sprite is flipped horizontally or not.
|
|
void | setFlippedX (bool flippedX) |
| Sets whether the sprite should be flipped horizontally or not.
|
|
bool | isFlippedY () const |
| Return the flag which indicates whether the sprite is flipped vertically or not.
|
|
void | setFlippedY (bool flippedY) |
| Sets whether the sprite should be flipped vertically or not.
|
|
const PolygonInfo & | getPolygonInfo () const |
| returns a reference of the polygon information associated with this sprite
|
|
void | setPolygonInfo (const PolygonInfo &info) |
| set the sprite to use this new PolygonInfo
|
|
void | setStretchEnabled (bool enabled) |
| whether or not contentSize stretches the sprite's texture
|
|
bool | isStretchEnabled () const |
| returns whether or not contentSize stretches the sprite's texture
|
|
virtual void | updateTransform () override |
| Updates the quad according the rotation, position, scale values.
|
|
virtual SpriteBatchNode * | getBatchNode () const |
| Returns the batch node object if this sprite is rendered by SpriteBatchNode.
|
|
virtual void | setBatchNode (SpriteBatchNode *spriteBatchNode) |
| Sets the batch node to sprite.
|
|
virtual void | setTexture (const std::string &filename) |
| Sets a new texture (from a filename) to the sprite.
|
|
virtual void | setTexture (Texture2D *texture) override |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The Texture's rect is not changed.
|
|
virtual Texture2D * | getTexture () const override |
| Returns the Texture2D object used by the sprite.
|
|
virtual void | setTextureRect (const Rect &rect) |
| Updates the texture rect of the Sprite in points.
|
|
virtual void | setTextureRect (const Rect &rect, bool rotated, const Size &untrimmedSize) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It will update the texture coordinates and the vertex rectangle.
|
|
virtual void | setVertexRect (const Rect &rect) |
| Sets the vertex rect.
|
|
virtual void | setCenterRectNormalized (const Rect &rect) |
| setCenterRectNormalized
|
|
virtual Rect | getCenterRectNormalized () const |
| getCenterRectNormalized
|
|
virtual void | setCenterRect (const Rect &rect) |
|
virtual Rect | getCenterRect () const |
| Returns the Cap Insets rect.
|
|
virtual void | setSpriteFrame (const std::string &spriteFrameName) |
|
virtual void | setSpriteFrame (SpriteFrame *newFrame) |
|
virtual void | setDisplayFrameWithAnimationName (const std::string &animationName, unsigned int frameIndex) |
| Changes the display frame with animation name and index.
|
|
virtual bool | isDirty () const |
| Whether or not the Sprite needs to be updated in the Atlas.
|
|
virtual void | setDirty (bool dirty) |
| Makes the Sprite to be updated in the Atlas.
|
|
virtual std::string | getDescription () const override |
| NA
|
|
virtual void | setScaleX (float scaleX) override |
| Sets the scale (x) of the node.
|
|
virtual void | setScaleY (float scaleY) override |
| Sets the scale (y) of the node.
|
|
virtual void | setScale (float scaleX, float scaleY) override |
| Sets the scale (x,y) of the node.
|
|
virtual void | setPosition (const Vec2 &pos) override |
| NA NA
|
|
virtual void | setPosition (float x, float y) override |
| Sets the position (x,y) of the node in its parent's coordinate system.
|
|
virtual void | setRotation (float rotation) override |
| Sets the rotation (angle) of the node in degrees.
|
|
virtual void | setRotationSkewX (float rotationX) override |
| Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew.
|
|
virtual void | setRotationSkewY (float rotationY) override |
| Sets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew.
|
|
virtual void | setSkewX (float sx) override |
| Changes the X skew angle of the node in degrees.
|
|
virtual void | setSkewY (float sy) override |
| Changes the Y skew angle of the node in degrees.
|
|
virtual void | removeChild (Node *child, bool cleanup) override |
| Removes a child from the container.
|
|
virtual void | removeAllChildrenWithCleanup (bool cleanup) override |
| Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.
|
|
virtual void | reorderChild (Node *child, int zOrder) override |
| Reorders a child according to a new z value.
|
|
virtual void | addChild (Node *child, int zOrder, int tag) override |
| Adds a child to the container with z order and tag.
|
|
virtual void | addChild (Node *child, int zOrder, const std::string &name) override |
| Adds a child to the container with z order and tag.
|
|
virtual void | sortAllChildren () override |
| Sorts the children array once before drawing, instead of every time when a child is added or reordered.
|
|
virtual void | setScale (float scale) override |
| Sets the scale (x,y,z) of the node.
|
|
virtual void | setPositionZ (float positionZ) override |
| Sets the 'z' coordinate in the position.
|
|
virtual void | setAnchorPoint (const Vec2 &anchor) override |
| Sets the anchor point in percent.
|
|
virtual void | setContentSize (const Size &size) override |
| Sets the untransformed size of the node.
|
|
virtual void | setIgnoreAnchorPointForPosition (bool value) override |
| Sets whether the anchor point will be (0,0) when you position this node.
|
|
virtual void | setVisible (bool bVisible) override |
| Sets whether the node is visible.
|
|
virtual void | setOpacityModifyRGB (bool modify) override |
| If you want the opacity affect the color property, then set to true.
|
|
virtual bool | isOpacityModifyRGB () const override |
| If node opacity will modify the RGB color value, then you should override this method and return true.
|
|
void | setBlendFunc (const BlendFunc &blendFunc) override |
|
const BlendFunc & | getBlendFunc () const override |
| NA NA
|
|
static Sprite * | create () |
| Creates an empty sprite without texture.
|
|
static Sprite * | create (const std::string &filename) |
| Creates a sprite with an image filename.
|
|
static Sprite * | create (const PolygonInfo &info) |
| Creates a polygon sprite with a polygon info.
|
|
static Sprite * | create (const std::string &filename, const Rect &rect) |
| Creates a sprite with an image filename and a rect.
|
|
static Sprite * | createWithTexture (Texture2D *texture) |
| Creates a sprite with a Texture2D object.
|
|
static Sprite * | createWithTexture (Texture2D *texture, const Rect &rect, bool rotated=false) |
| Creates a sprite with a texture and a rect.
|
|
static Sprite * | createWithSpriteFrame (SpriteFrame *spriteFrame) |
| Creates a sprite with an sprite frame.
|
|
static Sprite * | createWithSpriteFrameName (const std::string &spriteFrameName) |
| Creates a sprite with an sprite frame name.
|
|
static Node * | create () |
| Allocates and initializes a node.
|
|
static int | getAttachedNodeCount () |
| Gets count of nodes those are attached to scene graph.
|
|
template<typename _T > |
static void | sortNodes (cocos2d::Vector< _T * > &nodes) |
| Sorts helper function.
|
|
unsigned int | _ID |
| object id, ScriptSupport need public _ID
|
|
int | _luaID |
| Lua reference id.
|
|
void * | _scriptObject |
| scriptObject, support for swift
|
|
bool | _rooted |
| When true, it means that the object was already rooted.
|
|
static const int | INDEX_NOT_INITIALIZED = -1 |
| Sprite invalid index on the SpriteBatchNode.
|
|
| Sprite () |
| ctor
|
|
virtual bool | initWithTexture (Texture2D *texture) |
| Initializes a sprite with a texture.
|
|
virtual bool | initWithPolygon (const PolygonInfo &info) |
| Initializes a sprite with a PolygonInfo.
|
|
virtual bool | initWithTexture (Texture2D *texture, const Rect &rect) |
| Initializes a sprite with a texture and a rect.
|
|
virtual bool | initWithTexture (Texture2D *texture, const Rect &rect, bool rotated) |
| Initializes a sprite with a texture and a rect in points, optionally rotated.
|
|
virtual bool | initWithSpriteFrame (SpriteFrame *spriteFrame) |
| Initializes a sprite with an SpriteFrame.
|
|
virtual bool | initWithSpriteFrameName (const std::string &spriteFrameName) |
| Initializes a sprite with an sprite frame name.
|
|
virtual bool | initWithFile (const std::string &filename) |
| Initializes a sprite with an image filename.
|
|
virtual bool | initWithFile (const std::string &filename, const Rect &rect) |
| Initializes a sprite with an image filename, and a rect.
|
|