objc2_gameplay_kit/generated/
SpriteKit_Additions.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-sprite-kit")]
10use objc2_sprite_kit::*;
11
12use crate::*;
13
14mod private_SKNodeGameplayKit {
15    pub trait Sealed {}
16}
17
18/// Category "GameplayKit" on [`SKNode`].
19#[doc(alias = "GameplayKit")]
20pub unsafe trait SKNodeGameplayKit:
21    ClassType + Sized + private_SKNodeGameplayKit::Sealed
22{
23    extern_methods!(
24        #[cfg(all(feature = "GKObstacle", feature = "objc2-sprite-kit"))]
25        #[cfg(target_os = "macos")]
26        /// Returns an array of GKPolygonObstacles from a group of SKSpriteNode's textures in scene space.
27        ///
28        ///
29        /// See: GKObstacleGraph
30        #[unsafe(method(obstaclesFromSpriteTextures:accuracy:))]
31        #[unsafe(method_family = none)]
32        unsafe fn obstaclesFromSpriteTextures_accuracy(
33            sprites: &NSArray<SKNode>,
34            accuracy: c_float,
35            mtm: MainThreadMarker,
36        ) -> Retained<NSArray<GKPolygonObstacle>>;
37
38        #[cfg(all(feature = "GKObstacle", feature = "objc2-sprite-kit"))]
39        #[cfg(target_os = "macos")]
40        /// Returns an array of GKPolygonObstacles from a group of SKNode's transformed bounds in scene space.
41        ///
42        ///
43        /// See: GKObstacleGraph
44        #[unsafe(method(obstaclesFromNodeBounds:))]
45        #[unsafe(method_family = none)]
46        unsafe fn obstaclesFromNodeBounds(
47            nodes: &NSArray<SKNode>,
48            mtm: MainThreadMarker,
49        ) -> Retained<NSArray<GKPolygonObstacle>>;
50
51        #[cfg(all(feature = "GKObstacle", feature = "objc2-sprite-kit"))]
52        #[cfg(target_os = "macos")]
53        /// Returns an array of GKPolygonObstacles from a group of SKNode's physics bodies in scene space.
54        ///
55        ///
56        /// See: GKObstacleGraph
57        #[unsafe(method(obstaclesFromNodePhysicsBodies:))]
58        #[unsafe(method_family = none)]
59        unsafe fn obstaclesFromNodePhysicsBodies(
60            nodes: &NSArray<SKNode>,
61            mtm: MainThreadMarker,
62        ) -> Retained<NSArray<GKPolygonObstacle>>;
63
64        #[cfg(feature = "GKEntity")]
65        /// The GKEntity associated with the node via a GKSKNodeComponent.
66        ///
67        ///
68        /// See: GKEntity
69        #[unsafe(method(entity))]
70        #[unsafe(method_family = none)]
71        unsafe fn entity(&self) -> Option<Retained<GKEntity>>;
72
73        #[cfg(feature = "GKEntity")]
74        /// Setter for [`entity`][Self::entity].
75        ///
76        /// This is a [weak property][objc2::topics::weak_property].
77        #[unsafe(method(setEntity:))]
78        #[unsafe(method_family = none)]
79        unsafe fn setEntity(&self, entity: Option<&GKEntity>);
80    );
81}
82
83#[cfg(feature = "objc2-sprite-kit")]
84#[cfg(target_os = "macos")]
85impl private_SKNodeGameplayKit::Sealed for SKNode {}
86#[cfg(feature = "objc2-sprite-kit")]
87#[cfg(target_os = "macos")]
88unsafe impl SKNodeGameplayKit for SKNode {}
89
90#[cfg(all(feature = "GKScene", feature = "objc2-sprite-kit"))]
91#[cfg(target_os = "macos")]
92extern_conformance!(
93    unsafe impl GKSceneRootNodeType for SKScene {}
94);
95
96mod private_SKTileMapNodeGameplayKit {
97    pub trait Sealed {}
98}
99
100/// Category "GameplayKit" on [`SKTileMapNode`].
101#[doc(alias = "GameplayKit")]
102pub unsafe trait SKTileMapNodeGameplayKit:
103    ClassType + Sized + private_SKTileMapNodeGameplayKit::Sealed
104{
105    extern_methods!(
106        #[cfg(all(
107            feature = "GKNoiseMap",
108            feature = "objc2-core-foundation",
109            feature = "objc2-sprite-kit"
110        ))]
111        #[cfg(target_os = "macos")]
112        /// Create a set of layered tile map nodes with the specified tile set and dimensions, and fill each layer based on the provided noise map. Each
113        /// layer will be partially filled with a tile group using values from the noise map that fall below the corresponding values in the thresholds
114        /// array. The values in the noise map range from -1 to 1, and the provided threshold values are implicitly bounded with the values -1.0 and 1.0.
115        /// Each threshold value corresponds with a tile group in the tile set, starting with the first tile group in the set. If, for example, we passed
116        /// in a thresholds array with the values [-0.5, 0.0, 0.5], this method would return an array of four tile maps. The first tile map would contain
117        /// the first tile group (i.e., tileSet.tileGroups[0]) within tiles that fall between the threshold values -1.0 and -0.5 in the noise map. The
118        /// second tile map would contain the second tile group (i.e., tileSet.tileGroups[1]) within tiles that fall between the threshold values -0.5 and
119        /// 0.0 in the noise map. The third tile map would contain the third tile group (i.e., tileSet.tileGroups[2]) within tiles that fall between the
120        /// threshold values 0.0 and 0.5 in the noise map. And finally, the fourth tile map would contain the fourth tile group
121        /// (i.e., tileSet.tileGroups[3]) within tiles that fall between the threshold values 0.5 and 1.0.
122        ///
123        ///
124        /// Parameter `tileSet`: the tile set that is used to render the tiles
125        ///
126        /// Parameter `columns`: the number of columns in each map that can hold tiles
127        ///
128        /// Parameter `rows`: the number of rows in each map that can hold tiles
129        ///
130        /// Parameter `tileSize`: the size of each tile in points
131        ///
132        /// Parameter `noiseMap`: the noise map we wish to use to fill each layer
133        ///
134        /// Parameter `thresholds`: the thresholds for each tile group in the tile set
135        #[unsafe(method(tileMapNodesWithTileSet:columns:rows:tileSize:fromNoiseMap:tileTypeNoiseMapThresholds:))]
136        #[unsafe(method_family = none)]
137        unsafe fn tileMapNodesWithTileSet_columns_rows_tileSize_fromNoiseMap_tileTypeNoiseMapThresholds(
138            tile_set: &SKTileSet,
139            columns: NSUInteger,
140            rows: NSUInteger,
141            tile_size: CGSize,
142            noise_map: &GKNoiseMap,
143            thresholds: &NSArray<NSNumber>,
144            mtm: MainThreadMarker,
145        ) -> Retained<NSArray<SKTileMapNode>>;
146    );
147}
148
149#[cfg(feature = "objc2-sprite-kit")]
150#[cfg(target_os = "macos")]
151impl private_SKTileMapNodeGameplayKit::Sealed for SKTileMapNode {}
152#[cfg(feature = "objc2-sprite-kit")]
153#[cfg(target_os = "macos")]
154unsafe impl SKTileMapNodeGameplayKit for SKTileMapNode {}
155
156mod private_SKTextureGameplayKit {
157    pub trait Sealed {}
158}
159
160/// Category "GameplayKit" on [`SKTexture`].
161#[doc(alias = "GameplayKit")]
162pub unsafe trait SKTextureGameplayKit:
163    ClassType + Sized + private_SKTextureGameplayKit::Sealed
164{
165    extern_methods!(
166        #[cfg(feature = "GKNoiseMap")]
167        /// Create a texture from a GKNoiseMap.
168        ///
169        ///
170        /// Parameter `noiseMap`: the GKNoiseMap from which to create the texture.
171        #[unsafe(method(textureWithNoiseMap:))]
172        #[unsafe(method_family = none)]
173        unsafe fn textureWithNoiseMap(noise_map: &GKNoiseMap) -> Retained<Self>;
174    );
175}
176
177#[cfg(feature = "objc2-sprite-kit")]
178impl private_SKTextureGameplayKit::Sealed for SKTexture {}
179#[cfg(feature = "objc2-sprite-kit")]
180unsafe impl SKTextureGameplayKit for SKTexture {}