cocos2d-x  3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TextureProtocol Class Referenceabstract

Node objects that uses a Texture2D to render the images. More...

#include <CCProtocols.h>

Inheritance diagram for TextureProtocol:
BlendProtocol AtlasNode MotionStreak ParticleBatchNode ParticleSystem Sprite SpriteBatchNode LabelAtlas TileMapAtlas ParticleSystemQuad PhysicsSprite Skin Label TMXLayer ParticleExplosion ParticleFire ParticleFireworks ParticleFlower ParticleGalaxy ParticleMeteor ParticleRain ParticleSmoke ParticleSnow ParticleSpiral ParticleSun TextFieldTTF

Public Member Functions

virtual ~TextureProtocol ()
virtual Texture2DgetTexture () const =0
 Returns the currently used texture. More...
 
virtual void setTexture (Texture2D *texture)=0
 Sets a new texuture. More...
 
- Public Member Functions inherited from BlendProtocol
virtual ~BlendProtocol ()
virtual void setBlendFunc (const BlendFunc &blendFunc)=0
 Sets the source blending function. More...
 
virtual const BlendFuncgetBlendFunc () const =0
 Returns the blending function that is currently being used. More...
 

Detailed Description

Node objects that uses a Texture2D to render the images.

The texture can have a blending function. If the texture has alpha premultiplied the default blending function is: src=GL_ONE dst= GL_ONE_MINUS_SRC_ALPHA else src=GL_SRC_ALPHA dst= GL_ONE_MINUS_SRC_ALPHA But you can change the blending function at any time.

Constructor & Destructor Documentation

virtual ~TextureProtocol ( )
inlinevirtual

Member Function Documentation

virtual Texture2D* getTexture ( ) const
pure virtual

Returns the currently used texture.

Returns
The texture that is currenlty being used.

Implemented in ParticleSystem, Sprite, SpriteBatchNode, ParticleBatchNode, MotionStreak, and AtlasNode.

virtual void setTexture ( Texture2D texture)
pure virtual

Sets a new texuture.

It will be retained.

Parameters
textureA valid Texture2D object, which will be applied to this sprite object.

Implemented in ParticleSystem, Sprite, SpriteBatchNode, ParticleBatchNode, MotionStreak, ParticleSystemQuad, and AtlasNode.


The documentation for this class was generated from the following file: