TargetConstraint

CanvasFitConstraint

A constraint allows to attach panels or texts where you want whem to be, regardless of screen resolution or device. Have to parent the object to the camera.

Constraints are used to set up various relations between objects by affecting their position, rotation and scale. Can be used with the Object3D.constraints property.

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'.
'LEFT' — left edge.
'RIGHT' — right edge.
'STRETCH' — stretch from left to right edge.
'NONE' — no horizontal fit.

.edgeV : String

The horizontal canvas edge to fit to. Default is 'NONE'.
'TOP' — top edge.
'BOTTOM' — bottom edge.
'STRETCH' — stretch from top to bottom.
'NONE' — no vertical fit.

.offset : Float

Additional fit offset, must be >= 0. Default is 0.0.

.isCanvasFitConstraint : Boolean

Used to check whether this or derived classes are canvas fit constraints. Default is true.

.type : String

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

.fitShape : String

Canvas fit shape. Default is 'BOX'.
'SPHERE' — bounding sphere.
'BOX' — bounding box.
'POINT' — zero-sized fit shape.

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.