You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Parses the characters (by identified the texture atlas info per character, that is where in the texture is this character exactly, how big is it, and how much to advance the cursor after)
39
+
// Parses the characters (by identified the texture atlas info per character, that is where in the texture is
40
+
// this character exactly, how big is it, and how much to advance the cursor after)
39
41
if (data.contains("chars")) {
40
42
for (constauto& charData : data["chars"]) {
41
43
int id = charData["id"];
@@ -46,7 +48,7 @@ namespace our {
46
48
info.height = charData["height"];
47
49
info.xoffset = charData.value("xoffset", 0.0f);
48
50
info.yoffset = charData.value("yoffset", 0.0f);
49
-
info.xadvance = charData.value("xadvance", (float)info.width); // defaults to letter width
51
+
info.xadvance = charData.value("xadvance", (float)info.width); // defaults to letter width
glm::vec2 anchor = {0.0f, 0.0f}; // Normalized screen attachment point (0 to 1)
11
-
// pivot should always be EQUAL to anchor for static elements, for dynamic elements like if we need some 'achievement/powerup' text to slide in from the top center for example, we set anchor to (0.5, 0), top center of the screen, and pivot to (0.5, 1), bottom center of the rectangle, so the rectangle is completely hidden above the screen, we then change offset gradually to bring it into view
12
-
glm::vec2 pivot = {0.0f, 0.0f}; // Normalized element origin (0 to 1).
0 commit comments