Class

SKWarpGeometryGrid

A definition for a grid-based deformation of nodes that conform to SKWarpable.

Declaration

@interface SKWarpGeometryGrid : SKWarpGeometry

Overview

An SKWarpGeometryGrid exposes a 2D array of source positions, and set of destination positions with matching size, that allow you to define which sections of a node should be translated from the source positions to the destination positions. Conceptually, this forms two grids—a source grid and a destination grid—where the visual warping is accomplished by stretching or shrinking each section of the node as the source positions of the grid interpolate to their corresponding destination positions.

Topics

Creating a Warp Geometry Grid

+ gridWithColumns:rows:

Creates a warp geometry grid of a specified size.

- initWithColumns:rows:sourcePositions:destPositions:

Creates a warp geometry grid of a specific size and warp translation, in pointers to point arrays.

+ grid

Initializes a new empty grid.

- initWithCoder:

Tells you when to intialize a grid that was loaded from an archive.

Animating Warping

Animate the Warping of a Sprite

Interpolate warping from source to destination warp geometry grids.

Accessing or Setting Warp Geometry Grid Size

numberOfColumns

The object's number of columns.

numberOfRows

The object's number of rows.

vertexCount

The object's total number of vertices.

Accessing or Setting Grid Vertices

Get or set float2 values that correspond to individual vertices of the grid.

- destPositionAtIndex:

Returns the destination position of a vertex.

- sourcePositionAtIndex:

Returns the source position of a vertex.

- gridByReplacingDestPositions:

Returns a copy of the receiver with the destination positions replaced by a specified array.

- gridByReplacingSourcePositions:

Returns a copy of the receiver with the source positions replaced by a specified array.

Relationships

Inherits From

Conforms To

See Also

Warping

SKWarpGeometry

A definition for a deformation of nodes that conform to SKWarpable.

SKWarpable

A protocol for objects that can be warped and animated by an SKWarpGeometry.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software