aboutsummaryrefslogtreecommitdiff
path: root/src/example
diff options
context:
space:
mode:
authorheavydemon21 <48092678+heavydemon21@users.noreply.github.com>2025-01-03 19:41:41 +0100
committerGitHub <noreply@github.com>2025-01-03 19:41:41 +0100
commitcf6ca6be5a9deac4de921f50d0aedf6a6156e0f4 (patch)
treee7b18df0361af1b081168569568d408cfd4b6538 /src/example
parent61148c757a1f742ff09e40e5347e74e638c7371c (diff)
parent4526efe1b6dd63aaa177f8f35194989d3910d571 (diff)
Merge pull request #96 from lonkaars/niels/UI
rendering text world space fix
Diffstat (limited to 'src/example')
-rw-r--r--src/example/rendering_particle.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/example/rendering_particle.cpp b/src/example/rendering_particle.cpp
index 7942fce..8be781a 100644
--- a/src/example/rendering_particle.cpp
+++ b/src/example/rendering_particle.cpp
@@ -7,8 +7,8 @@
#include <crepe/api/Button.h>
#include <crepe/api/Camera.h>
#include <crepe/api/Color.h>
+#include <crepe/api/Engine.h>
#include <crepe/api/GameObject.h>
-#include <crepe/api/LoopManager.hpp>
#include <crepe/api/ParticleEmitter.h>
#include <crepe/api/Rigidbody.h>
#include <crepe/api/Sprite.h>
@@ -62,21 +62,32 @@ public:
}
);
- /*
- game_object.add_component<Text>(vec2{1, 1}, vec2{0, -0.5}, "ComicSansMS",
- Text::Data{.text_color = Color::RED}, "test TEST");
+ game_object.add_component<Text>(
+ vec2 {1, 1}, vec2 {0, -1}, "ComicSansMS",
+ Text::Data {
+ .text_color = Color::RED,
+ },
+ "test TEST"
+ );
- game_object.add_component<Text>(vec2{1, 1}, vec2{0, 0.5}, "ComicSansMS",
- Text::Data{.text_color = Color::BLACK}, "TEST test");
- */
+ game_object
+ .add_component<Text>(
+ vec2 {1, 1}, vec2 {0, 1}, "Ariel",
+ Text::Data {
+ .text_color = Color::BLACK,
+ },
+ "TEST test"
+ )
+ .world_space
+ = true;
}
string get_name() const { return "TestScene"; };
};
int main(int argc, char * argv[]) {
- LoopManager engine;
+ Engine engine;
engine.add_scene<TestScene>();
- engine.start();
+ engine.main();
return 0;
}