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)

Properties

See the base TargetConstraint class for common properties.

.edgeH : Number

The horizontal canvas edge to fit to. Default is 0.
-1 — left edge.
1 — right edge.
0 — none egde.

.edgeV : Number

The horizontal canvas edge to fit to. Default is 0.
-1 — bottom edge.
1 — top edge.
0 — none egde.

.offset : Float

Canvas fir 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".

.useBoundingBox : Boolean

Canvas fit shape. Default is true.
false — sphere.
true — box.

Methods

See the base TargetConstraint class for common methods.