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
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "dispatch2")]
use dispatch2::*;
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::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use objc2_foundation::*;

use crate::*;

/// Adjust the timing of an action
///
///
/// animation to occur evenly over its duration.
///
/// animation to begin slowly, and then speed up as it progresses.
///
/// the animation to begin quickly, and then slow as it completes.
///
/// ease-in ease-out animation begins slowly, accelerates through the middle
/// of its duration, and then slows again before completing.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/skactiontimingmode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SKActionTimingMode(pub NSInteger);
impl SKActionTimingMode {
    #[doc(alias = "SKActionTimingLinear")]
    pub const Linear: Self = Self(0);
    #[doc(alias = "SKActionTimingEaseIn")]
    pub const EaseIn: Self = Self(1);
    #[doc(alias = "SKActionTimingEaseOut")]
    pub const EaseOut: Self = Self(2);
    #[doc(alias = "SKActionTimingEaseInEaseOut")]
    pub const EaseInEaseOut: Self = Self(3);
}

unsafe impl Encode for SKActionTimingMode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

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

/// A custom timing function for SKActions. Input time will be linear 0.0-1.0
/// over the duration of the action. Return values must be 0.0-1.0 and increasing
/// and the function must return 1.0 when the input time reaches 1.0.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/skactiontimingfunction?language=objc)
#[cfg(feature = "block2")]
pub type SKActionTimingFunction = *mut block2::DynBlock<dyn Fn(c_float) -> c_float>;

extern_class!(
    /// An SKAction object is an action that is executed by a node in the scene.
    /// Actions are most often used to change the structure and content of the node to
    /// which they are attached, but can also make other changes to the scene. When
    /// the scene processes its nodes, actions associated with those nodes are evaluated.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/skaction?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct SKAction;
);

extern_conformance!(
    unsafe impl NSCoding for SKAction {}
);

extern_conformance!(
    unsafe impl NSCopying for SKAction {}
);

unsafe impl CopyingHelper for SKAction {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for SKAction {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for SKAction {}
);

impl SKAction {
    extern_methods!(
        /// The duration required to complete an action, in seconds.
        #[unsafe(method(duration))]
        #[unsafe(method_family = none)]
        pub unsafe fn duration(&self) -> NSTimeInterval;

        /// Setter for [`duration`][Self::duration].
        #[unsafe(method(setDuration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDuration(&self, duration: NSTimeInterval);

        /// The timing mode used to execute an action
        ///
        /// See: SKActionTimingMode
        #[unsafe(method(timingMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn timingMode(&self) -> SKActionTimingMode;

        /// Setter for [`timingMode`][Self::timingMode].
        #[unsafe(method(setTimingMode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTimingMode(&self, timing_mode: SKActionTimingMode);

        #[cfg(feature = "block2")]
        /// When set, prodives a custom timing via a block. Applies after
        /// the 'timingMode' property is taken into account, defaults to nil
        ///
        /// See: SKActionTimingFunction
        #[unsafe(method(timingFunction))]
        #[unsafe(method_family = none)]
        pub unsafe fn timingFunction(&self) -> SKActionTimingFunction;

        #[cfg(feature = "block2")]
        /// Setter for [`timingFunction`][Self::timingFunction].
        ///
        /// # Safety
        ///
        /// `timing_function` must be a valid pointer.
        #[unsafe(method(setTimingFunction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTimingFunction(&self, timing_function: SKActionTimingFunction);

        #[cfg(feature = "objc2-core-foundation")]
        /// A speed factor that modifies how fast an action runs. Default value is 1.0
        #[unsafe(method(speed))]
        #[unsafe(method_family = none)]
        pub unsafe fn speed(&self) -> CGFloat;

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

        /// Creates an action that reverses the behavior of another action
        ///
        ///
        /// Returns: This method always returns an action object; however, not all actions
        /// are reversible
        #[unsafe(method(reversedAction))]
        #[unsafe(method_family = none)]
        pub unsafe fn reversedAction(&self) -> Retained<SKAction>;
    );
}

/// Methods declared on superclass `NSObject`.
impl SKAction {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// SKActions.
impl SKAction {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that moves a node relative to its current position
        ///
        /// Parameter `delta`: A vector that describes the change to apply to the node’s position
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(moveBy:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveBy_duration(
            delta: CGVector,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(moveByX:y:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveByX_y_duration(
            delta_x: CGFloat,
            delta_y: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that moves a node to a new position
        ///
        /// Parameter `location`: The coordinates for the node’s new position
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(moveTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveTo_duration(
            location: CGPoint,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(moveToX:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveToX_duration(x: CGFloat, duration: NSTimeInterval) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(moveToY:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveToY_duration(y: CGFloat, duration: NSTimeInterval) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that rotates the node by a relative value
        ///
        /// Parameter `radians`: The amount to rotate the node, in radians
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(rotateByAngle:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn rotateByAngle_duration(
            radians: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that rotates the node counterclockwise to an absolute angle
        ///
        /// Parameter `radians`: The angle to rotate the node to, in radians
        ///
        /// Parameter `duration`: The duration of the animation
        #[unsafe(method(rotateToAngle:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn rotateToAngle_duration(
            radians: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that rotates the node to an absolute value
        ///
        /// Parameter `radians`: The angle to rotate the node to, in radians
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        ///
        /// Parameter `shortestUnitArc`: If YES, then the rotation is performed in whichever
        /// direction results in the smallest rotation. If NO, then the rotation
        /// is interpolated
        #[unsafe(method(rotateToAngle:duration:shortestUnitArc:))]
        #[unsafe(method_family = none)]
        pub unsafe fn rotateToAngle_duration_shortestUnitArc(
            radians: CGFloat,
            duration: NSTimeInterval,
            shortest_unit_arc: bool,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that adjusts the size of a sprite
        ///
        /// Parameter `width`: The amount to add to the sprite’s width
        ///
        /// Parameter `height`: The amount to add to the sprite’s height
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(resizeByWidth:height:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn resizeByWidth_height_duration(
            width: CGFloat,
            height: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that changes the width and height of a sprite to a new absolute value
        ///
        /// Parameter `width`: The new width of the sprite
        ///
        /// Parameter `height`: The new height of the sprite
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(resizeToWidth:height:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn resizeToWidth_height_duration(
            width: CGFloat,
            height: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(resizeToWidth:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn resizeToWidth_duration(
            width: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(resizeToHeight:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn resizeToHeight_duration(
            height: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that changes the x and y scale values of a node by a relative value
        ///
        /// Parameter `scale`: The amount to modify to the node’s x and y scale values
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(scaleBy:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleBy_duration(
            scale: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(scaleXBy:y:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleXBy_y_duration(
            x_scale: CGFloat,
            y_scale: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that changes the x and y scale values of a node by a relative value
        ///
        /// Parameter `scale`: The new value for the node’s x and y scale values
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(scaleTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleTo_duration(
            scale: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(scaleXTo:y:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleXTo_y_duration(
            x_scale: CGFloat,
            y_scale: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(scaleXTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleXTo_duration(
            scale: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(scaleYTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleYTo_duration(
            scale: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Adjust the sprite's xScale
        /// &
        /// yScale to achieve the desired size (in parent's coordinate space)
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(scaleToSize:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleToSize_duration(
            size: CGSize,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        /// Creates an action that runs a collection of actions sequentially
        ///
        /// Parameter `actions`: An array of SKAction objects
        ///
        ///
        /// When the action executes, the first action in the sequence starts
        /// and runs to completion. Subsequent actions in the sequence run in a
        /// similar fashion until all of the actions in the sequence have executed.
        /// The duration of the sequence action is the sum of the durations of the
        /// actions in the sequence.
        ///
        /// This action is reversible; it creates a new sequence action that reverses
        /// the order of the actions. Each action in the reversed sequence is itself
        /// reversed. For example, if an action sequence is {1,2,3}, the reversed
        /// sequence would be {3R,2R,1R}.
        #[unsafe(method(sequence:))]
        #[unsafe(method_family = none)]
        pub unsafe fn sequence(actions: &NSArray<SKAction>) -> Retained<SKAction>;

        /// Creates an action that runs a collection of actions concurrently
        ///
        /// Parameter `actions`: An array of SKAction objects
        ///
        ///
        /// When the action executes, the actions that comprise the group
        /// all start immediately and run in parallel. The duration of the group
        /// action is the longest duration among the collection of actions. If an
        /// action in the group has a duration less than the group’s duration, the
        /// action completes, then idles until the group completes the remaining
        /// actions. This matters most when creating a repeating action that repeats
        /// a group.
        #[unsafe(method(group:))]
        #[unsafe(method_family = none)]
        pub unsafe fn group(actions: &NSArray<SKAction>) -> Retained<SKAction>;

        /// Creates an action that repeats another action a specified number of times
        ///
        /// Parameter `action`: The action to execute
        ///
        /// Parameter `count`: The number of times to execute the action
        #[unsafe(method(repeatAction:count:))]
        #[unsafe(method_family = none)]
        pub unsafe fn repeatAction_count(
            action: &SKAction,
            count: NSUInteger,
        ) -> Retained<SKAction>;

        /// Creates an action that repeats forever
        ///
        /// Parameter `action`: The action to execute
        #[unsafe(method(repeatActionForever:))]
        #[unsafe(method_family = none)]
        pub unsafe fn repeatActionForever(action: &SKAction) -> Retained<SKAction>;

        /// Creates an action that changes the alpha value of the node to 1.0
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(fadeInWithDuration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn fadeInWithDuration(duration: NSTimeInterval) -> Retained<SKAction>;

        /// Creates an action that changes the alpha value of the node to 0.0
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(fadeOutWithDuration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn fadeOutWithDuration(duration: NSTimeInterval) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that adjusts the alpha value of a node by a relative value
        ///
        /// Parameter `factor`: The amount to modify the node’s alpha value
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(fadeAlphaBy:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn fadeAlphaBy_duration(
            factor: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that adjusts the alpha value of a node to a new value
        ///
        /// Parameter `alpha`: The new value of the node’s alpha
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(fadeAlphaTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn fadeAlphaTo_duration(
            alpha: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        /// Creates an action that hides a node
        #[unsafe(method(hide))]
        #[unsafe(method_family = none)]
        pub unsafe fn hide() -> Retained<SKAction>;

        /// Creates an action that unhides a node
        #[unsafe(method(unhide))]
        #[unsafe(method_family = none)]
        pub unsafe fn unhide() -> Retained<SKAction>;

        #[cfg(feature = "SKTexture")]
        /// Creates an action that changes a sprite’s texture
        ///
        /// Parameter `texture`: The new texture to use on the sprite
        #[unsafe(method(setTexture:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTexture(texture: &SKTexture) -> Retained<SKAction>;

        #[cfg(feature = "SKTexture")]
        #[unsafe(method(setNormalTexture:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNormalTexture(texture: &SKTexture) -> Retained<SKAction>;

        #[cfg(feature = "SKTexture")]
        /// Creates an action that changes a sprite’s texture, possibly resizing the sprite
        ///
        /// Parameter `texture`: The new texture to use on the sprite
        ///
        /// Parameter `resize`: If YES, the sprite is resized to match the new texture.
        /// If NO, the size of the sprite is unchanged.
        #[unsafe(method(setTexture:resize:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTexture_resize(texture: &SKTexture, resize: bool) -> Retained<SKAction>;

        #[cfg(feature = "SKTexture")]
        #[unsafe(method(setNormalTexture:resize:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNormalTexture_resize(
            texture: &SKTexture,
            resize: bool,
        ) -> Retained<SKAction>;

        #[cfg(feature = "SKTexture")]
        /// Creates an action that animates changes to a sprite’s texture
        ///
        /// Parameter `textures`: An array of textures to use when animating a sprite
        ///
        /// Parameter `sec`: The amount of time that each texture is displayed
        #[unsafe(method(animateWithTextures:timePerFrame:))]
        #[unsafe(method_family = none)]
        pub unsafe fn animateWithTextures_timePerFrame(
            textures: &NSArray<SKTexture>,
            sec: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "SKTexture")]
        #[unsafe(method(animateWithNormalTextures:timePerFrame:))]
        #[unsafe(method_family = none)]
        pub unsafe fn animateWithNormalTextures_timePerFrame(
            textures: &NSArray<SKTexture>,
            sec: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "SKTexture")]
        /// Creates an action that animates changes to a sprite’s texture
        ///
        /// Parameter `textures`: An array of textures to use when animating a sprite
        ///
        /// Parameter `sec`: The amount of time that each texture is displayed
        ///
        /// Parameter `resize`: If YES, the sprite is resized to match each new texture.
        /// If NO, the size of the sprite remains at a constant size.
        ///
        /// Parameter `restore`: If YES, When the action completes, the sprite’s texture is restored
        /// to the texture it had before the action completed. (If the
        /// resize parameter is YES, the sprite is resized to match the
        /// size of the original texture.
        /// If NO, when the action completes the sprite’s texture remains
        /// set to the final texture in the array.
        #[unsafe(method(animateWithTextures:timePerFrame:resize:restore:))]
        #[unsafe(method_family = none)]
        pub unsafe fn animateWithTextures_timePerFrame_resize_restore(
            textures: &NSArray<SKTexture>,
            sec: NSTimeInterval,
            resize: bool,
            restore: bool,
        ) -> Retained<SKAction>;

        #[cfg(feature = "SKTexture")]
        #[unsafe(method(animateWithNormalTextures:timePerFrame:resize:restore:))]
        #[unsafe(method_family = none)]
        pub unsafe fn animateWithNormalTextures_timePerFrame_resize_restore(
            textures: &NSArray<SKTexture>,
            sec: NSTimeInterval,
            resize: bool,
            restore: bool,
        ) -> Retained<SKAction>;

        /// Creates an action that plays a sound
        ///
        /// Parameter `soundFile`: The name of a sound file in the app’s bundle
        ///
        /// Parameter `wait`: If YES, then the duration of this action is the same
        /// as the length of the audio playback. If NO, the action is considered
        /// to have completed immediately.
        ///
        ///
        /// The file name must be the name or path of a file of a platform
        /// supported audio file format. Use a LinearPCM format audio file with 8 or 16 bits
        /// per channel for best performance
        #[unsafe(method(playSoundFileNamed:waitForCompletion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn playSoundFileNamed_waitForCompletion(
            sound_file: &NSString,
            wait: bool,
        ) -> Retained<SKAction>;

        #[cfg(all(feature = "objc2-app-kit", feature = "objc2-core-foundation"))]
        #[cfg(target_os = "macos")]
        /// Creates an animation that animates a sprite’s color and blend factor
        ///
        /// Parameter `color`: The new color for the sprite
        ///
        /// Parameter `colorBlendFactor`: The new blend factor for the sprite
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(colorizeWithColor:colorBlendFactor:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorizeWithColor_colorBlendFactor_duration(
            color: &NSColor,
            color_blend_factor: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorizeWithColorBlendFactor:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorizeWithColorBlendFactor_duration(
            color_blend_factor: CGFloat,
            sec: NSTimeInterval,
        ) -> Retained<SKAction>;

        /// Creates an action that sets the falloff of a field
        ///
        /// Parameter `falloff`: The new value for falloff
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        ///
        /// See: SKFieldNode
        #[unsafe(method(falloffTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn falloffTo_duration(
            falloff: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        /// Creates an action that sets the falloff of a field
        ///
        /// Parameter `falloff`: The value to modify falloff by
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        ///
        /// See: SKFieldNode
        #[unsafe(method(falloffBy:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn falloffBy_duration(
            falloff: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-graphics")]
        /// Creates an action that moves the node along a relative path, orienting the
        /// node to the path
        ///
        ///
        /// Parameter `path`: A Core Graphics path whose coordinates are relative to the node’s
        /// current position
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(followPath:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn followPath_duration(
            path: &CGPath,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-graphics")]
        /// Creates an action that moves the node along a path
        ///
        ///
        /// Parameter `path`: A Core Graphics path whose coordinates are relative to the node’s
        /// current position
        ///
        /// Parameter `offset`: If YES, the points in the path are relative offsets to the
        /// node’s starting position. If NO, the points in the node are absolute
        /// coordinate values.
        ///
        /// Parameter `orient`: If YES, the node’s zRotation property animates so that
        /// the node turns to follow the path. If NO, the zRotation property of
        /// the node is unchanged.
        ///
        /// Parameter `duration`: The duration of the animation
        #[unsafe(method(followPath:asOffset:orientToPath:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn followPath_asOffset_orientToPath_duration(
            path: &CGPath,
            offset: bool,
            orient: bool,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
        /// Creates an action that moves the node along a relative path, orienting the
        /// node to the path
        ///
        ///
        /// Parameter `path`: A Core Graphics path whose coordinates are relative to the node’s
        /// current position
        ///
        /// Parameter `speed`: The speed in pixels per second to move along the path
        #[unsafe(method(followPath:speed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn followPath_speed(path: &CGPath, speed: CGFloat) -> Retained<SKAction>;

        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
        #[unsafe(method(followPath:asOffset:orientToPath:speed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn followPath_asOffset_orientToPath_speed(
            path: &CGPath,
            offset: bool,
            orient: bool,
            speed: CGFloat,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that changes how fast the node executes actions by a
        /// relative value
        ///
        /// Parameter `speed`: amount to modify the speed by
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(speedBy:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn speedBy_duration(
            speed: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Creates an action that changes how fast the node executes actions
        ///
        /// Parameter `speed`: The new value for the node’s speed
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(speedTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn speedTo_duration(
            speed: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(all(
            feature = "SKNode",
            feature = "objc2-app-kit",
            feature = "objc2-core-foundation"
        ))]
        #[cfg(target_os = "macos")]
        /// Creates an action that performs an inverse kinematic reach.
        /// This action must be run on a descendent of the rootNode for animation to occur.
        /// Running this action on the rootNode itself will not cause any animation to occur.
        ///
        /// Parameter `position`: The position (in screen space) to reach for
        ///
        /// Parameter `root`: Where to start the inverse kinematic operation from
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        #[unsafe(method(reachTo:rootNode:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn reachTo_rootNode_duration(
            position: CGPoint,
            root: &SKNode,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(all(
            feature = "SKNode",
            feature = "objc2-app-kit",
            feature = "objc2-core-foundation"
        ))]
        #[cfg(target_os = "macos")]
        /// Creates an action that performs an inverse kinematic reach.
        /// This action must be run on a descendent of the rootNode for animation to occur.
        /// Running this action on the rootNode itself will not cause any animation to occur.
        ///
        /// Parameter `position`: The position (in screen space) to reach for
        ///
        /// Parameter `root`: Where to start the inverse kinematic operation from
        ///
        /// Parameter `velocity`: The speed in points per second of the end node in the chain
        #[unsafe(method(reachTo:rootNode:velocity:))]
        #[unsafe(method_family = none)]
        pub unsafe fn reachTo_rootNode_velocity(
            position: CGPoint,
            root: &SKNode,
            velocity: CGFloat,
        ) -> Retained<SKAction>;

        #[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
        #[cfg(target_os = "macos")]
        /// Creates an action that performs an inverse kinematic reach.
        /// This action must be run on a descendent of the rootNode for animation to occur.
        /// Running this action on the rootNode itself will not cause any animation to occur.
        ///
        /// Parameter `node`: The node to reach for
        ///
        /// Parameter `root`: Where to start the inverse kinematic operation from
        ///
        /// Parameter `sec`: The duration of the animation, in seconds
        #[unsafe(method(reachToNode:rootNode:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn reachToNode_rootNode_duration(
            node: &SKNode,
            root: &SKNode,
            sec: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(all(
            feature = "SKNode",
            feature = "objc2-app-kit",
            feature = "objc2-core-foundation"
        ))]
        #[cfg(target_os = "macos")]
        /// Creates an action that performs an inverse kinematic reach.
        /// This action must be run on a descendent of the rootNode for animation to occur.
        /// Running this action on the rootNode itself will not cause any animation to occur.
        ///
        /// Parameter `node`: The node to reach for
        ///
        /// Parameter `root`: Where to start the inverse kinematic operation from
        ///
        /// Parameter `velocity`: The speed in points per second of the end node in the chain
        #[unsafe(method(reachToNode:rootNode:velocity:))]
        #[unsafe(method_family = none)]
        pub unsafe fn reachToNode_rootNode_velocity(
            node: &SKNode,
            root: &SKNode,
            velocity: CGFloat,
        ) -> Retained<SKAction>;

        /// Creates an action that sets the strength of a field
        ///
        /// Parameter `strength`: The new value for strength
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        ///
        /// See: SKFieldNode
        #[unsafe(method(strengthTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn strengthTo_duration(
            strength: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        /// Creates an action that sets the strength of a field
        ///
        /// Parameter `strength`: The value to modify strength by
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        ///
        /// See: SKFieldNode
        #[unsafe(method(strengthBy:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn strengthBy_duration(
            strength: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        /// Creates an action that idles for a specified period of time
        ///
        /// Parameter `duration`: The duration of the idle, in seconds
        #[unsafe(method(waitForDuration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn waitForDuration(duration: NSTimeInterval) -> Retained<SKAction>;

        /// Creates an action that idles for a randomized period of time
        ///
        /// Parameter `duration`: The duration of the idle, in seconds
        ///
        /// Parameter `durationRange`: The range of possible values for the duration
        #[unsafe(method(waitForDuration:withRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn waitForDuration_withRange(
            duration: NSTimeInterval,
            duration_range: NSTimeInterval,
        ) -> Retained<SKAction>;

        /// Creates an action that removes the node from its parent
        #[unsafe(method(removeFromParent))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeFromParent() -> Retained<SKAction>;

        /// Creates an action that calls a method on an object
        ///
        /// Parameter `selector`: The selector of the method to call
        ///
        /// Parameter `target`: The target object
        ///
        /// # Safety
        ///
        /// - `selector` must be a valid selector.
        /// - `target` should be of the correct type.
        #[unsafe(method(performSelector:onTarget:))]
        #[unsafe(method_family = none)]
        pub unsafe fn performSelector_onTarget(
            selector: Sel,
            target: &AnyObject,
        ) -> Retained<SKAction>;

        #[cfg(feature = "dispatch2")]
        /// Creates an action that executes a block
        ///
        /// Parameter `block`: The block to run
        ///
        /// # Safety
        ///
        /// `block` must be a valid pointer.
        #[unsafe(method(runBlock:))]
        #[unsafe(method_family = none)]
        pub unsafe fn runBlock(block: dispatch_block_t) -> Retained<SKAction>;

        #[cfg(feature = "dispatch2")]
        /// Creates an action that executes a block
        ///
        /// Parameter `block`: The block to run
        ///
        /// Parameter `queue`: The queue to perform the action on
        ///
        /// # Safety
        ///
        /// - `block` must be a valid pointer.
        /// - `queue` possibly has additional threading requirements.
        #[unsafe(method(runBlock:queue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn runBlock_queue(
            block: dispatch_block_t,
            queue: &DispatchQueue,
        ) -> Retained<SKAction>;

        /// Creates an action that runs an action on a named child object
        ///
        /// Parameter `action`: the action to run
        ///
        /// Parameter `name`: the name of a child object
        ///
        /// See: SKNode.name
        #[unsafe(method(runAction:onChildWithName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn runAction_onChildWithName(
            action: &SKAction,
            name: &NSString,
        ) -> Retained<SKAction>;

        #[cfg(all(
            feature = "SKNode",
            feature = "block2",
            feature = "objc2-app-kit",
            feature = "objc2-core-foundation"
        ))]
        #[cfg(target_os = "macos")]
        /// Creates an action that executes a block over a duration
        ///
        /// Parameter `duration`: The duration of the animation, in seconds
        ///
        /// Parameter `block`: The block to run. The block takes the following parameters:
        /// node The node on which the action is running.
        /// elapsedTime The amount of time that has passed in the animation.
        #[unsafe(method(customActionWithDuration:actionBlock:))]
        #[unsafe(method_family = none)]
        pub unsafe fn customActionWithDuration_actionBlock(
            duration: NSTimeInterval,
            block: &block2::DynBlock<dyn Fn(NonNull<SKNode>, CGFloat)>,
        ) -> Retained<SKAction>;

        /// Creates an action of the given name from an action file.
        ///
        /// Parameter `name`: The name of the action
        #[unsafe(method(actionNamed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn actionNamed(name: &NSString) -> Option<Retained<SKAction>>;

        /// Creates an action of the given name from an action file with a new duration.
        ///
        /// Parameter `name`: The name of the action
        ///
        /// Parameter `duration`: The duration of the action
        #[unsafe(method(actionNamed:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn actionNamed_duration(
            name: &NSString,
            duration: NSTimeInterval,
        ) -> Option<Retained<SKAction>>;

        /// Creates an action of the given name from an action file.
        ///
        /// Parameter `name`: The name of the action
        ///
        /// Parameter `url`: The url of the file containing the action
        #[unsafe(method(actionNamed:fromURL:))]
        #[unsafe(method_family = none)]
        pub unsafe fn actionNamed_fromURL(
            name: &NSString,
            url: &NSURL,
        ) -> Option<Retained<SKAction>>;

        /// Creates an action of the given name from an action file with a new duration.
        ///
        /// Parameter `name`: The name of the action
        ///
        /// Parameter `url`: The url of the file containing the action
        ///
        /// Parameter `duration`: The duration of the action
        #[unsafe(method(actionNamed:fromURL:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn actionNamed_fromURL_duration(
            name: &NSString,
            url: &NSURL,
            duration: NSTimeInterval,
        ) -> Option<Retained<SKAction>>;
    );
}

/// NodeWithPhysicsBody.
impl SKAction {
    extern_methods!(
        #[unsafe(method(changeChargeTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeChargeTo_duration(
            v: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[unsafe(method(changeChargeBy:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeChargeBy_duration(
            v: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[unsafe(method(changeMassTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeMassTo_duration(
            v: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[unsafe(method(changeMassBy:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeMassBy_duration(
            v: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(applyForce:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyForce_duration(
            force: CGVector,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(applyForce:atPoint:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyForce_atPoint_duration(
            force: CGVector,
            point: CGPoint,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(applyTorque:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyTorque_duration(
            torque: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(applyImpulse:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyImpulse_duration(
            impulse: CGVector,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(applyImpulse:atPoint:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyImpulse_atPoint_duration(
            impulse: CGVector,
            point: CGPoint,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(applyAngularImpulse:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyAngularImpulse_duration(
            impulse: CGFloat,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;
    );
}

/// PlaybackControl.
impl SKAction {
    extern_methods!(
        #[unsafe(method(play))]
        #[unsafe(method_family = none)]
        pub unsafe fn play() -> Retained<SKAction>;

        #[unsafe(method(pause))]
        #[unsafe(method_family = none)]
        pub unsafe fn pause() -> Retained<SKAction>;

        #[unsafe(method(stop))]
        #[unsafe(method_family = none)]
        pub unsafe fn stop() -> Retained<SKAction>;

        #[unsafe(method(changePlaybackRateTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changePlaybackRateTo_duration(
            v: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[unsafe(method(changePlaybackRateBy:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changePlaybackRateBy_duration(
            v: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;
    );
}

/// MixerControl.
impl SKAction {
    extern_methods!(
        #[unsafe(method(changeVolumeTo:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeVolumeTo_duration(
            v: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;

        #[unsafe(method(changeVolumeBy:duration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeVolumeBy_duration(
            v: c_float,
            duration: NSTimeInterval,
        ) -> Retained<SKAction>;
    );
}