76 const GuiRect box = { 0.0f, 0.0f, w, h };
77 const float cx = w * 0.5f, cy = h * 0.5f, u = std::min(w, h) / 22.0f;
82 mesh.addRoundRect(box,
GuiCorners(6.0f * u), light);
85 mesh.addRoundRect(box,
GuiCorners(5.0f * u), light);
86 mesh.strokeEllipse(
GuiRect{ cx - 6.0f * u, cy - 6.0f * u, 12.0f * u, 12.0f * u }, 1.6f * u,
STROKE::INSIDE, dark);
92 mesh.addEllipse(box, light);
101 const float a = kind ==
GLYPH::UP ? 0.0f : kind == GLYPH::RIGHT ? 90.0f : kind == GLYPH::DOWN ? 180.0f : 270.0f;
102 const float rad = a * 3.14159265f / 180.0f, c = cosf(rad), s = sinf(rad);
103 const float pts[3][2] = { { 0.0f, -5.5f * u }, { -5.0f * u, 4.0f * u }, { 5.0f * u, 4.0f * u } };
104 std::vector<GuiPoint> tri;
105 for(
int i = 0; i < 3; i++)
106 tri.push_back(
GuiPoint{ cx + pts[i][0] * c - pts[i][1] * s, cy + pts[i][0] * s + pts[i][1] * c });
107 mesh.addPolygon(tri, dark);
111 mesh.addRect(
GuiRect{ cx - 5.5f * u, cy - 1.3f * u, 11.0f * u, 2.6f * u }, dark);
112 mesh.addRect(
GuiRect{ cx - 1.3f * u, cy - 5.5f * u, 2.6f * u, 11.0f * u }, dark);
115 mesh.addRect(
GuiRect{ cx - 5.5f * u, cy - 1.3f * u, 11.0f * u, 2.6f * u }, dark);
119 std::vector<GuiPoint> house = { { cx, cy - 6.0f * u }, { cx + 6.5f * u, cy - 0.5f * u }, { cx + 4.8f * u, cy + 5.5f * u },
120 { cx - 4.8f * u, cy + 5.5f * u }, { cx - 6.5f * u, cy - 0.5f * u } };
121 mesh.addPolygon(house, dark);
125 mesh.strokeEllipse(
GuiRect{ 2.5f * u, 2.5f * u, w - 5.0f * u, h - 5.0f * u }, 1.2f * u,
STROKE::INSIDE, dark);
Display, manage, and manipulate text in the GUI.
static void build(GuiMesh &mesh, GLYPH kind, float w, float h)
Builds a glyph filling a w x h box at the origin, in the theme's light-on-dark colors.