API Reference
This section is the task-oriented reference for public MGFX functions. It is intentionally about signatures, fields, return values, and caveats. Start with Core Concepts if you want the mental model first.
These pages are documentation groups only. Plain GLua code calls the PascalCase methods on the table returned by include("mgfx/init.lua"); Lux code calls mgfx.api.* from @lux/mgfx. Do not choose imports based on page names.
Function blocks on detailed pages use MGFX as a conventional local owner name:
lua
local MGFX = include("mgfx/init.lua")That notation does not require or install _G.MGFX.
Runtime Names
| Plain GLua | Lux |
|---|---|
mgfx.StartPanel(...) | mgfx.api.startPanel(...) |
mgfx.RoundedBoxEx(...) | mgfx.api.roundedBoxEx(...) |
mgfx.ImageEx(...) | mgfx.api.imageEx(...) |
mgfx.Mask(...) | mgfx.api.mask(...) |
mgfx.Clip(...) | mgfx.api.clip(...) |
mgfx.ProgressBarEx(...) | mgfx.api.progressBarEx(...) |
mgfx.LinearGradient(...) | mgfx.api.linearGradient(...) |
mgfx.TextEx(...) | mgfx.api.textEx(...) |
API names, Lua parameter names, and shader terms are kept in English.
Task Pages
| Area | Page | Main APIs |
|---|---|---|
| Frame scope and diagnostics | Frame and Debug | StartPanel, EndPanel, StartScreen, EndScreen, PushClip, PopClip, ShaderStatus |
| Reusable antialiased clipping | Coverage Masks, Clip, and Self-Clipping | Mask, Clip, Masks, Invalidate, shape children callbacks |
| Shapes and lines | Shapes and Lines | RoundedBoxEx, ChamferBoxEx, PolyEx, LineEx, CircleEx, CapsuleEx |
| Images | Images and Per-Image Masks | ImageEx, IconEx, image style.mask, MaterialSource, TextureSource |
| HUD meters and sectors | HUD Meters and Sectors | ProgressBarEx, SegmentBarEx, RingEx, ArcEx, SectorEx |
| Text | Text API | Text, TextEx, TextBoxEx, MeasureText, PrewarmText |
| Paint records and transforms | Paint, Patterns, Transforms | LinearGradient, SmokePattern, WornPattern, Transform, PointerTilt, GetCapabilities |
Reading Order
- Plain GLua Quick Start or Lux Quick Start
- Core Concepts
- The task page for the API you are calling
- Performance Model when changing hot paths
- Shaders and Packaging when changing shader parameters or shaderpack contents
Notes
- Subpackages are public enough for maintainers and narrow tooling, but the facade is the normal user-facing API.
- Capabilities describe implemented render slots, not future plans.