24class UISystem :
public System {
27 ~UISystem()
override =
default;
29 UISystem(
const UISystem& other) =
delete;
30 UISystem& operator=(
const UISystem& other) =
delete;
32 UISystem(UISystem && other) =
delete;
33 UISystem& operator=(UISystem && other) =
delete;
61 size_t blockersBefore;
66 void layOutCanvases(FrameContext& ctx,
const UIRect& viewport);
83 glm::vec2 resolveElement(
86 const UIRect& parentRect,
125 const UIElement& element,
143 const UIElement& element,
162 const UIElement& element,
179 void breakLines(std::string_view text,
const FontAsset& font,
float scale,
float maxWidth,
bool wrap);
192 bool resolveInteraction(FrameContext& ctx);
211 const glm::vec2& uv0,
212 const glm::vec2& uv1,
213 const glm::vec4& color,
214 const glm::vec4& bottom,
215 const glm::vec2& shape,
216 const glm::vec4& border,
229 void recolourQuad(uint32_t first,
const glm::vec4& top,
const glm::vec4& bottom);
242 const glm::vec4& color,
243 const UIShape& shape,
249 UIDrawData m_drawData;
251 std::vector<CanvasRef> m_canvases;
253 std::vector<ButtonHit> m_buttonHits;
260 std::vector<ScrollTarget> m_scrollTargets;
263 std::vector<std::string_view> m_lines;
266 std::vector<EntityId> m_pointerBlockers;
267 float m_opacity = 1.0f;
269 EntityId m_pressedButton{};
270 glm::vec2 m_pointer{0.0f};
271 float m_wheel = 0.0f;
272 bool m_mouseDown =
false;
273 bool m_mouseDownEdge =
false;
274 bool m_mouseUpEdge =
false;
275 bool m_cursorFree =
false;
276 bool m_pointerIsOurs =
false;
Per-frame state bundle passed to every system.
Definition system.h:57