Skip to content

Class Sprite

ClassList > Sprite

  • #include <Sprite.h>

Inherits the following classes: ObjectID

Public Types inherited from ObjectID

See ObjectID

Type Name
enum GOType
Enumeration of scene object types.

Public Attributes

Type Name
float spr_opacity = 0.9f
RenderShader spr_shader
Texture spr_tex
SpriteType spr_type = SpriteType::NONE\_SPRITE

Public Attributes inherited from ObjectID

See ObjectID

Type Name
bool is_rendered = true
Included in rendering pipeline.
bool is_viewport = true
Visible in viewport (editor-only)
std::string o_name
Display name in editor UI .
GOType o_type = NONE\_GO
Runtime type identifier.

Public Functions

Type Name
virtual void * GetShader () override
Returns pointer to object's shader, if applicable.
std::string ParsePath () const
void RenderSprite (const Context & ctx, const glm::vec3 & pos, const glm::vec3 & col, int id)
void RenderSprite (const Context & ctx)
void SetSpriteShader ()
void SetTex ()
Sprite ()

Public Functions inherited from ObjectID

See ObjectID

Type Name
virtual void * GetMaterial ()
Returns pointer to object's material, if applicable.
virtual void * GetShader ()
Returns pointer to object's shader, if applicable.
virtual void * GetTransform ()
Returns pointer to object's transform, if applicable.
ObjectID ()
Constructs an ObjectID with default values.
void SetVisible (bool v, bool r)
Sets visibility flags for viewport and rendering.
~ObjectID ()
Destroys the ObjectID .

Public Functions inherited from UID

See UID

Type Name
int GetObjectID () const
Returns the unique ID of this object.
UID ()
Constructs a UID and assigns a unique ID.
virtual ~UID () = default
Virtual destructor for polymorphic use.

Public Static Functions inherited from UID

See UID

Type Name
int GetTotalAllocated ()
Returns total number of UIDs allocated.

Public Attributes Documentation

variable spr_opacity

float Sprite::spr_opacity;

variable spr_shader

RenderShader Sprite::spr_shader;

variable spr_tex

Texture Sprite::spr_tex;

variable spr_type

SpriteType Sprite::spr_type;

Public Functions Documentation

function GetShader

Returns pointer to object's shader, if applicable.

inline virtual void * Sprite::GetShader () override

Returns:

Void pointer cast to Shader*, or nullptr if no shader

Note:

Override in derived classes that own shaders (Mesh, Material, etc.)

Implements ObjectID::GetShader


function ParsePath

std::string Sprite::ParsePath () const

function RenderSprite [1/2]

void Sprite::RenderSprite (
    const Context & ctx,
    const glm::vec3 & pos,
    const glm::vec3 & col,
    int id
) 

function RenderSprite [2/2]

void Sprite::RenderSprite (
    const Context & ctx
) 

function SetSpriteShader

void Sprite::SetSpriteShader () 

function SetTex

void Sprite::SetTex () 

function Sprite

Sprite::Sprite () 


The documentation for this class was generated from the following file src/scene/Sprite.h