From a597b0059f30e9d56331c6ece34fdcabb4028616 Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Mon, 9 Dec 2024 20:15:41 +0100 Subject: making rendering fonts and UI --- src/example/rendering_particle.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/example/rendering_particle.cpp') diff --git a/src/example/rendering_particle.cpp b/src/example/rendering_particle.cpp index 29d475d..b57ba04 100644 --- a/src/example/rendering_particle.cpp +++ b/src/example/rendering_particle.cpp @@ -1,3 +1,4 @@ +#include "api/Button.h" #include #include #include @@ -12,6 +13,8 @@ #include #include #include +#include +#include using namespace crepe; using namespace std; @@ -57,7 +60,7 @@ public: .order_in_layer = 2, .size = {0, 100}, .angle_offset = 0, - .position_offset = {100, 0}, + .position_offset = {0, 0}, }); auto & anim = game_object.add_component(test_sprite, 4, 4, @@ -66,12 +69,23 @@ public: .looping = false, }); anim.set_anim(2); - anim.active = false; + anim.pause(); auto & cam = game_object.add_component(ivec2{1280, 720}, vec2{400, 400}, Camera::Data{ .bg_color = Color::WHITE, }); + + function on_click = [&](){ cout << "button clicked" << std::endl; }; + function on_enter = [&](){ cout << "enter" << std::endl; }; + function on_exit = [&](){ cout << "exit" << std::endl; }; + + auto & button = game_object.add_component