objc2-sprite-kit 0.3.2

Bindings to the SpriteKit framework
Documentation
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
//! 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-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/spritekit/skparticlerenderorder?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SKParticleRenderOrder(pub NSUInteger);
impl SKParticleRenderOrder {
    #[doc(alias = "SKParticleRenderOrderOldestLast")]
    pub const OldestLast: Self = Self(0);
    #[doc(alias = "SKParticleRenderOrderOldestFirst")]
    pub const OldestFirst: Self = Self(1);
    #[doc(alias = "SKParticleRenderOrderDontCare")]
    pub const DontCare: Self = Self(2);
}

unsafe impl Encode for SKParticleRenderOrder {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for SKParticleRenderOrder {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// An emitter of particle sprites.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/skemitternode?language=objc)
    #[unsafe(super(SKNode, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
    #[cfg(target_os = "macos")]
    pub struct SKEmitterNode;
);

#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSCoding for SKEmitterNode {}
);

#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSCopying for SKEmitterNode {}
);

#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
unsafe impl CopyingHelper for SKEmitterNode {
    type Result = Self;
}

#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSObjectProtocol for SKEmitterNode {}
);

#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSSecureCoding for SKEmitterNode {}
);

#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKEmitterNode {
    extern_methods!(
        /// The particle simulation is stepped automatically each frame when present in the scene. This allows the user to manually advance the simulation by a fixed amount of time. Useful for pre-populating particles before adding them to the scene.
        #[unsafe(method(advanceSimulationTime:))]
        #[unsafe(method_family = none)]
        pub unsafe fn advanceSimulationTime(&self, sec: NSTimeInterval);

        #[unsafe(method(resetSimulation))]
        #[unsafe(method_family = none)]
        pub unsafe fn resetSimulation(&self);

        #[cfg(feature = "SKTexture")]
        /// The texture to be used for the particles.
        #[unsafe(method(particleTexture))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleTexture(&self) -> Option<Retained<SKTexture>>;

        #[cfg(feature = "SKTexture")]
        /// Setter for [`particleTexture`][Self::particleTexture].
        #[unsafe(method(setParticleTexture:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleTexture(&self, particle_texture: Option<&SKTexture>);

        /// The blend mode for each particle. Defaults to SKBlendModeAlpha.
        #[unsafe(method(particleBlendMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleBlendMode(&self) -> SKBlendMode;

        /// Setter for [`particleBlendMode`][Self::particleBlendMode].
        #[unsafe(method(setParticleBlendMode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleBlendMode(&self, particle_blend_mode: SKBlendMode);

        /// The starting color for each particle. Defaults to clear.
        #[unsafe(method(particleColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColor(&self) -> Retained<NSColor>;

        /// Setter for [`particleColor`][Self::particleColor].
        #[unsafe(method(setParticleColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColor(&self, particle_color: &NSColor);

        #[cfg(feature = "objc2-core-foundation")]
        /// The random variance about each color component for each particle. Defaults to 0.0.
        #[unsafe(method(particleColorRedRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorRedRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorRedRange`][Self::particleColorRedRange].
        #[unsafe(method(setParticleColorRedRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorRedRange(&self, particle_color_red_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(particleColorGreenRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorGreenRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorGreenRange`][Self::particleColorGreenRange].
        #[unsafe(method(setParticleColorGreenRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorGreenRange(&self, particle_color_green_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(particleColorBlueRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorBlueRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorBlueRange`][Self::particleColorBlueRange].
        #[unsafe(method(setParticleColorBlueRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorBlueRange(&self, particle_color_blue_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(particleColorAlphaRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorAlphaRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorAlphaRange`][Self::particleColorAlphaRange].
        #[unsafe(method(setParticleColorAlphaRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorAlphaRange(&self, particle_color_alpha_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The rate at which to modify each color component for each particle (per second).
        #[unsafe(method(particleColorRedSpeed))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorRedSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorRedSpeed`][Self::particleColorRedSpeed].
        #[unsafe(method(setParticleColorRedSpeed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorRedSpeed(&self, particle_color_red_speed: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(particleColorGreenSpeed))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorGreenSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorGreenSpeed`][Self::particleColorGreenSpeed].
        #[unsafe(method(setParticleColorGreenSpeed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorGreenSpeed(&self, particle_color_green_speed: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(particleColorBlueSpeed))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorBlueSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorBlueSpeed`][Self::particleColorBlueSpeed].
        #[unsafe(method(setParticleColorBlueSpeed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorBlueSpeed(&self, particle_color_blue_speed: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(particleColorAlphaSpeed))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorAlphaSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorAlphaSpeed`][Self::particleColorAlphaSpeed].
        #[unsafe(method(setParticleColorAlphaSpeed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorAlphaSpeed(&self, particle_color_alpha_speed: CGFloat);

        #[cfg(feature = "SKKeyframeSequence")]
        #[unsafe(method(particleColorSequence))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorSequence(&self) -> Option<Retained<SKKeyframeSequence>>;

        #[cfg(feature = "SKKeyframeSequence")]
        /// Setter for [`particleColorSequence`][Self::particleColorSequence].
        #[unsafe(method(setParticleColorSequence:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorSequence(
            &self,
            particle_color_sequence: Option<&SKKeyframeSequence>,
        );

        #[cfg(feature = "objc2-core-foundation")]
        /// The starting color blend for each particle. Behaves the same as SKSpriteNode. Defaults to 0.0.
        #[unsafe(method(particleColorBlendFactor))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorBlendFactor(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorBlendFactor`][Self::particleColorBlendFactor].
        #[unsafe(method(setParticleColorBlendFactor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorBlendFactor(&self, particle_color_blend_factor: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The random variance about the starting color blend for each particle. Defaults to 0.0.
        #[unsafe(method(particleColorBlendFactorRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorBlendFactorRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorBlendFactorRange`][Self::particleColorBlendFactorRange].
        #[unsafe(method(setParticleColorBlendFactorRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorBlendFactorRange(
            &self,
            particle_color_blend_factor_range: CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        /// The rate at which to modify the color blend for each particle. Defaults to 0.0.
        #[unsafe(method(particleColorBlendFactorSpeed))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorBlendFactorSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleColorBlendFactorSpeed`][Self::particleColorBlendFactorSpeed].
        #[unsafe(method(setParticleColorBlendFactorSpeed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorBlendFactorSpeed(
            &self,
            particle_color_blend_factor_speed: CGFloat,
        );

        #[cfg(feature = "SKKeyframeSequence")]
        #[unsafe(method(particleColorBlendFactorSequence))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleColorBlendFactorSequence(
            &self,
        ) -> Option<Retained<SKKeyframeSequence>>;

        #[cfg(feature = "SKKeyframeSequence")]
        /// Setter for [`particleColorBlendFactorSequence`][Self::particleColorBlendFactorSequence].
        #[unsafe(method(setParticleColorBlendFactorSequence:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleColorBlendFactorSequence(
            &self,
            particle_color_blend_factor_sequence: Option<&SKKeyframeSequence>,
        );

        #[cfg(feature = "objc2-core-foundation")]
        /// The starting position for each particle in the emitter's coordinate space. Defaults to (0.0, 0,0).
        #[unsafe(method(particlePosition))]
        #[unsafe(method_family = none)]
        pub unsafe fn particlePosition(&self) -> CGPoint;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particlePosition`][Self::particlePosition].
        #[unsafe(method(setParticlePosition:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticlePosition(&self, particle_position: CGPoint);

        #[cfg(feature = "objc2-core-foundation")]
        /// The random variance about the starting position for each particle in the emitter's coordinate space. Defaults to (0.0, 0,0).
        #[unsafe(method(particlePositionRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particlePositionRange(&self) -> CGVector;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particlePositionRange`][Self::particlePositionRange].
        #[unsafe(method(setParticlePositionRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticlePositionRange(&self, particle_position_range: CGVector);

        #[cfg(feature = "objc2-core-foundation")]
        /// The starting speed for each particle along its emission vector. Defaults to 0.0.
        #[unsafe(method(particleSpeed))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleSpeed`][Self::particleSpeed].
        #[unsafe(method(setParticleSpeed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleSpeed(&self, particle_speed: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The random variance about the starting speed for each particle along its emission vector. Defaults to 0.0.
        #[unsafe(method(particleSpeedRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleSpeedRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleSpeedRange`][Self::particleSpeedRange].
        #[unsafe(method(setParticleSpeedRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleSpeedRange(&self, particle_speed_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The angle at which to emit each new particle, in radians. Defaults to 0.0.
        #[unsafe(method(emissionAngle))]
        #[unsafe(method_family = none)]
        pub unsafe fn emissionAngle(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`emissionAngle`][Self::emissionAngle].
        #[unsafe(method(setEmissionAngle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEmissionAngle(&self, emission_angle: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The random variance about the angle at which to emit each new particle, in radians. Defaults to 0.0.
        #[unsafe(method(emissionAngleRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn emissionAngleRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`emissionAngleRange`][Self::emissionAngleRange].
        #[unsafe(method(setEmissionAngleRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEmissionAngleRange(&self, emission_angle_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The acceleration to apply to each particles velocity. Useful for simulating effects such as wind or gravity. Defaults to 0.0.
        #[unsafe(method(xAcceleration))]
        #[unsafe(method_family = none)]
        pub unsafe fn xAcceleration(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`xAcceleration`][Self::xAcceleration].
        #[unsafe(method(setXAcceleration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setXAcceleration(&self, x_acceleration: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(yAcceleration))]
        #[unsafe(method_family = none)]
        pub unsafe fn yAcceleration(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`yAcceleration`][Self::yAcceleration].
        #[unsafe(method(setYAcceleration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setYAcceleration(&self, y_acceleration: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The rate at which new particles are generated, in particles per second. Defaults to 0.0.
        #[unsafe(method(particleBirthRate))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleBirthRate(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleBirthRate`][Self::particleBirthRate].
        #[unsafe(method(setParticleBirthRate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleBirthRate(&self, particle_birth_rate: CGFloat);

        /// The number of particles that will be emitted. If set to 0, there is no limit. Defaults to 0.
        #[unsafe(method(numParticlesToEmit))]
        #[unsafe(method_family = none)]
        pub unsafe fn numParticlesToEmit(&self) -> NSUInteger;

        /// Setter for [`numParticlesToEmit`][Self::numParticlesToEmit].
        #[unsafe(method(setNumParticlesToEmit:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNumParticlesToEmit(&self, num_particles_to_emit: NSUInteger);

        #[cfg(feature = "objc2-core-foundation")]
        /// The lifetime of each particle, in seconds. Defaults to 0.0.
        #[unsafe(method(particleLifetime))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleLifetime(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleLifetime`][Self::particleLifetime].
        #[unsafe(method(setParticleLifetime:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleLifetime(&self, particle_lifetime: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The random variance about the lifetime of each particle, in seconds. Defaults to 0.0.
        #[unsafe(method(particleLifetimeRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleLifetimeRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleLifetimeRange`][Self::particleLifetimeRange].
        #[unsafe(method(setParticleLifetimeRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleLifetimeRange(&self, particle_lifetime_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The starting z-rotation for each particle. Defaults to 0.0.
        #[unsafe(method(particleRotation))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleRotation(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleRotation`][Self::particleRotation].
        #[unsafe(method(setParticleRotation:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleRotation(&self, particle_rotation: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The random variance about the starting z-rotation for each particle. Defaults to 0.0.
        #[unsafe(method(particleRotationRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleRotationRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleRotationRange`][Self::particleRotationRange].
        #[unsafe(method(setParticleRotationRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleRotationRange(&self, particle_rotation_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The rate at which to modify the z-rotation for each particle. Defaults to 0.0.
        #[unsafe(method(particleRotationSpeed))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleRotationSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleRotationSpeed`][Self::particleRotationSpeed].
        #[unsafe(method(setParticleRotationSpeed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleRotationSpeed(&self, particle_rotation_speed: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The starting size for each particle. If set to CGSizeZero (the default) the particles will start at the size of the texture assigned to particleTexture. Note that particleScale and particleScaleRange will also have an effect on the effective size of each new particle.
        #[unsafe(method(particleSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleSize(&self) -> CGSize;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleSize`][Self::particleSize].
        #[unsafe(method(setParticleSize:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleSize(&self, particle_size: CGSize);

        #[cfg(feature = "objc2-core-foundation")]
        /// The starting scale for each particle. Defaults to 1.0.
        #[unsafe(method(particleScale))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleScale(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleScale`][Self::particleScale].
        #[unsafe(method(setParticleScale:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleScale(&self, particle_scale: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The random variance about the starting scale for each particle. Defaults to 0.0.
        #[unsafe(method(particleScaleRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleScaleRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleScaleRange`][Self::particleScaleRange].
        #[unsafe(method(setParticleScaleRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleScaleRange(&self, particle_scale_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The rate at which to modify the scale for each particle. Defaults to 0.0.
        #[unsafe(method(particleScaleSpeed))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleScaleSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleScaleSpeed`][Self::particleScaleSpeed].
        #[unsafe(method(setParticleScaleSpeed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleScaleSpeed(&self, particle_scale_speed: CGFloat);

        #[cfg(feature = "SKKeyframeSequence")]
        #[unsafe(method(particleScaleSequence))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleScaleSequence(&self) -> Option<Retained<SKKeyframeSequence>>;

        #[cfg(feature = "SKKeyframeSequence")]
        /// Setter for [`particleScaleSequence`][Self::particleScaleSequence].
        #[unsafe(method(setParticleScaleSequence:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleScaleSequence(
            &self,
            particle_scale_sequence: Option<&SKKeyframeSequence>,
        );

        #[cfg(feature = "objc2-core-foundation")]
        /// The starting alpha for each particle. Defaults to 1.0.
        #[unsafe(method(particleAlpha))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleAlpha(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleAlpha`][Self::particleAlpha].
        #[unsafe(method(setParticleAlpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleAlpha(&self, particle_alpha: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The random variance about the starting alpha for each particle. Defaults to 1.0.
        #[unsafe(method(particleAlphaRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleAlphaRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleAlphaRange`][Self::particleAlphaRange].
        #[unsafe(method(setParticleAlphaRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleAlphaRange(&self, particle_alpha_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The rate at which to modify the alpha for each particle. Defaults to 1.0.
        #[unsafe(method(particleAlphaSpeed))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleAlphaSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleAlphaSpeed`][Self::particleAlphaSpeed].
        #[unsafe(method(setParticleAlphaSpeed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleAlphaSpeed(&self, particle_alpha_speed: CGFloat);

        #[cfg(feature = "SKKeyframeSequence")]
        #[unsafe(method(particleAlphaSequence))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleAlphaSequence(&self) -> Option<Retained<SKKeyframeSequence>>;

        #[cfg(feature = "SKKeyframeSequence")]
        /// Setter for [`particleAlphaSequence`][Self::particleAlphaSequence].
        #[unsafe(method(setParticleAlphaSequence:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleAlphaSequence(
            &self,
            particle_alpha_sequence: Option<&SKKeyframeSequence>,
        );

        #[cfg(feature = "SKAction")]
        /// Specifies an action executed by new particles.
        #[unsafe(method(particleAction))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleAction(&self) -> Option<Retained<SKAction>>;

        #[cfg(feature = "SKAction")]
        /// Setter for [`particleAction`][Self::particleAction].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setParticleAction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleAction(&self, particle_action: Option<&SKAction>);

        /// Defines what logical 'categories' of fields this particles emitted respond to. Defaults to all bits set (all categories).
        /// Can be forced off via affectedByGravity.
        #[unsafe(method(fieldBitMask))]
        #[unsafe(method_family = none)]
        pub unsafe fn fieldBitMask(&self) -> u32;

        /// Setter for [`fieldBitMask`][Self::fieldBitMask].
        #[unsafe(method(setFieldBitMask:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFieldBitMask(&self, field_bit_mask: u32);

        /// Normally the particles are rendered as if they were a child of the SKEmitterNode, they can also be rendered as if they were a child of any other node in the scene by setting the targetNode property. Defaults to nil (standard behavior).
        #[unsafe(method(targetNode))]
        #[unsafe(method_family = none)]
        pub unsafe fn targetNode(&self) -> Option<Retained<SKNode>>;

        /// Setter for [`targetNode`][Self::targetNode].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setTargetNode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTargetNode(&self, target_node: Option<&SKNode>);

        #[cfg(feature = "SKShader")]
        #[unsafe(method(shader))]
        #[unsafe(method_family = none)]
        pub unsafe fn shader(&self) -> Option<Retained<SKShader>>;

        #[cfg(feature = "SKShader")]
        /// Setter for [`shader`][Self::shader].
        #[unsafe(method(setShader:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShader(&self, shader: Option<&SKShader>);

        #[cfg(feature = "SKAttribute")]
        /// Optional dictionary of SKAttributeValues
        /// Attributes can be used with custom SKShaders.
        #[unsafe(method(attributeValues))]
        #[unsafe(method_family = none)]
        pub unsafe fn attributeValues(&self) -> Retained<NSDictionary<NSString, SKAttributeValue>>;

        #[cfg(feature = "SKAttribute")]
        /// Setter for [`attributeValues`][Self::attributeValues].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAttributeValues:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttributeValues(
            &self,
            attribute_values: &NSDictionary<NSString, SKAttributeValue>,
        );

        #[cfg(feature = "SKAttribute")]
        #[unsafe(method(valueForAttributeNamed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn valueForAttributeNamed(
            &self,
            key: &NSString,
        ) -> Option<Retained<SKAttributeValue>>;

        #[cfg(feature = "SKAttribute")]
        #[unsafe(method(setValue:forAttributeNamed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setValue_forAttributeNamed(&self, value: &SKAttributeValue, key: &NSString);

        #[cfg(feature = "objc2-core-foundation")]
        /// The starting z-position for each particle. Defaults to 0.0.
        #[unsafe(method(particleZPosition))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleZPosition(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleZPosition`][Self::particleZPosition].
        #[unsafe(method(setParticleZPosition:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleZPosition(&self, particle_z_position: CGFloat);

        /// The order in which particles will be rendered. Defaults to SKParticleRenderOrderOldestLast.
        #[unsafe(method(particleRenderOrder))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleRenderOrder(&self) -> SKParticleRenderOrder;

        /// Setter for [`particleRenderOrder`][Self::particleRenderOrder].
        #[unsafe(method(setParticleRenderOrder:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleRenderOrder(&self, particle_render_order: SKParticleRenderOrder);

        #[cfg(feature = "objc2-core-foundation")]
        /// The random variance about the starting z-position for each particle. Defaults to 0.0.
        #[deprecated]
        #[unsafe(method(particleZPositionRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleZPositionRange(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleZPositionRange`][Self::particleZPositionRange].
        #[deprecated]
        #[unsafe(method(setParticleZPositionRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleZPositionRange(&self, particle_z_position_range: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The rate at which to modify the z-position for each particle. Defaults to 0.0.
        #[deprecated]
        #[unsafe(method(particleZPositionSpeed))]
        #[unsafe(method_family = none)]
        pub unsafe fn particleZPositionSpeed(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`particleZPositionSpeed`][Self::particleZPositionSpeed].
        #[deprecated]
        #[unsafe(method(setParticleZPositionSpeed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setParticleZPositionSpeed(&self, particle_z_position_speed: CGFloat);
    );
}

/// Methods declared on superclass `SKNode`.
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKEmitterNode {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// Support coding and decoding via NSKeyedArchiver.
        ///
        /// # Safety
        ///
        /// `a_decoder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            a_decoder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(node))]
        #[unsafe(method_family = none)]
        pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;

        #[unsafe(method(nodeWithFileNamed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn nodeWithFileNamed(
            filename: &NSString,
            mtm: MainThreadMarker,
        ) -> Option<Retained<Self>>;

        /// # Safety
        ///
        /// `classes` generic probably has further requirements.
        #[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
            filename: &NSString,
            classes: &NSSet<AnyClass>,
            mtm: MainThreadMarker,
        ) -> Result<Retained<Self>, Retained<NSError>>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKEmitterNode {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}