Added proper hit test with rotation and pivoting

This commit is contained in:
2026-05-20 20:56:25 +01:00
parent 75b1bc5dbd
commit 6ff16e3db4
7 changed files with 181 additions and 35 deletions
+4 -3
View File
@@ -320,11 +320,11 @@ public:
uint64_t create_text(uint64_t font_id, const char *text, uint32_t length, Color color);
Vec2<float> get_text_size(uint64_t text_id);
bool write(uint64_t text_id, Vec2<float> position, float z, float angle, Vec2<float> scale, float alpha);
bool write(uint64_t text_id, Vec2<float> position, float z, float angle, Vec2<float> pivot, Vec2<float> scale, float alpha);
bool draw(uint64_t image_id, Vec2<float> position, float z, float angle, Vec2<float> scale, float alpha);
bool draw(uint64_t image_id, Vec2<float> position, float z, float angle, Vec2<float> pivot, Vec2<float> scale, float alpha);
bool draw_rect(Rect rect, Color color, float z, float angle, Vec2<float> scale, float alpha);
bool draw_rect(Rect rect, Color color, float z, float angle, Vec2<float> pivot, Vec2<float> scale, float alpha);
void render(); // the rest of the calls only build the instruction list, this actually renders everything added to the screen (following z order)
@@ -366,6 +366,7 @@ private:
float z;
float angle;
Vec2<float> pivot;
Vec2<float> scale;
float alpha;