From d8e6773be7206994716c29e1ee8195b10f094bdf Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Wed, 18 Dec 2024 13:38:54 +0100 Subject: added transform scale and rotation in the drawing text component --- src/crepe/facade/SDLContext.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/crepe/facade/SDLContext.cpp') diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index 9a122f5..f350250 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -221,7 +220,7 @@ void SDLContext::draw_text(const RenderText & data) { font_texture = {tmp_font_texture, [](SDL_Texture * texture) { SDL_DestroyTexture(texture); }}; - vec2 size = text.dimensions * cam_aux_data.render_scale; + vec2 size = text.dimensions * cam_aux_data.render_scale * transform.scale; vec2 screen_pos = (transform.position + text.offset - cam_aux_data.cam_pos + (cam_aux_data.zoomed_viewport) / 2) * cam_aux_data.render_scale @@ -234,7 +233,7 @@ void SDLContext::draw_text(const RenderText & data) { .h = size.y, }; - SDL_RenderCopyExF(this->game_renderer.get(), font_texture.get(), NULL, &dstrect, 0, NULL, + SDL_RenderCopyExF(this->game_renderer.get(), font_texture.get(), NULL, &dstrect, transform.rotation, NULL, SDL_FLIP_NONE); } -- cgit v1.2.3