Type Method

positionX:

Creates a constraint that restricts the x-coordinate of a node’s position.

Declaration

+ (instancetype)positionX:(SKRange *)range;

Parameters

range

The range to restrict the coordinate to.

Return Value

A new constraint.

Discussion

Each time constraints are applied, the x-coordinate of the node’s position property is clamped so that it lies inside the specified range.

See Also

Creating Position Constraints

Creating Position Constraints

Create a position constraint and add it to a node.

+ positionX:Y:

Creates a constraint that restricts both coordinates of a node’s position.

+ positionY:

Creates a constraint that restricts the y-coordinate of a node’s position.