Exit Full View

Fizzy / docs / ref / WithinControlPoint.md

WithinControlPoint

A ControlPoint, which is free to be positioned anywhere.

The control point defined by two opposite corners of a rectangle (named A and B), and a Vector2 (named Position) defining how close the control point is to A or B.

A Position of (0,0) means at A, and (1,1) means at B.

Position can have -ve values, and values over 1, if the point is outside of the rectangle defined by Aand B. But is ConstrainX / ConstrainY are set to true, then the values are forced within the range 0..1.

Consider StandardControlPoint as an alternative, which is simpler, but cannot adjust itself when the shape is scaled.

Fields

NameTypeComments
PointDimension2A + (B - A) * Position
ADimension2
BDimension2
PositionVector2Changed when the control handle is dragged. Values in the range 0..1 if ConstrainX and ConstrainY are true.
MinVector2The minimum value for Position. Often MIN_VECTOR2 or (0,0)
MaxVector2The maximum value for Position. Often MAX_VECTOR2 or (1,1)