Detailed API Reference
This is the function-level reference for the MGFX public API. Start with Use MGFX if you are setting up a project, and read API Overview for the conceptual model.
MGFX has two public surfaces:
text
Lux mgfx.api.roundedBoxEx(...)
Plain GLua facade MGFX.RoundedBoxEx(...)The detailed pages are grouped by topic for reading, not by import path. Lux examples use mgfx.api.*; the installed facade uses the same operation names in PascalCase.
Choose by Task
| Need | Read first | Main entry points |
|---|---|---|
| Panels, buttons, badges, arrows, convex polygons | Primitives | roundedBoxEx, chamferBoxEx, regularPolyEx, diamondEx, caretEx, polyEx |
| Avatars, icons, cropping, rounded/chamfer/texture masks | Images and Masks | imageEx, iconEx, mask |
| Health bars, ammo pips, rings, gauges, wheel sectors | Widgets | progressBarEx, segmentBarEx, ringEx, arcEx, sectorEx |
| Plain labels, outlined text, glow titles, text boxes | Text API | text, textEx, textBoxEx, measureTextBox |
| Gradients, stops, patterns, draw transforms | Paint, Patterns, Transforms, and Capabilities | linearGradient, radialGradient, sectorAngularGradient, stripePattern, pointerTilt |
| VGUI Paint / HUDPaint lifecycle | Frame Scope and Debugging | startPanel, startScreen, pushClip, debugOverlay |
For ordinary controls, use the short signature or the matching Ex style table. Avoid adding a second helper layer unless it removes real project-level duplication.
Groups
FrameFrame Scope and DebuggingPanel/screen frames, rectangular clips, command flush, and debug overlay.ShapePrimitivesRounded boxes, chamfers, convex polygons, lines, circles, capsules, backdrop, and transforms.ImageImages and MasksImages, icons, fit/crop/UV, rounded masks, chamfer masks, circle masks, and texture masks.WidgetWidgetsProgress bars, segment bars, rings, arcs, and radial sectors.TextText APIFont aliases, text styles, measurement, prewarm, native text routing, and shader effects.PaintPaint, Patterns, Transforms, and CapabilitiesColors, gradients, patterns, 2.5D transforms, and target capability queries.
Reading Order
- New Lux code should import
@lux/mgfxand callmgfx.api.*. - Existing GLua code may call the installed
MGFX.*facade aftermgfx.installGlobal("MGFX"). - When changing public behavior, update the overview and the relevant detailed family page together.