From 58c57578cae755422c35acfbbdf9ad399b4fd826 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Mon, 16 Dec 2024 21:49:15 +0100 Subject: very illegal commit do not push --- src/example/FontExample.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/example/FontExample.cpp (limited to 'src/example/FontExample.cpp') diff --git a/src/example/FontExample.cpp b/src/example/FontExample.cpp new file mode 100644 index 0000000..620cf8e --- /dev/null +++ b/src/example/FontExample.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace crepe; +using namespace std; +using namespace std::chrono; +class TestScript : public Script{ + public: + steady_clock::time_point start_time; + virtual void init() override{ + start_time = steady_clock::now(); + } + virtual void update() override{ + auto now = steady_clock::now(); + auto elapsed = duration_cast(now - start_time).count(); + + if (elapsed >= 1) { + Mediator& med = mediator; + EventManager& event_mgr = med.event_manager; + event_mgr.trigger_event(); + } + } +}; +class TestScene : public Scene{ + public: + void load_scene() override{ + GameObject text_object = this->new_object("test","test",vec2{0,0},0,1); + text_object.add_component(vec2(100, 100), vec2(0, 0), "test test", + "OpenSymbol", Text::Data{}); + text_object.add_component(); + + } + std::string get_name(){ return "hey";} +}; +int main() { + + + + return 0; +} -- cgit v1.2.3