A small game engine for 2D games based of Raylib
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 rivejä
633 B

11 kuukautta sitten
11 kuukautta sitten
  1. #pragma once
  2. #include "component.h"
  3. #include <string>
  4. #include "raylib.h"
  5. #include "transform.h"
  6. namespace ant::components::graphical {
  7. struct sprite_component : public ant::core::component {
  8. sprite_component() {}
  9. sprite_component(
  10. const std::string& texture_path,
  11. int layer = 0,
  12. ant::core::transform<> reposition = {{0,0},0},
  13. ant::core::Vec2<> scale = {1,1}
  14. );
  15. std::string name() override {return "sprite_component";}
  16. void render() override;
  17. private:
  18. Texture2D current_texture;
  19. ant::core::transform<> transform;
  20. ant::core::Vec2<> m_scale;
  21. int m_layer;
  22. };
  23. }