Skip to content

Struct Engine::FrameData

ClassList > Engine > FrameData

Represents an individual frame rectangle in a spritesheet and optional pivot offset.

  • #include <Animation.hpp>

Public Attributes

Type Name
float pivotX = 0.0f
float pivotY = 0.0f
raylib::Rectangle rect

Public Functions

Type Name
FrameData () = default
Default constructor initializing an empty frame.
FrameData (const raylib::Rectangle & r, float px=0.0f, float py=0.0f)
Constructs frame data using a Raylib rectangle and optional pivots.
FrameData (float x, float y, float w, float h, float px=0.0f, float py=0.0f)
Constructs frame data using raw coordinates and dimensions.

Public Attributes Documentation

variable pivotX

float Engine::FrameData::pivotX;

Horizontal alignment offset relative to the entity's position.


variable pivotY

float Engine::FrameData::pivotY;

Vertical alignment offset relative to the entity's position.


variable rect

raylib::Rectangle Engine::FrameData::rect;

Sub-rectangle within the texture atlas (x, y, width, height).


Public Functions Documentation

function FrameData [⅓]

Default constructor initializing an empty frame.

Engine::FrameData::FrameData () = default


function FrameData [⅔]

Constructs frame data using a Raylib rectangle and optional pivots.

Engine::FrameData::FrameData (
    const raylib::Rectangle & r,
    float px=0.0f,
    float py=0.0f
) 

Parameters:

  • r Sub-rectangle within the texture.
  • px Horizontal pivot offset.
  • py Vertical pivot offset.

function FrameData [3/3]

Constructs frame data using raw coordinates and dimensions.

Engine::FrameData::FrameData (
    float x,
    float y,
    float w,
    float h,
    float px=0.0f,
    float py=0.0f
) 

Parameters:

  • x X coordinate of the top-left corner in the texture.
  • y Y coordinate of the top-left corner in the texture.
  • w Width of the frame rectangle.
  • h Height of the frame rectangle.
  • px Horizontal pivot offset.
  • py Vertical pivot offset.


The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/Components/Animation.hpp