Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Actions.cs
Go to the documentation of this file.
1using System;
3
5
6public class Actions
7{
8 public class Players
9 {
10 public interface IPlayerAction : IAnimationSegmentAction<Player>
11 {
12 }
13
15 {
16 private int _duration;
17
18 private float _opacityTarget;
19
20 private float _delay;
21
23
24 public Fade(float opacityTarget)
25 {
26 _duration = 0;
27 _opacityTarget = opacityTarget;
28 }
29
30 public Fade(float opacityTarget, int duration)
31 {
32 _duration = duration;
33 _opacityTarget = opacityTarget;
34 }
35
36 public void BindTo(Player obj)
37 {
38 }
39
40 public void SetDelay(float delay)
41 {
42 _delay = delay;
43 }
44
45 public void ApplyTo(Player obj, float localTimeForObj)
46 {
47 if (localTimeForObj < _delay)
48 {
49 return;
50 }
51 if (_duration == 0)
52 {
53 obj.opacityForAnimation = _opacityTarget;
54 return;
55 }
56 float num = localTimeForObj - _delay;
57 if (num > (float)_duration)
58 {
59 num = _duration;
60 }
61 obj.opacityForAnimation = MathHelper.Lerp(obj.opacityForAnimation, _opacityTarget, Utils.GetLerpValue(0f, _duration, num, clamped: true));
62 }
63 }
64
66 {
67 private int _duration;
68
69 private float _delay;
70
72
73 public Wait(int durationInFrames)
74 {
75 _duration = durationInFrames;
76 }
77
78 public void BindTo(Player obj)
79 {
80 }
81
82 public void ApplyTo(Player obj, float localTimeForObj)
83 {
84 if (!(localTimeForObj < _delay))
85 {
86 obj.velocity = Vector2.Zero;
87 }
88 }
89
90 public void SetDelay(float delay)
91 {
92 _delay = delay;
93 }
94 }
95
97 {
98 private int _direction;
99
100 private float _delay;
101
103
104 public LookAt(int direction)
105 {
106 _direction = direction;
107 }
108
109 public void BindTo(Player obj)
110 {
111 }
112
113 public void ApplyTo(Player obj, float localTimeForObj)
114 {
115 if (!(localTimeForObj < _delay))
116 {
117 obj.direction = _direction;
118 }
119 }
120
121 public void SetDelay(float delay)
122 {
123 _delay = delay;
124 }
125 }
126
128 {
130
132
133 private int _duration;
134
135 private float _delay;
136
138
139 public MoveWithAcceleration(Vector2 offsetPerFrame, Vector2 accelerationPerFrame, int durationInFrames)
140 {
141 _accelerationPerFrame = accelerationPerFrame;
142 _offsetPerFrame = offsetPerFrame;
143 _duration = durationInFrames;
144 }
145
146 public void BindTo(Player obj)
147 {
148 }
149
150 public void SetDelay(float delay)
151 {
152 _delay = delay;
153 }
154
155 public void ApplyTo(Player obj, float localTimeForObj)
156 {
157 if (!(localTimeForObj < _delay))
158 {
159 float num = localTimeForObj - _delay;
160 if (num > (float)_duration)
161 {
162 num = _duration;
163 }
164 Vector2 vector = _offsetPerFrame * num + _accelerationPerFrame * (num * num * 0.5f);
165 obj.position += vector;
166 obj.velocity = _offsetPerFrame + _accelerationPerFrame * num;
167 if (_offsetPerFrame.X != 0f)
168 {
169 obj.direction = ((_offsetPerFrame.X > 0f) ? 1 : (-1));
170 }
171 }
172 }
173 }
174 }
175
176 public class NPCs
177 {
178 public interface INPCAction : IAnimationSegmentAction<NPC>
179 {
180 }
181
183 {
184 private int _duration;
185
186 private int _alphaPerFrame;
187
188 private float _delay;
189
191
192 public Fade(int alphaPerFrame)
193 {
194 _duration = 0;
195 _alphaPerFrame = alphaPerFrame;
196 }
197
198 public Fade(int alphaPerFrame, int duration)
199 {
200 _duration = duration;
201 _alphaPerFrame = alphaPerFrame;
202 }
203
204 public void BindTo(NPC obj)
205 {
206 }
207
208 public void SetDelay(float delay)
209 {
210 _delay = delay;
211 }
212
213 public void ApplyTo(NPC obj, float localTimeForObj)
214 {
215 if (localTimeForObj < _delay)
216 {
217 return;
218 }
219 if (_duration == 0)
220 {
221 obj.alpha = Utils.Clamp(obj.alpha + _alphaPerFrame, 0, 255);
222 return;
223 }
224 float num = localTimeForObj - _delay;
225 if (num > (float)_duration)
226 {
227 num = _duration;
228 }
229 obj.alpha = Utils.Clamp(obj.alpha + (int)num * _alphaPerFrame, 0, 255);
230 }
231 }
232
234 {
235 private int _itemIdToShow;
236
237 private int _duration;
238
239 private float _delay;
240
242
243 public ShowItem(int durationInFrames, int itemIdToShow)
244 {
245 _duration = durationInFrames;
246 _itemIdToShow = itemIdToShow;
247 }
248
249 public void BindTo(NPC obj)
250 {
251 }
252
253 public void SetDelay(float delay)
254 {
255 _delay = delay;
256 }
257
258 public void ApplyTo(NPC obj, float localTimeForObj)
259 {
260 if (!(localTimeForObj < _delay))
261 {
262 float num = localTimeForObj - _delay;
263 if (num > (float)_duration)
264 {
266 return;
267 }
268 obj.velocity = Vector2.Zero;
269 obj.frameCounter = num;
270 obj.ai[0] = 23f;
271 obj.ai[1] = (float)_duration - num;
272 obj.ai[2] = _itemIdToShow;
273 }
274 }
275
277 {
278 if (obj.ai[0] == 23f)
279 {
280 obj.frameCounter = 0.0;
281 obj.ai[0] = 0f;
282 obj.ai[1] = 0f;
283 obj.ai[2] = 0f;
284 }
285 }
286 }
287
289 {
291
292 private int _duration;
293
294 private float _delay;
295
297
298 public Move(Vector2 offsetPerFrame, int durationInFrames)
299 {
300 _offsetPerFrame = offsetPerFrame;
301 _duration = durationInFrames;
302 }
303
304 public void BindTo(NPC obj)
305 {
306 }
307
308 public void SetDelay(float delay)
309 {
310 _delay = delay;
311 }
312
313 public void ApplyTo(NPC obj, float localTimeForObj)
314 {
315 if (!(localTimeForObj < _delay))
316 {
317 float num = localTimeForObj - _delay;
318 if (num > (float)_duration)
319 {
320 num = _duration;
321 }
322 obj.position += _offsetPerFrame * num;
323 obj.velocity = _offsetPerFrame;
324 if (_offsetPerFrame.X != 0f)
325 {
326 obj.direction = (obj.spriteDirection = ((_offsetPerFrame.X > 0f) ? 1 : (-1)));
327 }
328 }
329 }
330 }
331
333 {
335
337
338 private int _duration;
339
340 private float _delay;
341
343
344 public MoveWithAcceleration(Vector2 offsetPerFrame, Vector2 accelerationPerFrame, int durationInFrames)
345 {
346 _accelerationPerFrame = accelerationPerFrame;
347 _offsetPerFrame = offsetPerFrame;
348 _duration = durationInFrames;
349 }
350
351 public void BindTo(NPC obj)
352 {
353 }
354
355 public void SetDelay(float delay)
356 {
357 _delay = delay;
358 }
359
360 public void ApplyTo(NPC obj, float localTimeForObj)
361 {
362 if (!(localTimeForObj < _delay))
363 {
364 float num = localTimeForObj - _delay;
365 if (num > (float)_duration)
366 {
367 num = _duration;
368 }
369 Vector2 vector = _offsetPerFrame * num + _accelerationPerFrame * (num * num * 0.5f);
370 obj.position += vector;
371 obj.velocity = _offsetPerFrame + _accelerationPerFrame * num;
372 if (_offsetPerFrame.X != 0f)
373 {
374 obj.direction = (obj.spriteDirection = ((_offsetPerFrame.X > 0f) ? 1 : (-1)));
375 }
376 }
377 }
378 }
379
381 {
383
385
386 private float _radialOffset;
387
388 private int _duration;
389
390 private float _delay;
391
393
394 public MoveWithRotor(Vector2 radialOffset, float rotationPerFrame, Vector2 resultMultiplier, int durationInFrames)
395 {
396 _radialOffset = rotationPerFrame;
397 _offsetPerFrame = radialOffset;
398 _resultMultiplier = resultMultiplier;
399 _duration = durationInFrames;
400 }
401
402 public void BindTo(NPC obj)
403 {
404 }
405
406 public void SetDelay(float delay)
407 {
408 _delay = delay;
409 }
410
411 public void ApplyTo(NPC obj, float localTimeForObj)
412 {
413 if (!(localTimeForObj < _delay))
414 {
415 float num = localTimeForObj - _delay;
416 if (num > (float)_duration)
417 {
418 num = _duration;
419 }
420 Vector2 vector = _offsetPerFrame.RotatedBy(_radialOffset * num) * _resultMultiplier;
421 obj.position += vector;
422 }
423 }
424 }
425
427 {
428 private int _duration;
429
430 private float _delay;
431
433
434 public DoBunnyRestAnimation(int durationInFrames)
435 {
436 _duration = durationInFrames;
437 }
438
439 public void BindTo(NPC obj)
440 {
441 }
442
443 public void SetDelay(float delay)
444 {
445 _delay = delay;
446 }
447
448 public void ApplyTo(NPC obj, float localTimeForObj)
449 {
450 if (localTimeForObj < _delay)
451 {
452 return;
453 }
454 float num = localTimeForObj - _delay;
455 if (num > (float)_duration)
456 {
457 num = _duration;
458 }
459 Rectangle frame = obj.frame;
460 int num2 = 10;
461 int num3 = (int)num;
462 while (num3 > 4)
463 {
464 num3 -= 4;
465 num2++;
466 if (num2 > 13)
467 {
468 num2 = 13;
469 }
470 }
471 obj.ai[0] = 21f;
472 obj.ai[1] = 31f;
473 obj.frameCounter = num3;
474 obj.frame.Y = num2 * frame.Height;
475 }
476 }
477
479 {
480 private int _duration;
481
482 private float _delay;
483
485
486 public Wait(int durationInFrames)
487 {
488 _duration = durationInFrames;
489 }
490
491 public void BindTo(NPC obj)
492 {
493 }
494
495 public void ApplyTo(NPC obj, float localTimeForObj)
496 {
497 if (!(localTimeForObj < _delay))
498 {
499 obj.velocity = Vector2.Zero;
500 }
501 }
502
503 public void SetDelay(float delay)
504 {
505 _delay = delay;
506 }
507 }
508
510 {
511 private int _duration;
512
513 private float _delay;
514
516
517 public Blink(int durationInFrames)
518 {
519 _duration = durationInFrames;
520 }
521
522 public void BindTo(NPC obj)
523 {
524 }
525
526 public void ApplyTo(NPC obj, float localTimeForObj)
527 {
528 if (!(localTimeForObj < _delay))
529 {
530 obj.velocity = Vector2.Zero;
531 obj.ai[0] = 0f;
532 if (!(localTimeForObj > _delay + (float)_duration))
533 {
534 obj.ai[0] = 1001f;
535 }
536 }
537 }
538
539 public void SetDelay(float delay)
540 {
541 _delay = delay;
542 }
543 }
544
546 {
547 private int _direction;
548
549 private float _delay;
550
552
553 public LookAt(int direction)
554 {
555 _direction = direction;
556 }
557
558 public void BindTo(NPC obj)
559 {
560 }
561
562 public void ApplyTo(NPC obj, float localTimeForObj)
563 {
564 if (!(localTimeForObj < _delay))
565 {
566 obj.direction = (obj.spriteDirection = _direction);
567 }
568 }
569
570 public void SetDelay(float delay)
571 {
572 _delay = delay;
573 }
574 }
575
577 {
579
580 public void BindTo(NPC obj)
581 {
582 obj.ForcePartyHatOn = true;
583 obj.UpdateAltTexture();
584 }
585
586 public void ApplyTo(NPC obj, float localTimeForObj)
587 {
588 }
589
590 public void SetDelay(float delay)
591 {
592 }
593 }
594
596 {
597 private int _altTexture;
598
600
601 public ForceAltTexture(int altTexture)
602 {
603 _altTexture = altTexture;
604 }
605
606 public void BindTo(NPC obj)
607 {
608 obj.altTexture = _altTexture;
609 }
610
611 public void ApplyTo(NPC obj, float localTimeForObj)
612 {
613 }
614
615 public void SetDelay(float delay)
616 {
617 }
618 }
619
621 {
622 private int _variant;
623
625
626 public Variant(int variant)
627 {
628 _variant = variant;
629 }
630
631 public void BindTo(NPC obj)
632 {
633 obj.townNpcVariationIndex = _variant;
634 }
635
636 public void ApplyTo(NPC obj, float localTimeForObj)
637 {
638 }
639
640 public void SetDelay(float delay)
641 {
642 }
643 }
644
646 {
647 private int _duration;
648
649 private float _delay;
650
651 private Vector2 bumpOffset = new Vector2(-1f, 0f);
652
653 private Vector2 bumpVelocity = new Vector2(0.75f, 0f);
654
656
657 public ZombieKnockOnDoor(int durationInFrames)
658 {
659 _duration = durationInFrames;
660 }
661
662 public void BindTo(NPC obj)
663 {
664 }
665
666 public void SetDelay(float delay)
667 {
668 _delay = delay;
669 }
670
671 public void ApplyTo(NPC obj, float localTimeForObj)
672 {
673 if (!(localTimeForObj < _delay))
674 {
675 float num = localTimeForObj - _delay;
676 if (num > (float)_duration)
677 {
678 num = _duration;
679 }
680 if ((int)num % 60 / 4 <= 3)
681 {
682 obj.position += bumpOffset;
683 obj.velocity = bumpVelocity;
684 }
685 else
686 {
687 obj.position -= bumpOffset;
688 obj.velocity = Vector2.Zero;
689 }
690 }
691 }
692 }
693 }
694
695 public class Sprites
696 {
697 public interface ISpriteAction : IAnimationSegmentAction<Segments.LooseSprite>
698 {
699 }
700
701 public class Fade : ISpriteAction, IAnimationSegmentAction<Segments.LooseSprite>
702 {
703 private int _duration;
704
705 private float _opacityTarget;
706
707 private float _delay;
708
710
711 public Fade(float opacityTarget)
712 {
713 _duration = 0;
714 _opacityTarget = opacityTarget;
715 }
716
717 public Fade(float opacityTarget, int duration)
718 {
719 _duration = duration;
720 _opacityTarget = opacityTarget;
721 }
722
724 {
725 }
726
727 public void SetDelay(float delay)
728 {
729 _delay = delay;
730 }
731
732 public void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
733 {
734 if (localTimeForObj < _delay)
735 {
736 return;
737 }
738 if (_duration == 0)
739 {
740 obj.CurrentOpacity = _opacityTarget;
741 return;
742 }
743 float num = localTimeForObj - _delay;
744 if (num > (float)_duration)
745 {
746 num = _duration;
747 }
748 obj.CurrentOpacity = MathHelper.Lerp(obj.CurrentOpacity, _opacityTarget, Utils.GetLerpValue(0f, _duration, num, clamped: true));
749 }
750 }
751
752 public abstract class AScale : ISpriteAction, IAnimationSegmentAction<Segments.LooseSprite>
753 {
754 protected int Duration;
755
757
758 private float _delay;
759
761
762 public AScale(Vector2 scaleTarget)
763 {
764 Duration = 0;
765 _scaleTarget = scaleTarget;
766 }
767
768 public AScale(Vector2 scaleTarget, int duration)
769 {
770 Duration = duration;
771 _scaleTarget = scaleTarget;
772 }
773
775 {
776 }
777
778 public void SetDelay(float delay)
779 {
780 _delay = delay;
781 }
782
783 public void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
784 {
785 if (localTimeForObj < _delay)
786 {
787 return;
788 }
789 if (Duration == 0)
790 {
791 obj.CurrentDrawData.scale = _scaleTarget;
792 return;
793 }
794 float num = localTimeForObj - _delay;
795 if (num > (float)Duration)
796 {
797 num = Duration;
798 }
799 float progress = GetProgress(num);
800 obj.CurrentDrawData.scale = Vector2.Lerp(obj.CurrentDrawData.scale, _scaleTarget, progress);
801 }
802
803 protected abstract float GetProgress(float durationInFramesToApply);
804 }
805
806 public class LinearScale : AScale
807 {
808 public LinearScale(Vector2 scaleTarget)
809 : base(scaleTarget)
810 {
811 }
812
813 public LinearScale(Vector2 scaleTarget, int duration)
814 : base(scaleTarget, duration)
815 {
816 }
817
818 protected override float GetProgress(float durationInFramesToApply)
819 {
820 return Utils.GetLerpValue(0f, Duration, durationInFramesToApply, clamped: true);
821 }
822 }
823
824 public class OutCircleScale : AScale
825 {
826 public OutCircleScale(Vector2 scaleTarget)
827 : base(scaleTarget)
828 {
829 }
830
831 public OutCircleScale(Vector2 scaleTarget, int duration)
832 : base(scaleTarget, duration)
833 {
834 }
835
836 protected override float GetProgress(float durationInFramesToApply)
837 {
838 float lerpValue = Utils.GetLerpValue(0f, Duration, durationInFramesToApply, clamped: true);
839 lerpValue -= 1f;
840 return (float)Math.Sqrt(1f - lerpValue * lerpValue);
841 }
842 }
843
844 public class Wait : ISpriteAction, IAnimationSegmentAction<Segments.LooseSprite>
845 {
846 private int _duration;
847
848 private float _delay;
849
851
852 public Wait(int durationInFrames)
853 {
854 _duration = durationInFrames;
855 }
856
858 {
859 }
860
861 public void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
862 {
863 _ = _delay;
864 }
865
866 public void SetDelay(float delay)
867 {
868 _delay = delay;
869 }
870 }
871
872 public class SimulateGravity : ISpriteAction, IAnimationSegmentAction<Segments.LooseSprite>
873 {
874 private int _duration;
875
876 private float _delay;
877
879
881
882 private float _rotationPerFrame;
883
885
886 public SimulateGravity(Vector2 initialVelocity, Vector2 gravityPerFrame, float rotationPerFrame, int duration)
887 {
888 _duration = duration;
889 _initialVelocity = initialVelocity;
890 _gravityPerFrame = gravityPerFrame;
891 _rotationPerFrame = rotationPerFrame;
892 }
893
895 {
896 }
897
898 public void SetDelay(float delay)
899 {
900 _delay = delay;
901 }
902
903 public void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
904 {
905 if (!(localTimeForObj < _delay))
906 {
907 float num = localTimeForObj - _delay;
908 if (num > (float)_duration)
909 {
910 num = _duration;
911 }
912 Vector2 vector = _initialVelocity * num + _gravityPerFrame * (num * num);
913 obj.CurrentDrawData.position += vector;
914 obj.CurrentDrawData.rotation += _rotationPerFrame * num;
915 }
916 }
917 }
918
919 public class SetFrame : ISpriteAction, IAnimationSegmentAction<Segments.LooseSprite>
920 {
921 private int _targetFrameX;
922
923 private int _targetFrameY;
924
925 private int _paddingX;
926
927 private int _paddingY;
928
929 private float _delay;
930
932
933 public SetFrame(int frameX, int frameY, int paddingX = 2, int paddingY = 2)
934 {
935 _targetFrameX = frameX;
936 _targetFrameY = frameY;
937 _paddingX = paddingX;
938 _paddingY = paddingY;
939 }
940
942 {
943 }
944
945 public void SetDelay(float delay)
946 {
947 _delay = delay;
948 }
949
950 public void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
951 {
952 if (!(localTimeForObj < _delay))
953 {
954 Rectangle value = obj.CurrentDrawData.sourceRect.Value;
955 value.X = (value.Width + _paddingX) * _targetFrameX;
956 value.Y = (value.Height + _paddingY) * _targetFrameY;
957 obj.CurrentDrawData.sourceRect = value;
958 }
959 }
960 }
961
962 public class SetFrameSequence : ISpriteAction, IAnimationSegmentAction<Segments.LooseSprite>
963 {
965
966 private int _timePerFrame;
967
968 private int _paddingX;
969
970 private int _paddingY;
971
972 private float _delay;
973
974 private int _duration;
975
976 private bool _loop;
977
979
980 public SetFrameSequence(int duration, Point[] frameIndices, int timePerFrame, int paddingX = 2, int paddingY = 2)
981 : this(frameIndices, timePerFrame, paddingX, paddingY)
982 {
983 _duration = duration;
984 _loop = true;
985 }
986
987 public SetFrameSequence(Point[] frameIndices, int timePerFrame, int paddingX = 2, int paddingY = 2)
988 {
989 _frameIndices = frameIndices;
990 _timePerFrame = timePerFrame;
991 _paddingX = paddingX;
992 _paddingY = paddingY;
994 }
995
997 {
998 }
999
1000 public void SetDelay(float delay)
1001 {
1002 _delay = delay;
1003 }
1004
1005 public void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
1006 {
1007 if (localTimeForObj < _delay)
1008 {
1009 return;
1010 }
1011 Rectangle value = obj.CurrentDrawData.sourceRect.Value;
1012 int num = 0;
1013 if (_loop)
1014 {
1015 int num2 = _frameIndices.Length;
1016 num = (int)(localTimeForObj % (float)(_timePerFrame * num2)) / _timePerFrame;
1017 if (num >= num2)
1018 {
1019 num = num2 - 1;
1020 }
1021 }
1022 else
1023 {
1024 float num3 = localTimeForObj - _delay;
1025 if (num3 > (float)_duration)
1026 {
1027 num3 = _duration;
1028 }
1029 num = (int)(num3 / (float)_timePerFrame);
1030 if (num >= _frameIndices.Length)
1031 {
1032 num = _frameIndices.Length - 1;
1033 }
1034 }
1035 Point point = _frameIndices[num];
1036 value.X = (value.Width + _paddingX) * point.X;
1037 value.Y = (value.Height + _paddingY) * point.Y;
1038 obj.CurrentDrawData.sourceRect = value;
1039 }
1040 }
1041 }
1042}
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static double Sqrt(double d)
void ApplyTo(NPC obj, float localTimeForObj)
Definition Actions.cs:213
Fade(int alphaPerFrame, int duration)
Definition Actions.cs:198
void ApplyTo(NPC obj, float localTimeForObj)
Definition Actions.cs:611
void ApplyTo(NPC obj, float localTimeForObj)
Definition Actions.cs:562
MoveWithAcceleration(Vector2 offsetPerFrame, Vector2 accelerationPerFrame, int durationInFrames)
Definition Actions.cs:344
MoveWithRotor(Vector2 radialOffset, float rotationPerFrame, Vector2 resultMultiplier, int durationInFrames)
Definition Actions.cs:394
void ApplyTo(NPC obj, float localTimeForObj)
Definition Actions.cs:411
Move(Vector2 offsetPerFrame, int durationInFrames)
Definition Actions.cs:298
void ApplyTo(NPC obj, float localTimeForObj)
Definition Actions.cs:313
void ApplyTo(NPC obj, float localTimeForObj)
Definition Actions.cs:586
void ApplyTo(NPC obj, float localTimeForObj)
Definition Actions.cs:258
ShowItem(int durationInFrames, int itemIdToShow)
Definition Actions.cs:243
void ApplyTo(NPC obj, float localTimeForObj)
Definition Actions.cs:636
void ApplyTo(NPC obj, float localTimeForObj)
Definition Actions.cs:495
void ApplyTo(Player obj, float localTimeForObj)
Definition Actions.cs:45
Fade(float opacityTarget, int duration)
Definition Actions.cs:30
void ApplyTo(Player obj, float localTimeForObj)
Definition Actions.cs:113
MoveWithAcceleration(Vector2 offsetPerFrame, Vector2 accelerationPerFrame, int durationInFrames)
Definition Actions.cs:139
void ApplyTo(Player obj, float localTimeForObj)
Definition Actions.cs:82
float GetProgress(float durationInFramesToApply)
AScale(Vector2 scaleTarget, int duration)
Definition Actions.cs:768
void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
Definition Actions.cs:783
void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
Definition Actions.cs:732
Fade(float opacityTarget, int duration)
Definition Actions.cs:717
override float GetProgress(float durationInFramesToApply)
Definition Actions.cs:818
LinearScale(Vector2 scaleTarget, int duration)
Definition Actions.cs:813
override float GetProgress(float durationInFramesToApply)
Definition Actions.cs:836
SetFrameSequence(Point[] frameIndices, int timePerFrame, int paddingX=2, int paddingY=2)
Definition Actions.cs:987
void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
Definition Actions.cs:1005
SetFrameSequence(int duration, Point[] frameIndices, int timePerFrame, int paddingX=2, int paddingY=2)
Definition Actions.cs:980
void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
Definition Actions.cs:950
SetFrame(int frameX, int frameY, int paddingX=2, int paddingY=2)
Definition Actions.cs:933
SimulateGravity(Vector2 initialVelocity, Vector2 gravityPerFrame, float rotationPerFrame, int duration)
Definition Actions.cs:886
void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
Definition Actions.cs:903
void ApplyTo(Segments.LooseSprite obj, float localTimeForObj)
Definition Actions.cs:861
static float GetLerpValue(float from, float to, float t, bool clamped=false)
Definition Utils.cs:203
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
Definition Vector2.cs:227