hx3d
1
2D/3D Simple Game Framework
|
2D texture manipulation. More...
#include <sprite.hpp>
Public Member Functions | |
Sprite () | |
Create a sprite without texture. More... | |
void | setTexture (const Ptr< Texture > &texture) |
Set the sprite texture. More... | |
void | setTexture (Framebuffer &buffer) |
Set the sprite texture from a framebuffer color buffer. More... | |
void | setTexture (TextureRegion ®ion) |
Set the sprite texture from a texture region. More... | |
Ptr< Texture > | getTexture () |
Get the sprite texture. More... | |
void | scaleTexture () |
Scale the texture coordinates following the texture size. | |
virtual void | draw (Ptr< Shader > shader) override |
Draw the mesh using a shader. More... | |
![]() | |
void | setTint (Color tint) |
Set the mesh tint. More... | |
Color & | getTint () |
Get the mesh tint. More... | |
void | updateColor () |
Update the mesh color from the tint. | |
void | setGeometry (Ptr< geom::BaseGeometry > geometry) |
Set the mesh geometry. More... | |
Ptr< geom::BaseGeometry > & | getGeometry () |
Get the mesh geometry. More... | |
Additional Inherited Members | |
![]() | |
Transform | transform |
Mesh transformation. | |
![]() | |
Color | _tint |
Tint color. | |
Ptr< geom::BaseGeometry > | _geometry |
Current geometry. | |
2D texture manipulation.
Example code
Definition at line 62 of file sprite.hpp.
hx3d::graphics::Sprite::Sprite | ( | ) |
Create a sprite without texture.
You must set it after with setTexture.
Definition at line 28 of file sprite.cpp.
Draw the mesh using a shader.
shader | Shader (Ptr) |
Reimplemented from hx3d::graphics::Mesh.
Definition at line 94 of file sprite.cpp.
void hx3d::graphics::Sprite::setTexture | ( | Framebuffer & | buffer | ) |
Set the sprite texture from a framebuffer color buffer.
buffer | Framebuffer |
Definition at line 49 of file sprite.cpp.
void hx3d::graphics::Sprite::setTexture | ( | TextureRegion & | region | ) |
Set the sprite texture from a texture region.
region | TextureRegion |
Definition at line 62 of file sprite.cpp.