Skip to main content
Draw calls only work from a paint callback. Calling one anywhere else errors.

Draw

Bracketed trailing arguments are optional. Colors are Color objects. Most segments arguments default to 0 (automatic); ShadowCircle defaults to 12. points is a flat array, at least two points:

Clipping

intersect is optional. Pass true to clip against the current rect instead of replacing it. Every PushClip needs a matching PopClip.

MeasureText

Returns two numbers. Callable from paint or at load time, nowhere else.

WorldToScreen

Returns two numbers, or nil when the position is behind the camera. Always check the first return before using it.

Fonts

A bare filename resolves against Documents\Starline\scripts, so you can ship a .ttf with your script. A path containing : is used as-is. Flags is optional and defaults to antialiased. Bits: renderer.default_font is the menu font, always available. Font and texture handles are opaque values, not numbers, and are not interchangeable. Passing a font where a texture is expected errors instead of drawing the wrong thing. Load-time only. Fonts are cached by path, size and flags, so reloading your script reuses them.

Textures

Two forms. Pass a path on its own to load an image file, or pass raw pixels with a size.

From a file

Decodes PNG, JPG, BMP, TGA, GIF and PSD. The path works like CreateFont: a bare filename resolves against Documents\Starline\scripts, and a path containing : is used as-is.

From raw pixels

Data must contain at least Width * Height * 4 raw RGBA8 bytes. Extra bytes are ignored. Width and height must be from 1 to 4096. Load-time only. Textures are freed when your script reloads or unloads.