aboutsummaryrefslogtreecommitdiff
path: root/src/example/rendering_particle.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-02 20:02:14 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-02 20:02:14 +0100
commita84ca09e97d466643f022acfffcf4c6a77f42052 (patch)
treef375067b4250f468eb3b57d968efa3417f0f521d /src/example/rendering_particle.cpp
parent135af8b0e0eaf8a5a5b7e1a42bfb20bb14ec97e5 (diff)
making struct constructors
Diffstat (limited to 'src/example/rendering_particle.cpp')
-rw-r--r--src/example/rendering_particle.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/example/rendering_particle.cpp b/src/example/rendering_particle.cpp
index 5a50d27..4fd4071 100644
--- a/src/example/rendering_particle.cpp
+++ b/src/example/rendering_particle.cpp
@@ -56,11 +56,24 @@ public:
auto img = Texture("asset/spritesheet/pokemon_spritesheet.png");
Sprite & test_sprite = game_object.add_component<Sprite>(
- img, color, Sprite::FlipSettings{false, false}, 1, 1, vec2{100, 100});
+ img, Sprite::Data{
+ .color = color,
+ .flip = Sprite::FlipSettings{false, false},
+ .sorting_in_layer = 2,
+ .order_in_layer = 2,
+ .size = {0, 100},
+ .angle_offset = 0,
+ .scale = 1,
+ });
- auto & anim = game_object.add_component<Animator>(test_sprite, 4, 4, 0);
+ auto & anim = game_object.add_component<Animator>(Animator::Data{
+ .spritesheet = test_sprite,
+ .col = 4,
+ .row = 4,
+ .fps = 10,
+ });
- auto & cam = game_object.add_component<Camera>(Color::, ivec2{720, 1280},
+ auto & cam = game_object.add_component<Camera>(Color::WHITE, ivec2{720, 1280},
vec2{400, 400}, 1.0);
}