Layer class represents a layer in the runtime.
- Return the Layout the layer belongs to.
- Return the Runtime for this layer.
- Return a string of the name of the layer.
- Return the zero-based index of this layer on its layout.
- Set or get a boolean determining whether the layer is visible.
- Return a C3.Rect representing the axis-aligned bounding box of the visible area of the layer in layout co-ordinates.
- Set and get the opacity of the layer in the [0,1] range. 0 is fully transparent and 1 is opaque. This changes the alpha component of the layer color.
- Set and get the layer's scale as a factor.
- Get the scale the layer is rendered at. This is the scale relevant to draw calls.
- Get the scale the layer is rendered at. This is the scale relevant for translating co-ordinates from the canvas/window to the layer.
- Get the scale of the layer only using its own scale, the layout scale, and the scale rate.
- Set and get the scale rate of the layer as a multiplier.
- SetParallax(px, py)
- Set and get the X and Y parallax ratios for the layer, as multipliers.
- Set and get the layer's angle in radians. Use
C3.toRadians() to convert from degrees to radians.
- Get the layer's display angle in radians. This is also affected by the layout angle.
- Return a C3.Color representing the layer background color. Only the RGB components are used.
- Set and get a boolean indicating if the layer background is transparent.
- Set and get the layer blend mode, as an index in to the dropdown list used in Construct's Blend mode property. E.g. 0 is "normal", 1 is "additive", etc.
- MoveInstanceAdjacent(inst, otherInst, isAfter)
- Move the Instance
inst adjacent to
otherInst in the Z order. If
isAfter is true it moves
inst just after (above)
otherInst in the Z order; otherwise it moves
inst just before (below).
- CanvasCssToLayer(x, y)
- LayerToCanvasCss(x, y)
- Translate CSS pixel co-ordinates on the canvas to layout co-ordinates on the layer, and vice versa. Returns
- DrawSurfaceToLayer(x, y)
- LayerToDrawSurface(x, y)
- Translate device pixels on the rendered surface to layout co-ordinates on the layer, and vice versa. Returns
Addon SDK Manual
You are here:
Search this manual:
This manual entry was last updated on 16 May, 2018 at 19:25