aboutsummaryrefslogtreecommitdiff
path: root/src/example/rendering_particle.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-10 16:21:05 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-10 16:21:05 +0100
commit7b8de90699aea153e73b5f2cee05c69b966b81be (patch)
tree123f8b71b59a933b2bfcffb9e43e5bea66086d8f /src/example/rendering_particle.cpp
parent33cd5566909ac089cdf56db38a3d1daf0cb7dd10 (diff)
implemented feedback wouter, improved animator. however if spritesheet aspect_ratio is not the same as the single frame then the scaling is wrong
Diffstat (limited to 'src/example/rendering_particle.cpp')
-rw-r--r--src/example/rendering_particle.cpp16
1 files changed, 3 insertions, 13 deletions
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 <crepe/Component.h>
#include <crepe/api/Animator.h>
#include <crepe/api/Camera.h>
@@ -9,7 +8,6 @@
#include <crepe/api/ParticleEmitter.h>
#include <crepe/api/Rigidbody.h>
#include <crepe/api/Sprite.h>
-#include <crepe/api/Texture.h>
#include <crepe/api/Transform.h>
#include <crepe/manager/ComponentManager.h>
#include <crepe/manager/Mediator.h>
@@ -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<Sprite>(
img, Sprite::Data{
@@ -65,16 +63,8 @@ public:
.position_offset = {0, 0},
});
- /*
-
- auto & anim = game_object.add_component<Animator>(test_sprite, 4, 4,
- Animator::Data{
- .fps = 1,
- .looping = false,
- });
- anim.set_anim(2);
- anim.active = false;
- */
+ auto & anim = game_object.add_component<Animator>(test_sprite,ivec2{32, 64}, uvec2{4,1}, Animator::Data{});
+ anim.set_anim(0);
auto & cam = game_object.add_component<Camera>(ivec2{1280, 720}, vec2{400, 400},
Camera::Data{