Author a frame skin
Bind a nine-slice PNG frame to a shared surface, by hand in TOML or through Studio's Artwork workspace.
A frame skin is an authored nine-slice PNG drawn over a surface's procedural face. Use one when your controls need painted hardware (corners, rivets, edges) that the material keys cannot draw.
The worked example
Put the frame image in your game's mounted content and bind it to the shared
surface that draws the control. A named picture in [images] alone does not
skin a button. For example, a 2× frame can preserve its 24-pixel corner detail
while drawing that border at 12 layout units:
[surfaces.Button]
fill = "#111a22"
image = "ui/art/button-frame.png"
sliceLeft = 24
sliceTop = 12
sliceRight = 24
sliceBottom = 12
imageBorderLeft = 12
imageBorderTop = 6
imageBorderRight = 12
imageBorderBottom = 6
[surfaces.ButtonHover]
base = "Button"
image = "ui/art/button-frame-hover.png"
How the skin draws
Omit a drawn border width to use its source slice value. The renderer draws the
procedural material first, then the image; transparent areas expose the face
underneath. Corners stay intact while edges and the centre stretch. Edge and
centre tiling are available through imageTileMode and tile dimensions. The PNG
importer does not author sprite-sheet animations. The main-menu page editor can
add separate decorative image, label and panel layers.
Use base to share the frame geometry across normal, hover, pressed and disabled
states, and author each image to keep its caption and state cues readable.
Set image = "" to clear an inherited skin, for example for an untextured
high-contrast variant. Use portable relative paths with forward slashes and no
... Keep opposing source slices smaller in total than the image dimension.
Padding tokens
The optional FormHeader surface skins shared form section headings.
FormHeaderSkinPadLeft, FormHeaderSkinPadRight and FormHeaderSkinPadVertical
keep titles inside that artwork. LobbyFramePadding, LobbyOuterFramePadding
and LobbyFooterPadding keep lobby content inside its frames. These are [sizes]
tokens; a skin's drawn border width does not reserve space for content.
Import and reuse artwork in Studio
Open Themes → Artwork, choose New style, and import a PNG. Drag the cyan left/right and gold top/bottom guides to keep all corner hardware outside the stretchable centre. The Inspector shows source-pixel distances from each edge. Drawn border size controls how thick those corners appear in the game; it does not add text padding. Check the Button, Wide button, Panel and Tall panel previews before saving.
Saved styles appear in Screens → Appearance for the selected control. Assign normal, hover, pressed, active and disabled button artwork separately. Keep labels, faction icons and actions as native controls; do not bake them into the PNG. Style edits, guide positions and control assignments remain editable and undoable.
The AEX Command lobby example contains imported frame and button-state PNGs, reusable styles and native lobby assignments. Copy it before editing. It inherits AEX Command's layout and live behavior, including its Start Game animation, rather than flattening the lobby.
The same operations are available through theme_artwork_import,
theme_artwork_save_style, theme_artwork_preview, theme_update_control and
theme_artwork_history. Use the returned surface name exactly, including its
StudioArt_ prefix. Source slices and drawn border sizes use the same values in
Studio and MCP. The importer currently edits PNG geometry; advanced inherited
material settings remain in the theme TOML.
What goes wrong
A skin whose path or slice values are not allowed (an absolute path, a backslash,
.., a negative slice) is skipped and the procedural face stays:
UiTheme: invalid surface image parameters for <surface>; keeping procedural surface
A missing or unreadable PNG, or slices that leave no centre, gives:
UiTheme: surface <surface> image <path> is missing, unreadable or has slices outside its bounds; keeping procedural surface