Interface: ScreenLayoutContext
Defined in: src/display/SliceLayer.ts:189
Geometry passed to a SliceLayer.layoutScreen implementation.
Properties
width
width: number;Defined in: src/display/SliceLayer.ts:191
Viewport width in screen pixels.
height
height: number;Defined in: src/display/SliceLayer.ts:193
Viewport height in screen pixels.
insets
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
top: number;right
right: number;bottom
bottom: number;left
left: number;Methods
project()
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
x: number;y
y: number;