IWorldInstance interface

Ashley's avatar
Medal
Construct Team Founder
Published 14 Nov, 2017
211 words
<1 min

The IWorldInstance interface represents an instance of a "world" type plugin in Construct. It derives from IObjectInstance.

Methods

GetBoundingBox()

Returns an SDK.Rect representing the bounding box of the instance in the layout.

GetQuad()

Returns an SDK.Quad representing the bounding quad of the instance in the layout.

GetColor()

Returns an SDK.Color representing the premultiplied color of the instance. Currently only the alpha component is currently used as the opacity.

SetOpacity(o)

GetOpacity()

Set or get the alpha component of the instance's color, representing its opacity, in the 0-1 range.

SetX(x)

SetY(y)

SetXY(x, y)

GetX()

GetY()

Set and get the position of this instance in layout co-ordinates.

SetAngle(a)

GetAngle()

Set and get the angle of the instance, in radians.

SetWidth(w)

SetHeight(h)

SetSize(w, h)

GetWidth()

GetHeight()

Set and get the size of the instance, in pixels.

SetOriginX(x)

SetOriginY(y)

SetOrigin(x, y)

GetOriginX()

GetOriginY()

Set and get the current origin of the instance in the layout. Note this is normalized to a [0, 1] range, e.g. 0.5 is the middle.

ApplyBlendMode(iRenderer)

Sets the current blend mode of the given IWebGLRenderer according to the Blend mode property of the instance in Construct. This is only relevant if the plugin specifies that it supports effects. Use this in the Draw() method to set the correct blend mode.