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.
target — constraint's target object.
See the base TargetConstraint class for common properties.
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.
The vertical canvas edge to fit to. Default is 'NONE'.
'TOP' — top edge.'BOTTOM' — bottom edge.'STRETCH' — stretch from top to bottom.'NONE' — no vertical fit.
Additional fit offset (can be negative). Default is 0.0.
Read-only flag to check if a given object is of type CanvasFitConstraint.
The constraint's type. Equals to "CanvasFitConstraint".
Bounding shape for canvas fit. Default is 'BOX'.
'SPHERE' — bounding sphere.'BOX' — bounding box.'POINT' — zero-sized fit shape (point).See the base TargetConstraint class for common methods.
For more info on how to obtain the source code of this module see this page.