GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::SpriteInstance2D Struct Reference

Configuration of a 2D sprite instance from a SpriteAtlas to draw. More...

#include <GREM/graphics_2d/Instances2D.hpp>

Public Attributes

vec2 position {0.0f, 0.0f}
 Position, in world coordinates, to draw the sprite at, with respect to its SpriteInstance2D::origin.
float angle = 0.0f
 Angle, in radians, to rotate the sprite counter-clockwise by, around its SpriteInstance2D::origin.
vec2 scale {1.0f, 1.0f}
 Coefficients to scale the size of the sprite by.
vec2 origin {0.0f, 0.0f}
 Offset, in local vertex coordinates, specifying the origin relative to the bottom left of the sprite.
Color color = Color::WHITE
 Tint color to use in the shader.
Color emissiveColor = Color::INVISIBLE
 Emissive color to use in the shader.

Detailed Description

Configuration of a 2D sprite instance from a SpriteAtlas to draw.

Member Data Documentation

◆ position

vec2 grem::graphics::SpriteInstance2D::position {0.0f, 0.0f}

Position, in world coordinates, to draw the sprite at, with respect to its SpriteInstance2D::origin.

◆ angle

float grem::graphics::SpriteInstance2D::angle = 0.0f

Angle, in radians, to rotate the sprite counter-clockwise by, around its SpriteInstance2D::origin.

◆ scale

vec2 grem::graphics::SpriteInstance2D::scale {1.0f, 1.0f}

Coefficients to scale the size of the sprite by.

The resulting textured quad will have the size of the original sprite, multiplied by this value.

◆ origin

vec2 grem::graphics::SpriteInstance2D::origin {0.0f, 0.0f}

Offset, in local vertex coordinates, specifying the origin relative to the bottom left of the sprite.

For example, a value of (0.5, 0.5) corresponds to the middle of the sprite.

◆ color

Color grem::graphics::SpriteInstance2D::color = Color::WHITE

Tint color to use in the shader.

Note
In the default shader, the output color is multiplied by this value, meaning that a value of Color::WHITE, i.e. RGBA(1, 1, 1, 1) in linear color, represents no modification to the original texture color.

◆ emissiveColor

Color grem::graphics::SpriteInstance2D::emissiveColor = Color::INVISIBLE

Emissive color to use in the shader.

Note
In the default shader, the output color has this value added to it, meaning that a value of Color::INVISIBLE, i.e. RGBA(0, 0, 0, 0) in linear color, represents no modification to the original texture color.

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