-
Notifications
You must be signed in to change notification settings - Fork 716
/
BaseObjectExtension.cpp
1139 lines (1006 loc) · 44.6 KB
/
BaseObjectExtension.cpp
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
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "AllBuiltinExtensions.h"
#include "GDCore/Project/Object.h"
#include "GDCore/Tools/Localization.h"
using namespace std;
namespace gd {
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
gd::PlatformExtension& extension) {
extension
.SetExtensionInformation("BuiltinObject",
_("Base object"),
_("Base object"),
"Florian Rival",
"Open source (MIT License)")
.SetExtensionHelpPath("/objects/base_object");
gd::ObjectMetadata& obj = extension.AddObject<gd::Object>(
"", _("Base object"), _("Base object"), "res/objeticon24.png");
#if defined(GD_IDE_ONLY)
obj.AddCondition("PosX",
_("Compare X position of an object"),
_("Compare the X position of the object."),
_("The X position of _PARAM0_ is _PARAM1__PARAM2_"),
_("Position"),
"res/conditions/position24.png",
"res/conditions/position.png")
.AddParameter("object", _("Object"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("X position"))
.MarkAsSimple()
.SetManipulatedType("number");
obj.AddAction("MettreX",
_("X position of an object"),
_("Change the X position of an object."),
_("Do _PARAM1__PARAM2_ to the X position of _PARAM0_"),
_("Position"),
"res/actions/position24.png",
"res/actions/position.png")
.AddParameter("object", _("Object"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsSimple()
.SetManipulatedType("number");
obj.AddCondition("PosY",
_("Compare Y position of an object"),
_("Compare the Y position of an object."),
_("The Y position of _PARAM0_ is _PARAM1__PARAM2_"),
_("Position"),
"res/conditions/position24.png",
"res/conditions/position.png")
.AddParameter("object", _("Object"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Y position"))
.MarkAsSimple()
.SetManipulatedType("number");
obj.AddAction("MettreY",
_("Y position of an object"),
_("Change the Y position of an object."),
_("Do _PARAM1__PARAM2_ to the Y position of _PARAM0_"),
_("Position"),
"res/actions/position24.png",
"res/actions/position.png")
.AddParameter("object", _("Object"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsSimple()
.SetManipulatedType("number");
obj.AddAction(
"MettreXY",
_("Position of an object"),
_("Change the position of an object."),
_("Do _PARAM1__PARAM2_;_PARAM3__PARAM4_ to the position of _PARAM0_"),
_("Position"),
"res/actions/position24.png",
"res/actions/position.png")
.AddParameter("object", _("Object"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("X position"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Y position"))
.MarkAsSimple();
obj.AddAction("MettreAutourPos",
_("Put an object around a position"),
_("Position the center of the given object around a position, "
"using the specified angle "
"and distance."),
_("Put _PARAM0_ around _PARAM1_;_PARAM2_, with an angle of "
"_PARAM4_ degrees and _PARAM3_ pixels distance."),
_("Position"),
"res/actions/positionAutour24.png",
"res/actions/positionAutour.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("X position"))
.AddParameter("expression", _("Y position"))
.AddParameter("expression", _("Distance"))
.AddParameter("expression", _("Angle, in degrees"))
.MarkAsAdvanced();
obj.AddAction("SetAngle",
_("Angle"),
_("Change the angle of rotation of an object."),
_("Do _PARAM1__PARAM2_ to angle of _PARAM0_"),
_("Angle"),
"res/actions/direction24.png",
"res/actions/direction.png")
.AddParameter("object", _("Object"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.SetManipulatedType("number");
obj.AddAction("Rotate",
_("Rotate"),
_("Rotate an object, clockwise if the speed is positive, "
"counterclockwise otherwise."),
_("Rotate _PARAM0_ at speed _PARAM1_deg/second"),
_("Angle"),
"res/actions/direction24.png",
"res/actions/direction.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("Angular speed (in degrees per second)"))
.AddCodeOnlyParameter("currentScene", "")
.MarkAsSimple();
obj.AddAction(
"RotateTowardAngle",
_("Rotate toward angle"),
_("Rotate an object towards an angle with the specified speed."),
_("Rotate _PARAM0_ towards _PARAM1_ at speed _PARAM2_deg/second"),
_("Angle"),
"res/actions/direction24.png",
"res/actions/direction.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("Angle to rotate towards (in degrees)"))
.AddParameter(
"expression",
_("Angular speed (in degrees per second) (0 for immediate rotation)"))
.AddCodeOnlyParameter("currentScene", "");
obj.AddAction(
"RotateTowardPosition",
_("Rotate toward position"),
_("Rotate an object towards a position, with the specified speed."),
_("Rotate _PARAM0_ towards _PARAM1_;_PARAM2_ at speed "
"_PARAM3_deg/second"),
_("Angle"),
"res/actions/direction24.png",
"res/actions/direction.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("X position"))
.AddParameter("expression", _("Y position"))
.AddParameter(
"expression",
_("Angular speed (in degrees per second) (0 for immediate rotation)"))
.AddCodeOnlyParameter("currentScene", "")
.MarkAsAdvanced();
obj.AddAction("AddForceXY",
_("Add a force"),
_("Add a force to an object. The object will move according to "
"all of the forces it has."),
_("Add to _PARAM0_ a force of _PARAM1_ p/s on X axis and "
"_PARAM2_ p/s on Y axis"),
_("Movement"),
"res/actions/force24.png",
"res/actions/force.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("Speed on X axis (in pixels per second)"))
.AddParameter("expression", _("Speed on Y axis (in pixels per second)"))
.AddParameter("expression", _("Damping (Default: 0)"));
obj.AddAction("AddForceAL",
_("Add a force (angle)"),
_("Add a force to an object. The object will move according to "
"all of the forces it has. This action creates the force "
"using the specified angle and length."),
_("Add to _PARAM0_ a force, angle: _PARAM1_ degrees and "
"length: _PARAM2_ pixels"),
_("Movement"),
"res/actions/force24.png",
"res/actions/force.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("Angle"))
.AddParameter("expression", _("Speed (in pixels per second)"))
.AddParameter("expression", _("Damping (Default: 0)"))
.MarkAsAdvanced();
obj.AddAction(
"AddForceVersPos",
_("Add a force to move toward a position"),
_("Add a force to an object to make it move toward a position."),
_("Move _PARAM0_ to _PARAM1_;_PARAM2_ with a force of _PARAM3_ "
"pixels"),
_("Movement"),
"res/actions/force24.png",
"res/actions/force.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("X position"))
.AddParameter("expression", _("Y position"))
.AddParameter("expression", _("Speed (in pixels per second)"))
.AddParameter("expression", _("Damping (Default: 0)"))
.MarkAsAdvanced();
obj.AddAction(
"AddForceTournePos",
_("Add a force to move around a position"),
_("Add a force to an object to make it rotate around a "
"position.\nNote that the movement is not precise, especially if "
"the speed is high.\nTo position an object around a position more "
"precisely, use the actions in the category \"Position\"."),
_("Rotate _PARAM0_ around _PARAM1_;_PARAM2_ at _PARAM3_ deg/sec and "
"_PARAM4_ pixels away"),
_("Movement"),
"res/actions/forceTourne24.png",
"res/actions/forceTourne.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("X position of the center"))
.AddParameter("expression", _("Y position of the center"))
.AddParameter("expression", _("Speed (in Degrees per seconds)"))
.AddParameter("expression", _("Distance (in pixels)"))
.AddParameter("expression", _("Damping (Default: 0)"))
.SetHidden();
obj.AddAction("Arreter",
_("Stop the object"),
_("Stop the object by deleting all of its forces."),
_("Stop the object _PARAM0_"),
_("Movement"),
"res/actions/arreter24.png",
"res/actions/arreter.png")
.AddParameter("object", _("Object"))
.MarkAsAdvanced();
obj.AddAction("Delete",
_("Delete an object"),
_("Delete the specified object."),
_("Delete object _PARAM0_"),
_("Objects"),
"res/actions/delete24.png",
"res/actions/delete.png")
.AddParameter("object", _("Object"))
.AddCodeOnlyParameter("currentScene", "")
.MarkAsSimple();
obj.AddAction("ChangePlan",
_("Z order"),
_("Modify the Z-order of an object"),
_("Do _PARAM1__PARAM2_ to z-Order of _PARAM0_"),
_("Z order"),
"res/actions/planicon24.png",
"res/actions/planicon.png")
.AddParameter("object", _("Object"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.SetManipulatedType("number");
obj.AddAction("ChangeLayer",
_("Layer"),
_("Move the object to a different layer."),
_("Put _PARAM0_ on the layer _PARAM1_"),
_("Layers and cameras"),
"res/actions/layer24.png",
"res/actions/layer.png")
.AddParameter("object", _("Object"))
.AddParameter("layer", _("Move it to this layer (base layer if empty)"))
.SetDefaultValue("\"\"")
.MarkAsAdvanced();
obj.AddAction("ModVarObjet",
_("Modify a variable of an object"),
_("Modify the value of a variable of an object"),
_("Do _PARAM2__PARAM3_ to variable _PARAM1_ of _PARAM0_"),
_("Variables"),
"res/actions/var24.png",
"res/actions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("objectvar", _("Variable"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.SetManipulatedType("number");
obj.AddAction(
"ModVarObjetTxt",
_("Modify the text of a variable of an object"),
_("Modify the text of a variable of an object"),
_("Do _PARAM2__PARAM3_ to the text of variable _PARAM1_ of _PARAM0_"),
_("Variables"),
"res/actions/var24.png",
"res/actions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("objectvar", _("Variable"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("string", _("Text"))
.SetManipulatedType("string");
obj.AddCondition(
"ObjectVariableChildExists",
_("Child existence"),
_("Return true if the specified child of the variable exists."),
_("Child _PARAM2_ of variable _PARAM1_ of _PARAM0_ exists"),
_("Variables/Structures"),
"res/conditions/var24.png",
"res/conditions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("objectvar", _("Variable"))
.AddParameter("string", _("Name of the child"))
.MarkAsAdvanced();
obj.AddAction("ObjectVariableRemoveChild",
_("Remove a child"),
_("Remove a child from a variable of an object."),
_("Remove child _PARAM2_ from variable _PARAM1_ of _PARAM0_"),
_("Variables/Structure"),
"res/actions/var24.png",
"res/actions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("objectvar", _("Variable"))
.AddParameter("string", _("Child's name"))
.MarkAsAdvanced();
obj.AddAction("ObjectVariableClearChildren",
_("Clear variable"),
_("Remove all the children from the object variable."),
_("Clear children from variable _PARAM1_ of _PARAM0_"),
_("Variables/Structure"),
"res/actions/var24.png",
"res/actions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("objectvar", _("Variable"))
.MarkAsAdvanced();
obj.AddAction("Cache",
_("Hide"),
_("Hide the specified object."),
_("Hide the object _PARAM0_"),
_("Visibility"),
"res/actions/visibilite24.png",
"res/actions/visibilite.png")
.AddParameter("object", _("Object"))
.MarkAsSimple();
obj.AddAction("Montre",
_("Show"),
_("Show the specified object"),
_("Show object _PARAM0_"),
_("Visibility"),
"res/actions/visibilite24.png",
"res/actions/visibilite.png")
.AddParameter("object", _("Object"))
.AddCodeOnlyParameter("inlineCode", "false")
.MarkAsSimple();
obj.AddCondition("Angle",
_("Angle"),
_("Compare the angle of the specified object."),
_("Angle of _PARAM0_ is _PARAM1__PARAM2_ deg."),
_("Angle"),
"res/conditions/direction24.png",
"res/conditions/direction.png")
.AddParameter("object", _("Object"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to compare (in degrees)"))
.MarkAsAdvanced()
.SetManipulatedType("number");
obj.AddCondition("Plan",
_("Compare Z order"),
_("Compare the Z-order of the specified object."),
_("Z Order of _PARAM0_ is _PARAM1__PARAM2_"),
_("Z order"),
"res/conditions/planicon24.png",
"res/conditions/planicon.png")
.AddParameter("object", _("Object"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Z order"))
.MarkAsAdvanced()
.SetManipulatedType("number");
obj.AddCondition("Layer",
_("Compare layer"),
_("Check if the object is on the specified layer."),
_("_PARAM0_ is on layer _PARAM1_"),
_("Layer"),
"res/conditions/layer24.png",
"res/conditions/layer.png")
.AddParameter("object", _("Object"))
.AddParameter("layer", _("Layer"))
.MarkAsAdvanced();
obj.AddCondition("Visible",
_("Visibility of an object"),
_("Check if an object is visible."),
_("The object _PARAM0_ is visible"),
_("Visibility"),
"res/conditions/visibilite24.png",
"res/conditions/visibilite.png")
.AddParameter("object", _("Object"))
.MarkAsSimple();
obj.AddCondition("Invisible",
_("Invisibility of an object"),
_("Check if an object is hidden."),
_("_PARAM0_ is hidden"),
_("Visibility"),
"res/conditions/visibilite24.png",
"res/conditions/visibilite.png")
.AddParameter("object", _("Object"))
.SetHidden(); // Inverted "Visible" condition does the same thing.
obj.AddCondition("Arret",
_("Object is stopped"),
_("Check if an object is not moving"),
_("_PARAM0_ is stopped"),
_("Movement"),
"res/conditions/arret24.png",
"res/conditions/arret.png")
.AddParameter("object", _("Object"))
.MarkAsAdvanced();
obj.AddCondition("Vitesse",
_("Speed"),
_("Compare the overall speed of an object"),
_("Overall speed of _PARAM0_ is _PARAM1__PARAM2_"),
_("Movement"),
"res/conditions/vitesse24.png",
"res/conditions/vitesse.png")
.AddParameter("object", _("Object"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Speed"))
.MarkAsAdvanced()
.SetManipulatedType("number");
obj.AddCondition("AngleOfDisplacement",
_("Angle of movement"),
_("Compare the angle of displacement of an object"),
_("Angle of displacement of _PARAM0_ is _PARAM1_ (tolerance "
": _PARAM2_ degrees)"),
_("Movement"),
"res/conditions/vitesse24.png",
"res/conditions/vitesse.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("Angle, in degrees"))
.AddParameter("expression", _("Tolerance"))
.MarkAsAdvanced();
obj.AddCondition("VarObjet",
_("Value of an object's variable"),
_("Compare the value of a variable of an object."),
_("Variable _PARAM1_ of _PARAM0_ is _PARAM2__PARAM3_"),
_("Variables"),
"res/conditions/var24.png",
"res/conditions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("objectvar", _("Variable"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Value to test"))
.SetManipulatedType("number");
obj.AddCondition(
"VarObjetTxt",
_("Text of an object's variable"),
_("Compare the text of a variable of an object."),
_("The text of variable _PARAM1_ of _PARAM0_ is _PARAM2__PARAM3_"),
_("Variables"),
"res/conditions/var24.png",
"res/conditions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("objectvar", _("Variable"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("string", _("Text to test"))
.SetManipulatedType("string");
obj.AddCondition("VarObjetDef",
_("Variable defined"),
_("Check if the variable is defined."),
_("Variable _PARAM1 of _PARAM0_ is defined"),
_("Variables"),
"res/conditions/var24.png",
"res/conditions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("string", _("Variable"))
.SetHidden();
obj.AddCondition(
"BehaviorActivated",
_("Behavior activated"),
_("Return true if the behavior is activated for the object."),
_("Behavior _PARAM1_ of _PARAM0_ is activated"),
_("Behaviors"),
"res/behavior24.png",
"res/behavior16.png")
.AddParameter("object", _("Object"))
.AddParameter("behavior", _("Behavior"))
.MarkAsAdvanced();
obj.AddAction("ActivateBehavior",
_("De/activate a behavior"),
_("De/activate the behavior for the object."),
_("Activate behavior _PARAM1_ of _PARAM0_: _PARAM2_"),
_("Behaviors"),
"res/behavior24.png",
"res/behavior16.png")
.AddParameter("object", _("Object"))
.AddParameter("behavior", _("Behavior"))
.AddParameter("yesorno", _("Activate?"))
.MarkAsAdvanced();
obj.AddAction("AddForceVers",
_("Add a force to move toward an object"),
_("Add a force to an object to make it move toward another."),
_("Move _PARAM0_ to _PARAM1_ with a force of _PARAM2_ pixels"),
_("Movement"),
"res/actions/forceVers24.png",
"res/actions/forceVers.png")
.AddParameter("object", _("Object"))
.AddParameter("objectPtr", _("Target Object"))
.AddParameter("expression", _("Speed (in pixels per second)"))
.AddParameter("expression", _("Damping (Default: 0)"))
.MarkAsAdvanced();
obj.AddAction(
"AddForceTourne",
_("Add a force to move around an object"),
_("Add a force to an object to make it rotate around another.\nNote "
"that the movement is not precise, especially if the speed is "
"high.\nTo position an object around a position more precisely, use "
"the actions in category \"Position\"."),
_("Rotate _PARAM0_ around _PARAM1_ at _PARAM2_ deg/sec and _PARAM3_ "
"pixels away"),
_("Movement"),
"res/actions/forceTourne24.png",
"res/actions/forceTourne.png")
.AddParameter("object", _("Object"))
.AddParameter("objectPtr", _("Rotate around this object"))
.AddParameter("expression", _("Speed (in degrees per second)"))
.AddParameter("expression", _("Distance (in pixels)"))
.AddParameter("expression", _("Damping (Default: 0)"))
.MarkAsAdvanced();
obj.AddAction("MettreAutour",
_("Put an object around another"),
_("Position an object around another, with the specified angle "
"and distance. The center of the objects are used for "
"positioning them."),
_("Put _PARAM0_ around _PARAM1_, with an angle of _PARAM3_ "
"degrees and _PARAM2_ pixels distance."),
_("Position"),
"res/actions/positionAutour24.png",
"res/actions/positionAutour.png")
.AddParameter("object", _("Object"))
.AddParameter("objectPtr", _("\"Center\" Object"))
.AddParameter("expression", _("Distance"))
.AddParameter("expression", _("Angle, in degrees"))
.MarkAsAdvanced();
// Deprecated action
obj.AddAction("Rebondir",
_("Move an object away from another"),
_("Move an object away from another, using forces."),
_("Move _PARAM0_ away from _PARAM1_ (only _PARAM0_ will move)"),
_("Movement"),
"res/actions/ecarter24.png",
"res/actions/ecarter.png")
.SetHidden()
.AddParameter("object", _("Object"))
.AddParameter("objectList", _("Object 2 (won't move)"));
// Deprecated action
obj.AddAction("Ecarter",
_("Move an object away from another"),
_("Move an object away from another without using forces."),
_("Move _PARAM0_ away from _PARAM2_ (only _PARAM0_ will move)"),
_("Position"),
"res/actions/ecarter24.png",
"res/actions/ecarter.png")
.SetHidden()
.AddParameter("object", _("Object"))
.AddParameter("objectList", _("Object 2 (won't move)"));
obj.AddAction("SeparateFromObjects",
_("Separate two objects"),
_("Move an object away from another using their collision "
"masks.\nBe sure to call this action on a reasonable number "
"of objects\nto avoid slowing down the game."),
_("Move _PARAM0_ away from _PARAM1_ (only _PARAM0_ will move)"),
_("Position"),
"res/actions/ecarter24.png",
"res/actions/ecarter.png")
.AddParameter("object", _("Object"))
.AddParameter("objectList", _("Objects"))
.MarkAsSimple();
obj.AddCondition("CollisionPoint",
_("Point inside object"),
_("Test if a point is inside the object collision masks."),
_("_PARAM1_;_PARAM2_ is inside _PARAM0_"),
_("Collision"),
"res/conditions/collisionPoint24.png",
"res/conditions/collisionPoint.png")
.AddParameter("object", _("Object"))
.AddParameter("expression", _("X position of the point"))
.AddParameter("expression", _("Y position of the point"))
.MarkAsSimple();
obj.AddCondition("ObjectTimer",
_("Value of a timer"),
_("Test the elapsed time of a timer."),
_("The timer _PARAM1_ of _PARAM0_ is greater than _PARAM2_ seconds"),
_("Timers"),
"res/conditions/timer24.png",
"res/conditions/timer.png")
.AddParameter("object", _("Object"))
.AddParameter("string", _("Timer's name"))
.AddParameter("expression", _("Time in seconds"));
obj.AddCondition("ObjectTimerPaused",
_("Timer paused"),
_("Test if specified timer is paused."),
_("The timer _PARAM1_ of _PARAM0_ is paused"),
_("Timers"),
"res/conditions/timerPaused24.png",
"res/conditions/timerPaused.png")
.AddParameter("object", _("Object"))
.AddParameter("string", _("Timer's name"))
.MarkAsAdvanced();
obj.AddAction("ResetObjectTimer",
_("Start (or reset) a timer"),
_("Reset the specified timer, if the timer doesn't exist "
"it's created and started."),
_("Reset the timer _PARAM1_ of _PARAM0_"),
_("Timers"),
"res/actions/timer24.png",
"res/actions/timer.png")
.AddParameter("object", _("Object"))
.AddParameter("string", _("Timer's name"));
obj.AddAction("PauseObjectTimer",
_("Pause a timer"),
_("Pause a timer."),
_("Pause timer _PARAM1_ of _PARAM0_"),
_("Timers"),
"res/actions/pauseTimer24.png",
"res/actions/pauseTimer.png")
.AddParameter("object", _("Object"))
.AddParameter("string", _("Timer's name"))
.MarkAsAdvanced();
obj.AddAction("UnPauseObjectTimer",
_("Unpause a timer"),
_("Unpause a timer."),
_("Unpause timer _PARAM1_ of _PARAM0_"),
_("Timers"),
"res/actions/unPauseTimer24.png",
"res/actions/unPauseTimer.png")
.AddParameter("object", _("Object"))
.AddParameter("string", _("Timer's name"))
.MarkAsAdvanced();
obj.AddAction("RemoveObjectTimer",
_("Delete a timer"),
_("Delete a timer from memory."),
_("Delete timer _PARAM1_ of _PARAM0_ from memory"),
_("Timers"),
"res/actions/timer24.png",
"res/actions/timer.png")
.AddParameter("object", _("Object"))
.AddParameter("string", _("Timer's name"))
.MarkAsAdvanced();
obj.AddExpression("X",
_("X position"),
_("X position of the object"),
_("Position"),
"res/actions/position.png")
.AddParameter("object", _("Object"));
obj.AddExpression("Y",
_("Y position"),
_("Y position of the object"),
_("Position"),
"res/actions/position.png")
.AddParameter("object", _("Object"));
obj.AddExpression("Angle",
_("Angle"),
_("Current angle, in degrees, of the object"),
_("Angle"),
"res/actions/direction.png")
.AddParameter("object", _("Object"));
obj.AddExpression("ForceX",
_("Average X coordinates of forces"),
_("Average X coordinates of forces"),
_("Movement"),
"res/actions/force.png")
.AddParameter("object", _("Object"));
obj.AddExpression("ForceY",
_("Average Y coordinates of forces"),
_("Average Y coordinates of forces"),
_("Movement"),
"res/actions/force.png")
.AddParameter("object", _("Object"));
obj.AddExpression("ForceAngle",
_("Average angle of the forces"),
_("Average angle of the forces"),
_("Movement"),
"res/actions/force.png")
.AddParameter("object", _("Object"));
obj.AddExpression("ForceLength",
_("Average length of the forces"),
_("Average length of the forces"),
_("Movement"),
"res/actions/force.png")
.AddParameter("object", _("Object"));
obj.AddExpression("Longueur",
_("Average length of the forces"),
_("Average length of the forces"),
_("Movement"),
"res/actions/force.png")
.AddParameter("object", _("Object"))
.SetHidden();
obj.AddExpression("Width",
_("Width"),
_("Width of the object"),
_("Size"),
"res/actions/scaleWidth.png")
.AddParameter("object", _("Object"));
obj.AddExpression("Largeur",
_("Width"),
_("Width of the object"),
_("Size"),
"res/actions/scaleWidth.png")
.AddParameter("object", _("Object"))
.SetHidden();
obj.AddExpression("Height",
_("Height"),
_("Height of the object"),
_("Size"),
"res/actions/scaleHeight.png")
.AddParameter("object", _("Object"));
obj.AddExpression("Hauteur",
_("Height"),
_("Height of the object"),
_("Size"),
"res/actions/scaleHeight.png")
.AddParameter("object", _("Object"))
.SetHidden();
obj.AddExpression("ZOrder",
_("Z order"),
_("Z order of an object"),
_("Visibility"),
"res/actions/planicon.png")
.AddParameter("object", _("Object"));
obj.AddExpression("Plan",
_("Z order"),
_("Z order of an object"),
_("Visibility"),
"res/actions/planicon.png")
.AddParameter("object", _("Object"))
.SetHidden();
obj.AddExpression("Distance",
_("Distance between two objects"),
_("Distance between two objects"),
_("Position"),
"res/conditions/distance.png")
.AddParameter("object", _("Object"))
.AddParameter("objectPtr", _("Object"));
obj.AddExpression("SqDistance",
_("Square distance between two objects"),
_("Square distance between two objects"),
_("Position"),
"res/conditions/distance.png")
.AddParameter("object", _("Object"))
.AddParameter("objectPtr", _("Object"));
obj.AddExpression("Variable",
_("Object's variable"),
_("Object's variable"),
_("Variables"),
"res/actions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("objectvar", _("Variable"));
obj.AddExpression("VariableChildCount",
_("Object's variable number of children"),
_("Get the number of children from an object"),
_("Variables"),
"res/actions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("objectvar", _("Variable"));
obj.AddStrExpression("VariableString",
_("Object's variable"),
_("Text of variable of an object"),
_("Variables"),
"res/actions/var.png")
.AddParameter("object", _("Object"))
.AddParameter("objectvar", _("Variable"));
obj.AddExpression("ObjectTimerElapsedTime",
_("Timer value"),
_("Value of a timer"),
_("Timers"),
"res/actions/time.png")
.AddParameter("object", _("Object"))
.AddParameter("string", _("Timer's name"));
extension
.AddAction("Create",
_("Create an object"),
_("Create an object at specified position"),
_("Create object _PARAM1_ at position _PARAM2_;_PARAM3_"),
_("Objects"),
"res/actions/create24.png",
"res/actions/create.png")
.AddCodeOnlyParameter("objectsContext", "")
.AddParameter("objectListWithoutPicking", _("Object to create"))
.AddParameter("expression", _("X position"))
.AddParameter("expression", _("Y position"))
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.MarkAsSimple();
extension
.AddAction("CreateByName",
_("Create an object from its name"),
_("Among the objects of the specified group, this action will "
"create the object with the specified name."),
_("Among objects _PARAM1_, create object named _PARAM2_ at "
"position _PARAM3_;_PARAM4_"),
_("Objects"),
"res/actions/create24.png",
"res/actions/create.png")
.AddCodeOnlyParameter("objectsContext", "")
.AddParameter(
"objectListWithoutPicking",
_("Groups containing objects that can be created by the action"))
.AddParameter("string",
_("Text representing the name of the object to create"))
.AddParameter("expression", _("X position"))
.AddParameter("expression", _("Y position"))
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
.SetDefaultValue("\"\"")
.MarkAsAdvanced();
extension
.AddAction("AjoutObjConcern",
_("Pick all objects"),
_("Pick all objects with this name."),
_("Pick all _PARAM1_"),
_("Objects"),
"res/actions/add24.png",
"res/actions/add.png")
.AddCodeOnlyParameter("objectsContext", "")
.AddParameter("objectList", _("Object"))
.MarkAsAdvanced();
extension
.AddAction("AjoutHasard",
_("Pick a random object"),
_("Pick only one object with this name, among all"),
_("Pick a random _PARAM1_"),
_("Objects"),
"res/actions/ajouthasard24.png",
"res/actions/ajouthasard.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectList", _("Object"))
.MarkAsSimple();
extension
.AddAction(
"MoveObjects",
_("Apply movement to all objects"),
_("Moves all objects according to the forces they have. GDevelop "
"calls this action at the end of the events by default."),
_("Apply movement to all objects"),
_("Movement"),
"res/actions/doMove24.png",
"res/actions/doMove.png")
.AddCodeOnlyParameter("currentScene", "")
.MarkAsAdvanced();
extension
.AddCondition("SeDirige",
_("An object is moving toward another"),
_("Check if an object moves toward another.\nThe first "
"object must move."),
_("_PARAM0_ is moving toward _PARAM1_"),
_("Movement"),
"res/conditions/sedirige24.png",
"res/conditions/sedirige.png")
.AddParameter("objectList", _("Object"))
.AddParameter("objectList", _("Object 2"))
.AddParameter("expression", _("Angle of tolerance"))
.AddCodeOnlyParameter("conditionInverted", "")
.MarkAsAdvanced();
extension
.AddCondition("Distance",
_("Distance between two objects"),
_("Compare the distance between two objects.\nIf condition "
"is inverted, only objects that have a distance greater "
"than specified to any other object will be picked."),
_("_PARAM0_ distance to _PARAM1_ is below _PARAM2_ pixels"),
_("Position"),
"res/conditions/distance24.png",
"res/conditions/distance.png")
.AddParameter("objectList", _("Object"))
.AddParameter("objectList", _("Object 2"))
.AddParameter("expression", _("Distance"))
.AddCodeOnlyParameter("conditionInverted", "")
.MarkAsSimple();
extension
.AddCondition("AjoutObjConcern",
_("Pick all objects"),
_("Pick all objects with this name."),
_("Pick all _PARAM1_"),
_("Objects"),
"res/conditions/add24.png",
"res/conditions/add.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectList", _("Object"))
.MarkAsAdvanced();
extension
.AddCondition("AjoutHasard",
_("Pick a random object"),
_("Pick only one object with this name, among all"),
_("Pick a random _PARAM1_"),
_("Objects"),
"res/conditions/ajouthasard24.png",
"res/conditions/ajouthasard.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectList", _("Object"))