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;contentRect?
optional contentRect?: object;Defined in: src/display/SliceLayer.ts:212
The part of image-content space the view is fitted to, when the host has set a fit region (see SliceView.setFitRegion). Layers that clip or anchor to "the image" should use this rectangle when present.
x0
x0: number;y0
y0: number;x1
x1: number;y1
y1: 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;