Implement Json loading for screens and fix a bug in widget-creation

This commit is contained in:
2021-01-16 16:49:26 +01:00
parent 2c183dc099
commit 938450ce75
13 changed files with 118 additions and 50 deletions

View File

@@ -9,10 +9,10 @@ Widget::Widget(Texture *texture, float p_x, float p_y, float p_w, float p_h) :
const double ofst = 0.005;
double widgetVerticesData[12] = {
x + w + ofst, -1.0f + 2*y - ofst, 0.0f, // Bottom right
-1.0f + 2*x - ofst, y + h + ofst, 0.0f, // Top left
-1.0f + 2*x-ofst, -1.0f + 2*y - ofst, 0.0f, // Bottom left
x + w + ofst, y + h + ofst, 0.0f // Top right
2 * (x + w) - 1.0f + ofst, 2 * (y) - 1.0f - ofst, 0.0f, // Bottom right
2 * (x) - 1.0f - ofst, 2 * (y + h) - 1.0f + ofst, 0.0f, // Top left
2 * (x) - 1.0f - ofst, 2 * (y) - 1.0f - ofst, 0.0f, // Bottom left
2 * (x + w) - 1.0f + ofst, 2 * (y + h) - 1.0f + ofst, 0.0f // Top right
};
unsigned int widgetIndicesData[6] = {