SKNodeGameplayKit

Trait SKNodeGameplayKit 

Source
pub unsafe trait SKNodeGameplayKit:
    ClassType
    + Sized
    + Sealed {
    // Provided methods
    unsafe fn obstaclesFromSpriteTextures_accuracy(
        sprites: &NSArray<SKNode>,
        accuracy: c_float,
        mtm: MainThreadMarker,
    ) -> Retained<NSArray<GKPolygonObstacle>> { ... }
    unsafe fn obstaclesFromNodeBounds(
        nodes: &NSArray<SKNode>,
        mtm: MainThreadMarker,
    ) -> Retained<NSArray<GKPolygonObstacle>> { ... }
    unsafe fn obstaclesFromNodePhysicsBodies(
        nodes: &NSArray<SKNode>,
        mtm: MainThreadMarker,
    ) -> Retained<NSArray<GKPolygonObstacle>> { ... }
    unsafe fn entity(&self) -> Option<Retained<GKEntity>> { ... }
    unsafe fn setEntity(&self, entity: Option<&GKEntity>) { ... }
}
Available on crate feature SpriteKit_Additions only.
Expand description

Category “GameplayKit” on SKNode.

Provided Methods§

Source

unsafe fn obstaclesFromSpriteTextures_accuracy( sprites: &NSArray<SKNode>, accuracy: c_float, mtm: MainThreadMarker, ) -> Retained<NSArray<GKPolygonObstacle>>

Available on crate feature GKObstacle and crate feature objc2-sprite-kit and macOS only.

Returns an array of GKPolygonObstacles from a group of SKSpriteNode’s textures in scene space.

See: GKObstacleGraph

Source

unsafe fn obstaclesFromNodeBounds( nodes: &NSArray<SKNode>, mtm: MainThreadMarker, ) -> Retained<NSArray<GKPolygonObstacle>>

Available on crate feature GKObstacle and crate feature objc2-sprite-kit and macOS only.

Returns an array of GKPolygonObstacles from a group of SKNode’s transformed bounds in scene space.

See: GKObstacleGraph

Source

unsafe fn obstaclesFromNodePhysicsBodies( nodes: &NSArray<SKNode>, mtm: MainThreadMarker, ) -> Retained<NSArray<GKPolygonObstacle>>

Available on crate feature GKObstacle and crate feature objc2-sprite-kit and macOS only.

Returns an array of GKPolygonObstacles from a group of SKNode’s physics bodies in scene space.

See: GKObstacleGraph

Source

unsafe fn entity(&self) -> Option<Retained<GKEntity>>

Available on crate feature GKEntity only.

The GKEntity associated with the node via a GKSKNodeComponent.

See: GKEntity

Source

unsafe fn setEntity(&self, entity: Option<&GKEntity>)

Available on crate feature GKEntity only.

Setter for entity.

This is a weak property.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SKNodeGameplayKit for SKNode

Available on crate feature objc2-sprite-kit and macOS only.

Implementors§