diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-11 18:37:23 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-11 18:37:23 +0100 |
commit | ca6c4f30df6612f60db0fdfe4c2d366d7e4da8ea (patch) | |
tree | 199878898c2ddcdd2f7f6a1b76c165c2c7db5c8d /src/example/replay.cpp | |
parent | f0ecbea57a4d75905c4ee79608807187cd8f3e72 (diff) | |
parent | 30c17c98e54c1534664de08ca3838c40c859d166 (diff) |
merge master
Diffstat (limited to 'src/example/replay.cpp')
-rw-r--r-- | src/example/replay.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/example/replay.cpp b/src/example/replay.cpp index a3c7fba..0c4f9b3 100644 --- a/src/example/replay.cpp +++ b/src/example/replay.cpp @@ -9,7 +9,6 @@ #include <crepe/api/Scene.h> #include <crepe/api/Script.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> @@ -41,19 +40,19 @@ class Timeline : public Script { switch (i++) { default: break; case 10: - mgr.record_start(); + // mgr.record_start(); Log::logf("start"); break; case 60: - this->recording = mgr.record_end(); + // this->recording = mgr.record_end(); Log::logf("stop"); break; case 70: - mgr.play(this->recording); + // mgr.play(this->recording); Log::logf("play"); break; case 71: - mgr.release(this->recording); + // mgr.release(this->recording); Log::logf("end"); break; case 72: @@ -78,10 +77,12 @@ public: }); GameObject square = mgr.new_object("square"); - Texture texture{"asset/texture/square.png"}; - square.add_component<Sprite>(texture, Sprite::Data{ - .size = { 0.5, 0.5 }, - }); + square.add_component<Sprite>( + Asset{"asset/texture/square.png"}, + Sprite::Data{ + .size = { 0.5, 0.5 }, + } + ); square.add_component<BehaviorScript>().set_script<AnimationScript>(); GameObject scapegoat = mgr.new_object(""); |