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