From 7b8de90699aea153e73b5f2cee05c69b966b81be Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Tue, 10 Dec 2024 16:21:05 +0100 Subject: implemented feedback wouter, improved animator. however if spritesheet aspect_ratio is not the same as the single frame then the scaling is wrong --- src/example/rendering_particle.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/example') diff --git a/src/example/rendering_particle.cpp b/src/example/rendering_particle.cpp index cfc5a84..44bd96a 100644 --- a/src/example/rendering_particle.cpp +++ b/src/example/rendering_particle.cpp @@ -1,5 +1,4 @@ #include "api/Asset.h" -#include "manager/ResourceManager.h" #include #include #include @@ -9,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -52,7 +50,7 @@ public: Color color(255, 255, 255, 255); - Asset img{"asset/texture/test_ap43.png"}; + Asset img{"asset/spritesheet/spritesheet_test.png"}; Sprite & test_sprite = game_object.add_component( img, Sprite::Data{ @@ -65,16 +63,8 @@ public: .position_offset = {0, 0}, }); - /* - - auto & anim = game_object.add_component(test_sprite, 4, 4, - Animator::Data{ - .fps = 1, - .looping = false, - }); - anim.set_anim(2); - anim.active = false; - */ + auto & anim = game_object.add_component(test_sprite,ivec2{32, 64}, uvec2{4,1}, Animator::Data{}); + anim.set_anim(0); auto & cam = game_object.add_component(ivec2{1280, 720}, vec2{400, 400}, Camera::Data{ -- cgit v1.2.3