objc2_sprite_kit/generated/
SKSpriteNode.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9#[cfg(feature = "objc2-core-foundation")]
10use objc2_core_foundation::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15extern_class!(
16 #[unsafe(super(SKNode, NSResponder, NSObject))]
27 #[derive(Debug, PartialEq, Eq, Hash)]
28 #[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
29 #[cfg(target_os = "macos")]
30 pub struct SKSpriteNode;
31);
32
33#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
34#[cfg(target_os = "macos")]
35extern_conformance!(
36 unsafe impl NSCoding for SKSpriteNode {}
37);
38
39#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
40#[cfg(target_os = "macos")]
41extern_conformance!(
42 unsafe impl NSCopying for SKSpriteNode {}
43);
44
45#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
46#[cfg(target_os = "macos")]
47unsafe impl CopyingHelper for SKSpriteNode {
48 type Result = Self;
49}
50
51#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
52#[cfg(target_os = "macos")]
53extern_conformance!(
54 unsafe impl NSObjectProtocol for SKSpriteNode {}
55);
56
57#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
58#[cfg(target_os = "macos")]
59extern_conformance!(
60 unsafe impl NSSecureCoding for SKSpriteNode {}
61);
62
63#[cfg(all(
64 feature = "SKNode",
65 feature = "SKWarpGeometry",
66 feature = "objc2-app-kit"
67))]
68#[cfg(target_os = "macos")]
69extern_conformance!(
70 unsafe impl SKWarpable for SKSpriteNode {}
71);
72
73#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
74#[cfg(target_os = "macos")]
75impl SKSpriteNode {
76 extern_methods!(
77 #[cfg(all(feature = "SKTexture", feature = "objc2-core-foundation"))]
78 #[unsafe(method(spriteNodeWithTexture:size:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn spriteNodeWithTexture_size(
86 texture: Option<&SKTexture>,
87 size: CGSize,
88 mtm: MainThreadMarker,
89 ) -> Retained<Self>;
90
91 #[cfg(feature = "SKTexture")]
92 #[unsafe(method(spriteNodeWithTexture:))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn spriteNodeWithTexture(
98 texture: Option<&SKTexture>,
99 mtm: MainThreadMarker,
100 ) -> Retained<Self>;
101
102 #[cfg(feature = "SKTexture")]
103 #[unsafe(method(spriteNodeWithTexture:normalMap:))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn spriteNodeWithTexture_normalMap(
106 texture: Option<&SKTexture>,
107 normal_map: Option<&SKTexture>,
108 mtm: MainThreadMarker,
109 ) -> Retained<Self>;
110
111 #[unsafe(method(spriteNodeWithImageNamed:))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn spriteNodeWithImageNamed(
119 name: &NSString,
120 mtm: MainThreadMarker,
121 ) -> Retained<Self>;
122
123 #[unsafe(method(spriteNodeWithImageNamed:normalMapped:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn spriteNodeWithImageNamed_normalMapped(
126 name: &NSString,
127 generate_normal_map: bool,
128 mtm: MainThreadMarker,
129 ) -> Retained<Self>;
130
131 #[cfg(feature = "objc2-core-foundation")]
132 #[unsafe(method(spriteNodeWithColor:size:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn spriteNodeWithColor_size(
140 color: &NSColor,
141 size: CGSize,
142 mtm: MainThreadMarker,
143 ) -> Retained<Self>;
144
145 #[cfg(all(feature = "SKTexture", feature = "objc2-core-foundation"))]
146 #[unsafe(method(initWithTexture:color:size:))]
155 #[unsafe(method_family = init)]
156 pub unsafe fn initWithTexture_color_size(
157 this: Allocated<Self>,
158 texture: Option<&SKTexture>,
159 color: &NSColor,
160 size: CGSize,
161 ) -> Retained<Self>;
162
163 #[cfg(feature = "SKTexture")]
164 #[unsafe(method(initWithTexture:))]
168 #[unsafe(method_family = init)]
169 pub unsafe fn initWithTexture(
170 this: Allocated<Self>,
171 texture: Option<&SKTexture>,
172 ) -> Retained<Self>;
173
174 #[unsafe(method(initWithImageNamed:))]
180 #[unsafe(method_family = init)]
181 pub unsafe fn initWithImageNamed(this: Allocated<Self>, name: &NSString) -> Retained<Self>;
182
183 #[cfg(feature = "objc2-core-foundation")]
184 #[unsafe(method(initWithColor:size:))]
190 #[unsafe(method_family = init)]
191 pub unsafe fn initWithColor_size(
192 this: Allocated<Self>,
193 color: &NSColor,
194 size: CGSize,
195 ) -> Retained<Self>;
196
197 #[unsafe(method(initWithCoder:))]
199 #[unsafe(method_family = init)]
200 pub unsafe fn initWithCoder(
201 this: Allocated<Self>,
202 a_decoder: &NSCoder,
203 ) -> Option<Retained<Self>>;
204
205 #[cfg(feature = "SKTexture")]
206 #[unsafe(method(texture))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn texture(&self) -> Option<Retained<SKTexture>>;
210
211 #[cfg(feature = "SKTexture")]
212 #[unsafe(method(setTexture:))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn setTexture(&self, texture: Option<&SKTexture>);
216
217 #[cfg(feature = "SKTexture")]
218 #[unsafe(method(normalTexture))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn normalTexture(&self) -> Option<Retained<SKTexture>>;
229
230 #[cfg(feature = "SKTexture")]
231 #[unsafe(method(setNormalTexture:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn setNormalTexture(&self, normal_texture: Option<&SKTexture>);
235
236 #[unsafe(method(lightingBitMask))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn lightingBitMask(&self) -> u32;
245
246 #[unsafe(method(setLightingBitMask:))]
248 #[unsafe(method_family = none)]
249 pub unsafe fn setLightingBitMask(&self, lighting_bit_mask: u32);
250
251 #[unsafe(method(shadowCastBitMask))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn shadowCastBitMask(&self) -> u32;
254
255 #[unsafe(method(setShadowCastBitMask:))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn setShadowCastBitMask(&self, shadow_cast_bit_mask: u32);
259
260 #[unsafe(method(shadowedBitMask))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn shadowedBitMask(&self) -> u32;
263
264 #[unsafe(method(setShadowedBitMask:))]
266 #[unsafe(method_family = none)]
267 pub unsafe fn setShadowedBitMask(&self, shadowed_bit_mask: u32);
268
269 #[cfg(feature = "objc2-core-foundation")]
270 #[unsafe(method(centerRect))]
274 #[unsafe(method_family = none)]
275 pub unsafe fn centerRect(&self) -> CGRect;
276
277 #[cfg(feature = "objc2-core-foundation")]
278 #[unsafe(method(setCenterRect:))]
280 #[unsafe(method_family = none)]
281 pub unsafe fn setCenterRect(&self, center_rect: CGRect);
282
283 #[cfg(feature = "objc2-core-foundation")]
284 #[unsafe(method(colorBlendFactor))]
286 #[unsafe(method_family = none)]
287 pub unsafe fn colorBlendFactor(&self) -> CGFloat;
288
289 #[cfg(feature = "objc2-core-foundation")]
290 #[unsafe(method(setColorBlendFactor:))]
292 #[unsafe(method_family = none)]
293 pub unsafe fn setColorBlendFactor(&self, color_blend_factor: CGFloat);
294
295 #[unsafe(method(color))]
297 #[unsafe(method_family = none)]
298 pub unsafe fn color(&self) -> Retained<NSColor>;
299
300 #[unsafe(method(setColor:))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn setColor(&self, color: &NSColor);
304
305 #[unsafe(method(blendMode))]
309 #[unsafe(method_family = none)]
310 pub unsafe fn blendMode(&self) -> SKBlendMode;
311
312 #[unsafe(method(setBlendMode:))]
314 #[unsafe(method_family = none)]
315 pub unsafe fn setBlendMode(&self, blend_mode: SKBlendMode);
316
317 #[cfg(feature = "objc2-core-foundation")]
318 #[unsafe(method(anchorPoint))]
320 #[unsafe(method_family = none)]
321 pub unsafe fn anchorPoint(&self) -> CGPoint;
322
323 #[cfg(feature = "objc2-core-foundation")]
324 #[unsafe(method(setAnchorPoint:))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn setAnchorPoint(&self, anchor_point: CGPoint);
328
329 #[cfg(feature = "objc2-core-foundation")]
330 #[unsafe(method(size))]
332 #[unsafe(method_family = none)]
333 pub unsafe fn size(&self) -> CGSize;
334
335 #[cfg(feature = "objc2-core-foundation")]
336 #[unsafe(method(setSize:))]
338 #[unsafe(method_family = none)]
339 pub unsafe fn setSize(&self, size: CGSize);
340
341 #[cfg(feature = "objc2-core-foundation")]
342 #[unsafe(method(scaleToSize:))]
346 #[unsafe(method_family = none)]
347 pub unsafe fn scaleToSize(&self, size: CGSize);
348
349 #[cfg(feature = "SKShader")]
350 #[unsafe(method(shader))]
351 #[unsafe(method_family = none)]
352 pub unsafe fn shader(&self) -> Option<Retained<SKShader>>;
353
354 #[cfg(feature = "SKShader")]
355 #[unsafe(method(setShader:))]
357 #[unsafe(method_family = none)]
358 pub unsafe fn setShader(&self, shader: Option<&SKShader>);
359
360 #[cfg(feature = "SKAttribute")]
361 #[unsafe(method(attributeValues))]
364 #[unsafe(method_family = none)]
365 pub unsafe fn attributeValues(&self) -> Retained<NSDictionary<NSString, SKAttributeValue>>;
366
367 #[cfg(feature = "SKAttribute")]
368 #[unsafe(method(setAttributeValues:))]
370 #[unsafe(method_family = none)]
371 pub unsafe fn setAttributeValues(
372 &self,
373 attribute_values: &NSDictionary<NSString, SKAttributeValue>,
374 );
375
376 #[cfg(feature = "SKAttribute")]
377 #[unsafe(method(valueForAttributeNamed:))]
378 #[unsafe(method_family = none)]
379 pub unsafe fn valueForAttributeNamed(
380 &self,
381 key: &NSString,
382 ) -> Option<Retained<SKAttributeValue>>;
383
384 #[cfg(feature = "SKAttribute")]
385 #[unsafe(method(setValue:forAttributeNamed:))]
386 #[unsafe(method_family = none)]
387 pub unsafe fn setValue_forAttributeNamed(&self, value: &SKAttributeValue, key: &NSString);
388 );
389}
390
391#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
393#[cfg(target_os = "macos")]
394impl SKSpriteNode {
395 extern_methods!(
396 #[unsafe(method(init))]
397 #[unsafe(method_family = init)]
398 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
399
400 #[unsafe(method(node))]
401 #[unsafe(method_family = none)]
402 pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
403
404 #[unsafe(method(nodeWithFileNamed:))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn nodeWithFileNamed(
407 filename: &NSString,
408 mtm: MainThreadMarker,
409 ) -> Option<Retained<Self>>;
410
411 #[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
412 #[unsafe(method_family = none)]
413 pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
414 filename: &NSString,
415 classes: &NSSet<AnyClass>,
416 mtm: MainThreadMarker,
417 ) -> Result<Retained<Self>, Retained<NSError>>;
418 );
419}
420
421#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
423#[cfg(target_os = "macos")]
424impl SKSpriteNode {
425 extern_methods!(
426 #[unsafe(method(new))]
427 #[unsafe(method_family = new)]
428 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
429 );
430}