TargetConstraint

CanvasFitConstraint

This constraint fits camera-parented UI elements such as buttons, panels, or texts, regardless of the screen resolution or a device.

To influence some object, push a CanvasFitConstraint instance into the Object3D.constraints array.

Constructor

CanvasFitConstraint(target : Object3D)

target — constraint's target object.

Properties

See the base TargetConstraint class for common properties.

.edgeH : String

The horizontal canvas edge to fit to. Default is 'NONE'.

.edgeV : String

The vertical canvas edge to fit to. Default is 'NONE'.

.offset : Float

Additional fit offset (can be negative). Default is 0.0.

.isCanvasFitConstraint : Boolean

Read-only flag to check if a given object is of type CanvasFitConstraint.

.type : String

The constraint's type. Equals to "CanvasFitConstraint".

.fitShape : String

Bounding shape for canvas fit. Default is 'BOX'.

Methods

See the base TargetConstraint class for common methods.

Source

For more info on how to obtain the source code of this module see this page.