Type Method

positionY(_:)

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

Declaration

class func positionY(_ range: SKRange) -> Self

Parameters

range

The range to restrict the coordinate to.

Return Value

A new constraint.

Discussion

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

See Also

Creating Position Constraints

class func positionX(SKRange)

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

class func positionX(SKRange, y: SKRange)

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