Capture Card — Modding API
Lua reference for addon authors. Each part of the API is its own page, so a lookup fetches the page it is on and nothing else. Search covers every page - press /.
Getting started
An addon is a folder of Lua that lives under addons/. Every .lua file inside addons/<name>/lua/autorun/ is run onc…
1 entry
Globals
Functions and values available directly in every addon.
17 entries
hook
GMod-style event system. Register named callbacks for engine events; the name lets you replace or remove your own hook l…
4 entries
Engine events
Events the engine fires into hook. Subscribe with hook.Add.
4 entries
Frame
A read/write view of a raw captured frame, passed to OnFrameReceived. Byte access is 0-based into the pixel buffer, whos…
9 entries
buffer
A block of mutable bytes. Lua strings are immutable, so anything that holds a lot of data and changes it has to allocate…
5 entries
game
Attach a mod to one or more games. Every registered game becomes a cartridge in the row along the bottom of the overlay;…
17 entries
camera
Read-only. Everything the capture card reports about itself — its name, the live frame format, and every format it adver…
11 entries
overlay
The native Steam-style overlay (toggled with Shift+Tab) and its element registry. Everything shown on the overlay — butt…
16 entries
Element
The table you pass to overlay.add. Every element has an id, a visibility mode, and exactly one visual form: a button, a …
18 entries
Widgets
Native, styleable controls placed inside a panel element's children. Colors are Lua arrays {r, g, b} or {r, g, b, a} (0–…
8 entries
DrawContext
The drawing surface d passed to an element's paint callback. Pixel coordinates; colors are separate r, g, b arguments (0…
7 entries
data
Per-mod file storage. Every call is sandboxed to data/<MOD_NAME>/ — a mod can only read and write inside its own f…
8 entries
Threading
The main thread renders. Anything you do in OnFrameReceived or OnFrame is paid for out of the frame budget — about 16&nb…
9 entries
account
Read-only. Who is signed in to their dasmaffin.com account, if anyone. Signing in is the engine's job — there is a Sign …
3 entries
browser
Show a web page to the user. This is deliberately a command, not a mechanism: your mod says "show this", and the engine …
1 entry
Sandbox
Mods run deny-by-default. Only the standard Lua listed below is available, plus the engine APIs on this page. There is n…
6 entries
One page of the MCCP modding reference. Every
section is its own document; search covers all of them.