sprites/{id}.obj.json — file map
Reusable object definitions. One file per id under sprites/. Instances use the obj command. See Objects.
The whole file
Keys with { … } open below. Linked names jump to that section. Grey notes say what each key does. Under each section, Keys lists type, If omitted, allowed values, and a short note.
{
"id": "lamp_widget", // definition id
"layer": "overlay", // default draw plane
"transition_in": "fade", // default show
"transition_out": "fade", // default hide
"transition_duration": 0.3, // default fade length
"modulate": "#ffffff", // root tint
"scale": 1.0, // root scale
"rotation_degrees": 0, // root rotation
"parts": [ { … } ] // pieces of the object (required)
}
Root keys
Top-level keys that are not objects.
layer enumIf omitted overlay
Values
bg_front · fg · overlayWhere instances draw unless the command overrides.
transition_in enumIf omitted instant
Values
instant · fade · slide_up · slide_down · slide_left · slide_rightDefault enter transition for instances.
transition_out enumIf omitted instant
Values
instant · fade · slide_up · slide_down · slide_left · slide_rightDefault leave transition.
transition_duration numberIf omitted 0
Values seconds
Seconds for default transitions.
modulate colorIf omitted no tint
Colour multiply for the whole object.
scale numberIf omitted 1
Number or
[sx, sy].rotation_degrees numberIf omitted 0
Degrees.
Learn more: id
parts
Pieces of the object (required).
{
"parts": [ { // pieces of the object (required)
"id": "ptr", // part id
"kind": "polygon", // shape
"x": 0, // local x
"y": 0, // local y
"width": 40, // width
"height": 20, // height
"order": 0, // draw order
"points": [[0, 0], [10, 0], [5, 8]], // polygon points
"color": "#343a52e0", // fill colour
"opacity": 1.0, // alpha
"visible": true, // shown
"path": "sprites/face.png", // image path
"text": "OK", // caption
"bind": {"y": {"flag": "score", "map": {"5": 23}}}, // live flag links
"bbcode_enabled": false, // rich text
"font_size": 16, // text size
"align_h": "left", // text align
"autowrap": false // wrap text
} ]
}
Keys
id stringIf omitted required
Used by
obj update patches.kind enumIf omitted required
Values
image · rect · polygon · textWhat this part draws.
x numberIf omitted 0
Offset inside the object.
y numberIf omitted 0
Offset inside the object.
width numberIf omitted from art
For rect / text / sized images.
height numberIf omitted from art
For rect / text / sized images.
order numberIf omitted 0
Higher draws above.
points arrayIf omitted polygon only
[[x,y], …] for kind: polygon.color colorIf omitted white / theme
Rect / polygon / text colour.
opacity numberIf omitted 1
0–1.
visible boolIf omitted
trueHide a part without removing it.
path pathIf omitted image kinds
For
kind: image.text stringIf omitted text kind
For
kind: text.bind objectIf omitted none
Flag → property — [Live flags](../../directing/live-flags.md).
bbcode_enabled boolIf omitted
falseFor
kind: text.font_size numberIf omitted theme default
For
kind: text.align_h enumIf omitted left
Values
left · center · rightFor
kind: text.autowrap boolIf omitted
falseFor
kind: text.Learn more: parts