Added being able to set position via JSON. Text now always wraps on newlines.

This commit is contained in:
2025-12-04 17:44:24 +02:00
parent 56e07e1080
commit 69a50b0584
4 changed files with 21 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
#include "Widget.h"
Widget::Widget(int width, int height)
: m_surface(nullptr), m_rect{.x = 0, .y = 0, .w = width, .h = height}
Widget::Widget(int x, int y, int width, int height)
: m_surface(nullptr), m_rect{.x = x, .y = y, .w = width, .h = height}
{
m_surface = SDL_CreateRGBSurfaceWithFormat(0, width, height, 32, SDL_PIXELFORMAT_RGBA8888);
}