Skip to main content

coloX Developer Documentation Index

The complete coloX cartridge development documentation, grouped in learning order. Recommended path for beginners: Getting started → Platform specifications → Lua language → Graphics/input. Consult the remaining topics as needed.

Getting Started​

DocumentContents
getting_started.mdApplication development: .clx file structure (specification declaration, Lua scripts, resource data), development and debugging workflow, and your first application
platforms.mdPlatform specifications: resolution, color depth, sprite counts, and storage (correspondence with file header version numbers)
lua.mdLua language: differences between coloX's customized Lua 5.4 and standard Lua, and available standard libraries

Core API​

DocumentContents
graphics.mdGraphics: pixel operations, basic shapes, sprites, palettes, and image blocks
text.mdText: print/drawTxt output and font management, including Chinese text and custom TTF fonts
map.mdMaps: assembling sprite tiles into large areas and textured line effects
input.mdInput: buttons and touch
pad.mdGamepads: a gamepad/Bluetooth gamepad input channel independent of btn()
audio.mdAudio: sound effect synthesis, music playback, PCM waveform playback, and microphone recording
math.mdMath, bitwise operations, and random numbers (trigonometric functions use screen coordinates)
tables.mdTable utility functions
memory.mdMemory: byte, word, and double-word access to virtual machine memory
system.mdSystem: status queries, time and date, application management, data storage, service communication, and utilities

Modules​

Built-in modules (no usemod required; some capabilities depend on the firmware build):

DocumentContents
img.mdImages: PNG/JPG/GIF/WebP loading and drawing, animation playback, and incoming image streams
airimg.mdAirimg host streaming guide (companion to img): USB device identification, the CXUS streaming protocol, a Python example, and automatic display on the animated home screen
anim.mdEasing functions: numerical interpolation using easing curves
cjson.mdJSON encoding and decoding (require("cjson"))

Optional modules (enabled with usemod('name') in a cartridge; the corresponding feature must be compiled into the firmware):

DocumentContents
vg.mdVector graphics (ThorVG): shapes, gradients, text, pictures, and Lottie
rlottie.mdLottie vector animation (compatible APIs provided by ThorVG in version≥13)
b2d.md2D physics engine (Box2D)
net.mdNetworking: TCP/UDP/Multicast sockets, Copas asynchronous scheduling, HTTP client, WebSocket, URL parsing, and LTN12 streams

Platform Services​

DocumentContents
coloplay_ext.mdColoPLAY platform system services (svcget/svcset/svcreq)
naturemini_ext.mdNatureMiniPro device control and page display extensions

Debugging and Tips​

DocumentContents
debug.mdDebugger: host-side Lua debugging and test automation channel (not a cartridge API)
tips.mdDevelopment tips and optimization: memory savings, frame rate optimization, and audio/image/network usage

Documentation and Resources​

Documentation and resources provides complete bilingual documentation, development tools, and runnable example cartridges.