Contents

positionX(_:)

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

Declaration

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

Parameters

  • range:

    The range to restrict the coordinate to.

Mentioned in

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