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:))]
203 #[unsafe(method_family = init)]
204 pub unsafe fn initWithCoder(
205 this: Allocated<Self>,
206 a_decoder: &NSCoder,
207 ) -> Option<Retained<Self>>;
208
209 #[cfg(feature = "SKTexture")]
210 #[unsafe(method(texture))]
212 #[unsafe(method_family = none)]
213 pub unsafe fn texture(&self) -> Option<Retained<SKTexture>>;
214
215 #[cfg(feature = "SKTexture")]
216 #[unsafe(method(setTexture:))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn setTexture(&self, texture: Option<&SKTexture>);
220
221 #[cfg(feature = "SKTexture")]
222 #[unsafe(method(normalTexture))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn normalTexture(&self) -> Option<Retained<SKTexture>>;
233
234 #[cfg(feature = "SKTexture")]
235 #[unsafe(method(setNormalTexture:))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn setNormalTexture(&self, normal_texture: Option<&SKTexture>);
239
240 #[unsafe(method(lightingBitMask))]
247 #[unsafe(method_family = none)]
248 pub unsafe fn lightingBitMask(&self) -> u32;
249
250 #[unsafe(method(setLightingBitMask:))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn setLightingBitMask(&self, lighting_bit_mask: u32);
254
255 #[unsafe(method(shadowCastBitMask))]
256 #[unsafe(method_family = none)]
257 pub unsafe fn shadowCastBitMask(&self) -> u32;
258
259 #[unsafe(method(setShadowCastBitMask:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn setShadowCastBitMask(&self, shadow_cast_bit_mask: u32);
263
264 #[unsafe(method(shadowedBitMask))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn shadowedBitMask(&self) -> u32;
267
268 #[unsafe(method(setShadowedBitMask:))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn setShadowedBitMask(&self, shadowed_bit_mask: u32);
272
273 #[cfg(feature = "objc2-core-foundation")]
274 #[unsafe(method(centerRect))]
278 #[unsafe(method_family = none)]
279 pub unsafe fn centerRect(&self) -> CGRect;
280
281 #[cfg(feature = "objc2-core-foundation")]
282 #[unsafe(method(setCenterRect:))]
284 #[unsafe(method_family = none)]
285 pub unsafe fn setCenterRect(&self, center_rect: CGRect);
286
287 #[cfg(feature = "objc2-core-foundation")]
288 #[unsafe(method(colorBlendFactor))]
290 #[unsafe(method_family = none)]
291 pub unsafe fn colorBlendFactor(&self) -> CGFloat;
292
293 #[cfg(feature = "objc2-core-foundation")]
294 #[unsafe(method(setColorBlendFactor:))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn setColorBlendFactor(&self, color_blend_factor: CGFloat);
298
299 #[unsafe(method(color))]
301 #[unsafe(method_family = none)]
302 pub unsafe fn color(&self) -> Retained<NSColor>;
303
304 #[unsafe(method(setColor:))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn setColor(&self, color: &NSColor);
308
309 #[unsafe(method(blendMode))]
313 #[unsafe(method_family = none)]
314 pub unsafe fn blendMode(&self) -> SKBlendMode;
315
316 #[unsafe(method(setBlendMode:))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn setBlendMode(&self, blend_mode: SKBlendMode);
320
321 #[cfg(feature = "objc2-core-foundation")]
322 #[unsafe(method(anchorPoint))]
324 #[unsafe(method_family = none)]
325 pub unsafe fn anchorPoint(&self) -> CGPoint;
326
327 #[cfg(feature = "objc2-core-foundation")]
328 #[unsafe(method(setAnchorPoint:))]
330 #[unsafe(method_family = none)]
331 pub unsafe fn setAnchorPoint(&self, anchor_point: CGPoint);
332
333 #[cfg(feature = "objc2-core-foundation")]
334 #[unsafe(method(size))]
336 #[unsafe(method_family = none)]
337 pub unsafe fn size(&self) -> CGSize;
338
339 #[cfg(feature = "objc2-core-foundation")]
340 #[unsafe(method(setSize:))]
342 #[unsafe(method_family = none)]
343 pub unsafe fn setSize(&self, size: CGSize);
344
345 #[cfg(feature = "objc2-core-foundation")]
346 #[unsafe(method(scaleToSize:))]
350 #[unsafe(method_family = none)]
351 pub unsafe fn scaleToSize(&self, size: CGSize);
352
353 #[cfg(feature = "SKShader")]
354 #[unsafe(method(shader))]
355 #[unsafe(method_family = none)]
356 pub unsafe fn shader(&self) -> Option<Retained<SKShader>>;
357
358 #[cfg(feature = "SKShader")]
359 #[unsafe(method(setShader:))]
361 #[unsafe(method_family = none)]
362 pub unsafe fn setShader(&self, shader: Option<&SKShader>);
363
364 #[cfg(feature = "SKAttribute")]
365 #[unsafe(method(attributeValues))]
368 #[unsafe(method_family = none)]
369 pub unsafe fn attributeValues(&self) -> Retained<NSDictionary<NSString, SKAttributeValue>>;
370
371 #[cfg(feature = "SKAttribute")]
372 #[unsafe(method(setAttributeValues:))]
376 #[unsafe(method_family = none)]
377 pub unsafe fn setAttributeValues(
378 &self,
379 attribute_values: &NSDictionary<NSString, SKAttributeValue>,
380 );
381
382 #[cfg(feature = "SKAttribute")]
383 #[unsafe(method(valueForAttributeNamed:))]
384 #[unsafe(method_family = none)]
385 pub unsafe fn valueForAttributeNamed(
386 &self,
387 key: &NSString,
388 ) -> Option<Retained<SKAttributeValue>>;
389
390 #[cfg(feature = "SKAttribute")]
391 #[unsafe(method(setValue:forAttributeNamed:))]
392 #[unsafe(method_family = none)]
393 pub unsafe fn setValue_forAttributeNamed(&self, value: &SKAttributeValue, key: &NSString);
394 );
395}
396
397#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
399#[cfg(target_os = "macos")]
400impl SKSpriteNode {
401 extern_methods!(
402 #[unsafe(method(init))]
403 #[unsafe(method_family = init)]
404 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
405
406 #[unsafe(method(node))]
407 #[unsafe(method_family = none)]
408 pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
409
410 #[unsafe(method(nodeWithFileNamed:))]
411 #[unsafe(method_family = none)]
412 pub unsafe fn nodeWithFileNamed(
413 filename: &NSString,
414 mtm: MainThreadMarker,
415 ) -> Option<Retained<Self>>;
416
417 #[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
421 #[unsafe(method_family = none)]
422 pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
423 filename: &NSString,
424 classes: &NSSet<AnyClass>,
425 mtm: MainThreadMarker,
426 ) -> Result<Retained<Self>, Retained<NSError>>;
427 );
428}
429
430#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
432#[cfg(target_os = "macos")]
433impl SKSpriteNode {
434 extern_methods!(
435 #[unsafe(method(new))]
436 #[unsafe(method_family = new)]
437 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
438 );
439}