Senpai::Components

Code
C++
Game
Author

Daniel Schwarzenbach

Published

April 24, 2025


Transform

Transform(
  Vec2<f32> translate = {0.0f, 0.0f}, 
  Vec2<f32> scale = {1.0f, 1.0f},
  f32 rotation = 0.0f, 
  Vec2<f32> rotAnchor = {0.5f, 0.5f}
);

Vec2<f32>& translate();
Vec2<f32>& scale();
Vec2<f32>& rotAnchor();
f32& rotation();

Info

Info(String name = "Entity", String tag = "default");

TileSet

TileSet(String const& filename, u16 cols, u16 rows, f32 sizeX, 
        f32 sizeY, String const& name = "");

ScriptsHolder

is automatically adden when a script is addet to an entity.

ButtonUI

ButtonUI(Ptr<Assets::Font> fontPtr = nullptr, String text = "",
        Color textColor = {0, 0, 0, 255},
        Color buttonColor = {255, 255, 255, 120},
        Color buttonHoverColor = {255, 255, 255, 200},
        Vec2<f32> buttonScale = {100, 100});

Sprite

Sprite(Ptr<Assets::Texture> assetPtr = nullptr,
          Vec2<f32> offset = {0.0f, 0.0f}, Set<Flip> flips = {});

Camera

Camera(Vec2<f32> offset = {0, 0}, f32 zoom = 1,
      Rectangle<f32> viewport = {{0, 0}, {1, 1}});

Animator

Animator(f32 fps = 15, Vector<Ptr<Assets::Animation>> animations = {},
          Vector<u32> nextAnimations = {});

Light

Light(Ptr<Assets::Texture> assetPtr = nullptr, Set<Flip> flips = {});