Skip to content

Frame

A frame: a region of a surface, in its pixels. scale: source pixels per stage unit (baked at the backing resolution).

x: number

Left, pixels.

Region.x


y: number

Top, pixels.

Region.y


w: number

Width, pixels.

Region.w


h: number

Height, pixels.

Region.h


surface: Surface

The surface (atlas page or image) it is a region of.


scale: number

Pixels per stage unit it was baked at: the frame is drawn w / scale × h / scale stage units by default.


gen: number

The atlas generation it belongs to: frames of an older one were wiped. 0: not in the atlas (an image).


ox: number

Where the frame’s origin sits inside it, in stage units (the centre of a shape, the baseline of a text).


oy: number

Vertical position of the origin inside the frame, stage units.


margin: number

Paint around the content (outline, glow), stage units: the content box is the frame minus this on every side.


optional sw?: number

A trimmed frame of a loaded atlas: the untrimmed width, pixels (the region sits at tx, ty inside it).


optional sh?: number

The untrimmed height, pixels.


optional tx?: number

Where the trimmed region starts inside the untrimmed frame, pixels.


optional ty?: number

Where the trimmed region starts inside the untrimmed frame, pixels (down).


optional slice?: Insets

Nine-slice insets, pixels, [top, right, bottom, left] (CSS order): a loaded atlas’s scale9Borders. Sprites of the frame are nine-sliced by default.