Once elements are created they can be repositioned, resized, hidden, and destroyed at any time. In scroll mode, the anchor system lets you pin elements to the visible viewport so they remain stationary as the user scrolls. The rendering order control determines whether theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/DRESSedAlarm184/LWXGL/llms.txt
Use this file to discover all available pages before exploring further.
on_every frame callback fires before or after elements are drawn — giving you full flexibility over compositing.
ElemModifyBounds
ID of the element to modify.
New X coordinate of the element’s top-left corner in pixels.
New Y coordinate of the element’s top-left corner in pixels.
New width in pixels. Pass
-1 to leave the current width unchanged.New height in pixels. Pass
-1 to leave the current height unchanged.ElemSetVisible
ID of the element.
Pass
1 to make the element visible and interactive. Pass 0 to hide it — hidden elements are neither rendered nor considered for mouse hit-testing.ElemInside
ID of the element to test.
1 if the cursor is inside the bounding box, 0 otherwise.
ElemAnchor
Pass a non-zero value to enable anchoring: each element’s current
y position is saved as its anchor offset relative to the scroll origin. Pass 0 to release anchoring: each element’s y is restored to its saved anchor value and the anchor is cleared.Array of element IDs to anchor or release.
Number of entries in the
ids array.Anchoring only takes effect visually when
ResolveAnchors is called each frame. Call ElemAnchor once to register the anchored set, then call ResolveAnchors inside your on_every callback every frame.ResolveAnchors
y coordinate of every anchored element to scroll_offset + anchor_offset, keeping each element visually pinned to the same position in the viewport regardless of the current scroll position. Call this once per frame, typically at the start of the on_every callback.
Elements without an active anchor (anchor value equals
INT_MIN internally) are skipped silently, so it is safe to call ResolveAnchors even when no elements are anchored.DeleteElement
index and sets the slot to NULL. For image elements this includes destroying the XImage, XPixmap, and both pixel buffers. For text elements created with CreateCopiedText, the duplicated string is freed. The ID can be reused for a new element after deletion.
ID of the element to delete. If
index is out of range or the slot is already NULL, the function returns immediately without error.SetRenderingOrder
on_every callback in MainWindowLoop fires before or after the element rendering pass.
ORDER_ELEM_FIRST(1) — elements are rendered to the back-buffer beforeon_everyis called. Use this when the callback usesImmediateRect,ImmediateText, or other immediate-mode drawing functions that should appear on top of retained elements.ORDER_ELEM_SECOND(0, default) —on_everyis called before elements are rendered. Use this when you want to update element positions or data based on the new frame’s logic before they appear on screen.