Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SpriteRenderer

Add this in your code:

#include <engine/graphics/2d_graphics/sprite_renderer.h>

Description

Component that renders a sprite with a texture and material.

Public Methods


GetColor

Get the color of the sprite.

const Color& GetColor() const

SetColor

Set the color of the sprite.

Parameters:

  • color: New color
void SetColor(const Color& color)

GetMaterial

Get the material of the sprite.

const std::shared_ptr<Material>& GetMaterial() const

SetMaterial

Set the material of the sprite.

Parameters:

  • material: New material
void SetMaterial(const std::shared_ptr<Material>& material)

GetTexture

Get the texture of the sprite.

const std::shared_ptr<Texture>& GetTexture() const

SetTexture

Set the texture of the sprite.

Parameters:

  • texture: New texture
void SetTexture(const std::shared_ptr<Texture>& texture)