Skip to content

Interface: ScreenLayoutContext

Defined in: src/display/SliceLayer.ts:189

Geometry passed to a SliceLayer.layoutScreen implementation.

Properties

width

ts
width: number;

Defined in: src/display/SliceLayer.ts:191

Viewport width in screen pixels.


height

ts
height: number;

Defined in: src/display/SliceLayer.ts:193

Viewport height in screen pixels.


insets

ts
insets: object;

Defined in: src/display/SliceLayer.ts:200

Pixels reserved on each edge by other UI (e.g. the slice slider along the bottom). Screen-space layers should keep their content inside the safe area [left, width - right] × [top, height - bottom] so it does not collide with those widgets. Always present; defaults to zero on every edge.

top

ts
top: number;
ts
right: number;

bottom

ts
bottom: number;

left

ts
left: number;

Methods

project()

ts
project(contentX, contentY): object;

Defined in: src/display/SliceLayer.ts:206

Projects a point from image-content space (the pre-scale coordinate space the slice sprite occupies: x along the i-axis, y along the j-axis) to screen pixels, accounting for the current scale, Y-flip, zoom, and pan.

Parameters

contentX

number

contentY

number

Returns

object

x
ts
x: number;
y
ts
y: number;

Released under the MIT License.