21 #include "hx3d/graphics/sprite.hpp" 23 #include "hx3d/graphics/geometries/sprite_geometry.hpp" 82 auto& uv =
_geometry->getAttribute(
"Texture").getVector();
83 for (
unsigned int i = 0; i < uv.size(); i+=2) {
void activateFramebufferMode()
Prepare the sprite for render-to-texture mode.
void setTint(Color tint)
Set the mesh tint.
Ptr< Texture > getColorBuffer()
Get the framebuffer color buffer.
Sprite()
Create a sprite without texture.
float getMaxX()
Get the right coordinate.
void setTexture(const Ptr< Texture > &texture)
Set the sprite texture.
CounterClockwise culling: back face.
float getMaxY()
Get the top coordinate.
static Color White
White color.
float getMinY()
Get the bottom coordinate.
virtual void draw(Ptr< Shader > shader) override
Draw the mesh using a shader.
void activateTextureMode()
Prepare the sprite for simple texture mode.
const Ptr< Texture > & getTexture()
Get the texture.
Defines a rectangle in a texture.
void setFromRegion(TextureRegion ®ion)
Set the geometry for a texture region.
void scaleTexture()
Scale the texture coordinates following the texture size.
Ptr< geom::BaseGeometry > _geometry
Current geometry.
Transform transform
Mesh transformation.
Displayable 2D/3D element.
Render-to-texture buffer.
float getMinX()
Get the left coordinate.
virtual void draw(Ptr< Shader > shader)
Draw the mesh using a shader.
static void disable()
Clear the current texture for drawing.
static void use(Ptr< Texture > texture)
Use the current texture for drawing.
Ptr< Texture > getTexture()
Get the sprite texture.
Sprite defined VBO geometry.
std::shared_ptr< T > Ptr
Quick-typing shared ptr.