Skip to content

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 GLuaLux
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

AreaPageMain APIs
Frame scope and diagnosticsFrame and DebugStartPanel, EndPanel, StartScreen, EndScreen, PushClip, PopClip, ShaderStatus
Reusable antialiased clippingCoverage Masks, Clip, and Self-ClippingMask, Clip, Masks, Invalidate, shape children callbacks
Shapes and linesShapes and LinesRoundedBoxEx, ChamferBoxEx, PolyEx, LineEx, CircleEx, CapsuleEx
ImagesImages and Per-Image MasksImageEx, IconEx, image style.mask, MaterialSource, TextureSource
HUD meters and sectorsHUD Meters and SectorsProgressBarEx, SegmentBarEx, RingEx, ArcEx, SectorEx
TextText APIText, TextEx, TextBoxEx, MeasureText, PrewarmText
Paint records and transformsPaint, Patterns, TransformsLinearGradient, SmokePattern, WornPattern, Transform, PointerTilt, GetCapabilities

Reading Order

  1. Plain GLua Quick Start or Lux Quick Start
  2. Core Concepts
  3. The task page for the API you are calling
  4. Performance Model when changing hot paths
  5. 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.