-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.tscn
796 lines (692 loc) · 29 KB
/
main.tscn
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
[gd_scene load_steps=4 format=2]
[ext_resource path="res://main.gd" type="Script" id=1]
[ext_resource path="res://main_demobts.tres" type="ButtonGroup" id=2]
[ext_resource path="res://demos/mega/pcharbtgroup.tres" type="ButtonGroup" id=4]
[node name="main" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 1.0
margin_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="mpnl" type="Panel" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_lock_": true
}
[node name="demo_list" type="ScrollContainer" parent="mpnl"]
anchor_bottom = 1.0
margin_right = 256.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="pnl" type="Panel" parent="mpnl/demo_list"]
margin_right = 256.0
margin_bottom = 600.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="lbl_ademos" type="Label" parent="mpnl/demo_list/pnl"]
anchor_left = 0.5
anchor_right = 0.5
margin_left = -44.0
margin_right = 45.0
margin_bottom = 43.0
text = "Addon demos"
valign = 1
[node name="vbox" type="VBoxContainer" parent="mpnl/demo_list/pnl"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 25.0
margin_top = 40.0
margin_right = -25.0
margin_bottom = -51.0
custom_constants/separation = 10
__meta__ = {
"_edit_use_anchors_": false
}
[node name="bt_encdec" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_right = 206.0
margin_bottom = 20.0
toggle_mode = true
pressed = true
group = ExtResource( 2 )
text = "EncDecBuffer"
[node name="bt_quantize" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 30.0
margin_right = 206.0
margin_bottom = 50.0
toggle_mode = true
group = ExtResource( 2 )
text = "Quantize"
[node name="bt_smooth" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 60.0
margin_right = 206.0
margin_bottom = 80.0
toggle_mode = true
group = ExtResource( 2 )
text = "Smoothing"
[node name="bt_cam3d" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 90.0
margin_right = 206.0
margin_bottom = 110.0
toggle_mode = true
group = ExtResource( 2 )
text = "Cam3D"
[node name="bt_fancyle" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 120.0
margin_right = 206.0
margin_bottom = 140.0
toggle_mode = true
group = ExtResource( 2 )
text = "Fancy Line Edit"
[node name="bt_inventory" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 150.0
margin_right = 206.0
margin_bottom = 170.0
toggle_mode = true
group = ExtResource( 2 )
text = "Inventory"
[node name="bt_network" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 180.0
margin_right = 206.0
margin_bottom = 200.0
toggle_mode = true
group = ExtResource( 2 )
text = "Network"
[node name="bt_dbghelper" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 210.0
margin_right = 206.0
margin_bottom = 230.0
toggle_mode = true
group = ExtResource( 2 )
text = "Debug Helpers"
[node name="bt_audiomaster" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 240.0
margin_right = 206.0
margin_bottom = 260.0
toggle_mode = true
group = ExtResource( 2 )
text = "AudioMaster"
[node name="bt_radimpulse" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 270.0
margin_right = 206.0
margin_bottom = 290.0
toggle_mode = true
group = ExtResource( 2 )
text = "Radial Impulse"
[node name="separator" type="HSeparator" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 300.0
margin_right = 206.0
margin_bottom = 304.0
[node name="bt_megademo" type="Button" parent="mpnl/demo_list/pnl/vbox"]
margin_top = 314.0
margin_right = 206.0
margin_bottom = 334.0
toggle_mode = true
group = ExtResource( 2 )
text = "Complete"
[node name="bt_quit" type="Button" parent="mpnl/demo_list/pnl"]
anchor_top = 1.0
anchor_bottom = 1.0
margin_left = 25.0
margin_top = -34.3674
margin_right = 231.0
margin_bottom = -14.3674
text = "Quit"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="stabs" type="TabContainer" parent="mpnl"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 262.0
tabs_visible = false
__meta__ = {
"_edit_use_anchors_": false
}
[node name="encdecbuffer" type="Panel" parent="mpnl/stabs"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="bt_encdecload" type="Button" parent="mpnl/stabs/encdecbuffer"]
margin_left = 14.0
margin_top = 11.0
margin_right = 122.0
margin_bottom = 31.0
text = "Load"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="description" type="Label" parent="mpnl/stabs/encdecbuffer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 14.0
margin_top = 46.0
margin_right = -9.99994
margin_bottom = -20.0
text = "Interdependency: None
The EncDecBuffer is meant to make things easier to encode values into binary format while also stripping out the variant header, which normally means at least 4 extra bytes per property stored within the binary array (PoolByteArray).
In this demo there are two major panels. On the left a bunch of fields allow for entering the desired values to be encoded through the EncDecBuffer. Then the \"test\" button can be clicked to perform the operation. The right panel, then, contains 3 (read only) text fields with some information. One contains the decoded data, which should match the values used as input in the left panel. Another one contains the raw encoded binary data, in hexadecimal. Finally, the third field compares the various available compression methods using the encoded data and also the normal PoolByteArray with the out of the box method, var2bytes() function.
While the sole intention behind this addon was originally meant to be used by the networking system, maybe it can be useful for other things, like a \"compact\" file save for example."
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="quantize" type="Panel" parent="mpnl/stabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="bt_utilsload" type="Button" parent="mpnl/stabs/quantize"]
margin_left = 14.0
margin_top = 11.0
margin_right = 122.0
margin_bottom = 31.0
text = "Load"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="description" type="Label" parent="mpnl/stabs/quantize"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 14.0
margin_top = 46.0
margin_right = -9.99994
margin_bottom = -20.0
text = "Interdependency: None
This addon is meant to provide means to quantize floating point numbers and also use those to compress rotation quaternions using the smallest three method.
The example here does not directly use any of the floating point quantization functions, however it uses the quaternion compression to simulate replication of orientation. Basically, a cube is used to \"generate\" the original orientation, which is then compressed using either 9, 10 or 15 bits per component. Soon after the quaternion is restaured and applied into a second cube. In a way, to simulate the replication of the orientation through networked multiplayer games."
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="cam3d" type="Panel" parent="mpnl/stabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="bt_cam3dload" type="Button" parent="mpnl/stabs/cam3d"]
margin_left = 14.0
margin_top = 11.0
margin_right = 114.0
margin_bottom = 31.0
text = "Cam3D"
[node name="description" type="Label" parent="mpnl/stabs/cam3d"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 14.0
margin_top = 46.0
margin_right = -9.99994
margin_bottom = -20.0
text = "Interdependency: none
This addon is a simple node that can be attached (add scene, cam3d.tscn, instance) into a moving object. From there, selecting the new node allows for extra configuration regarding the overal behavior. While the demo uses Smooth3D addon it's not a dependency of the Cam3D.
Brief feature overview:
- Follows a moving object from a configurable distance
- Camera follow can be interpolated (specially useful if the target is smoothed with Smooth2D/Smooth3D)
- Camera Lag with SmoothStart or SmoothStop
- Camera shake using simplex noise
- Different methods to handle \"collision\" (that is, something is in between the camera and the target object)
- Camera rotation can be locked
Demo Overview:
The demo showcases a scene with a \"character\" moving in a circle and the Cam3D is directly attached to it. Two side panels are provided to allow manipulating the various settings of both the camera itself and a little bit of the movement. Notice the fact that it's also possible to change the Physics FPS in order to test the interpolated motion of the camera which, if enabled, will then use the \"character's\" smoothed visual representation, which is provided by the Smooth3D addon.
Roughly, the left panel allows for manipulating the camera state while the right panel allows for manipulating the settings of the camera. As an example, on the left panel there is a button that adds \"trauma\" (shake) to the camera, while on the right panel it's possible to configure the behavior of the shaking."
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="smooth" type="Panel" parent="mpnl/stabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="bt_smoothload" type="Button" parent="mpnl/stabs/smooth"]
margin_left = 14.0
margin_top = 11.0
margin_right = 114.0
margin_bottom = 31.0
text = "Smoothing"
[node name="description" type="Label" parent="mpnl/stabs/smooth"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 14.0
margin_top = 46.0
margin_right = -9.99994
margin_bottom = -20.0
text = "Interdependency: none
This addon is only possible thanks to the excelent contribution by Lawnjelly, which calculates the interpolation fraction (more on this shortly). Nevertheless, two nodes (Smooth2D and Smooth3D) become available once the addon is enabled from the project settings. Those nodes smoothly follow a target node (the parent of the Smooth*D). The goal here is to obtain an smooth motion when the physics simulation pace is different from the rendering pace. Think, for example, a simulation set for 60 frames per second running on a machine using a monither with faster refresh rates.
Basic usage:
Moving objects are normally based on the visual representation (sprite, mesh...) attached to a physical object (rigid body, kinematic body...). The smooth nodes will be placed \"in between\" the phyiscal and visual representation objects.
Demo Overview:
The demo contains both 2D and 3D objects, comparing the motion with and without the smooth nodes. The scene's script will, at the very beginning, enfoce a low physics update pace of only 5 ticks per second. There is a control panel that allows setting a few things as well as resetting the simulation so the various settings can be tested with different values without having to restart the demo scene.
One thing to note is how unstable the simulation is with those very low physics FPS.
Regarding the Interpolation fraction:
For some reason, manually computing this fraction from GDScript results in something that will deviate from the expected value. The major problem with this deviation is that it does lead to strange and unacceptable anomalous animations. Because of that, obtaining this value from pure GDScript would require a bunch of extra computations and, quite frankly, research and tests that would be too time consuming. So again, thanks to Lawnjelly for this conttribution!
"
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="network" type="Panel" parent="mpnl/stabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="bt_single" type="Button" parent="mpnl/stabs/network"]
margin_left = 14.0
margin_top = 11.0
margin_right = 75.0
margin_bottom = 31.0
text = "single"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="bt_create" type="Button" parent="mpnl/stabs/network"]
margin_left = 95.0
margin_top = 11.0
margin_right = 157.0
margin_bottom = 31.0
text = "create"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="bt_join" type="Button" parent="mpnl/stabs/network"]
margin_left = 122.0
margin_top = 45.1164
margin_right = 185.0
margin_bottom = 65.1164
text = "connect"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="txt_serverip" type="LineEdit" parent="mpnl/stabs/network"]
margin_left = 14.0
margin_top = 43.0
margin_right = 110.0
margin_bottom = 67.0
text = "127.0.0.1"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="description" type="Label" parent="mpnl/stabs/network"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 14.0
margin_top = 80.0
margin_right = -9.99994
margin_bottom = -2.0
text = "Network addon interdependency: EncDecBuffer
This addon requires activation through the project settings window, which will not only add a few extra settings to the first tab, it will also add the network singleton to the list (auto-load scripts, that is). To that end, if you intend to access any functionality in the network addon from another singleton script, make sure that one is loaded after the network script.
This demo is meant to be a simplistic networking example, although it does make use of a somewhat advanced feature of the networking addong, which involves using custom input data. This custom input information is necessary for interactions that involve clicking in the game world to interact with the actors. This is precisely what this example showcases.
Interating with this demo:
- Left mouse button (including drawing a rectangle) allows for unit selection
- Holding the Ctrl button maintains previously selected units when trying to select new ones.
- Right click commands selected units to the clicked location
- Middle mouse button allows for camera rotation.
- Mouse wheel zoom in/out.
- WASD move the camera around.
- F4 returns to the main menu.
Things to note:
- There is absolutely no code to keep units from colliding with each other, which can result in some really weird behavior.
- The box selection method is the most precise that I was able to find/implement, however it somewhat requires at least four 3D vectors to be sent as extra input data which basically inflates the bandwidth requirements by a lot if not careful when building the input object. In this example the client will only send the additional data when trying to \"commit the selection\" (that is, releasing the left mouse button). Because of the speed in which humans can actually repeatedly left click is not that high, it may be alright to send this burst of extra data from time to time."
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="megademo" type="Panel" parent="mpnl/stabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="lbl_playername" type="Label" parent="mpnl/stabs/megademo"]
margin_left = 14.0
margin_top = 11.0
margin_right = 55.0
margin_bottom = 35.0
text = "Name"
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="LineEdit" type="LineEdit" parent="mpnl/stabs/megademo"]
margin_left = 63.0
margin_top = 11.0
margin_right = 296.0
margin_bottom = 35.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="bt_megasingle" type="Button" parent="mpnl/stabs/megademo"]
margin_left = 347.425
margin_top = 11.0
margin_right = 427.425
margin_bottom = 31.0
text = "Single"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="bt_megacreate" type="Button" parent="mpnl/stabs/megademo"]
margin_left = 347.425
margin_top = 41.0
margin_right = 427.425
margin_bottom = 61.0
text = "Host"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="bt_megajoin" type="Button" parent="mpnl/stabs/megademo"]
margin_left = 347.425
margin_top = 71.0
margin_right = 427.425
margin_bottom = 91.0
text = "Join"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="lbl_playerchar" type="Label" parent="mpnl/stabs/megademo"]
margin_left = 14.0
margin_top = 51.0
margin_right = 110.0
margin_bottom = 65.0
text = "Character type:"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="bt_charcapsule" type="Button" parent="mpnl/stabs/megademo"]
margin_left = 14.0
margin_top = 70.0
margin_right = 95.0
margin_bottom = 90.0
toggle_mode = true
pressed = true
group = ExtResource( 4 )
text = "Capsule"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="bt_charcylinder" type="Button" parent="mpnl/stabs/megademo"]
margin_left = 114.0
margin_top = 70.0
margin_right = 195.0
margin_bottom = 90.0
toggle_mode = true
group = ExtResource( 4 )
text = "Cylinder"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="bt_charcube" type="Button" parent="mpnl/stabs/megademo"]
margin_left = 215.425
margin_top = 70.0
margin_right = 296.425
margin_bottom = 90.0
toggle_mode = true
group = ExtResource( 4 )
text = "Cuboid"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="description" type="Label" parent="mpnl/stabs/megademo"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 14.0
margin_top = 110.0
margin_right = -9.99994
margin_bottom = -26.0
text = "Demo Overview:
This demo is meant to be a \"more complete\" example, not limiting which addons are used. In away, all of the relevant addons in this pack are used in this demo.
Note that the \"character class\" buttons could also change some user interface image to preview what it looks like.
This is a \"work in progress\" example which will get new features and improvements from time to time."
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="fancyle" type="Panel" parent="mpnl/stabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="bt_fleload" type="Button" parent="mpnl/stabs/fancyle"]
margin_left = 14.0
margin_top = 11.0
margin_right = 114.0
margin_bottom = 31.0
text = "Open"
[node name="description" type="Label" parent="mpnl/stabs/fancyle"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 14.0
margin_top = 46.0
margin_right = -9.99994
margin_bottom = -20.0
text = "Interdependency: none
This is a custom UI control that implements most of the functionality of the LineEdit control, but allows rendering images as well as some basic text formatting. The idea is to use this as input for consoles and/or chat boxes.
Any different rendering (image and formatting) is based on a set of rules that must be configured during initialization. As an example, a rule can be set to convert \":)\" into an smily image.
Brief feature overview:
- Can render formatted font (bold, italic, regular, bold-italic and underlined).
- Render images within the input box.
- Images are automatically scaled in order to fit the input box and sort of match the text.
- Fully theme-able.
Demo Overview:
The demo presents a few panels, each one containing an instance of the FancyLineEdit control, initialized with a different set of rules in order to perform the rendering. There is some explanation of how each input box was configured in order to help explain what is meant to happen as well as direct a little bit on where to look at in the code.
"
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="dbghelper" type="Panel" parent="mpnl/stabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="bt_dbgload" type="Button" parent="mpnl/stabs/dbghelper"]
margin_left = 14.0
margin_top = 11.0
margin_right = 114.0
margin_bottom = 31.0
text = "Open"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="description" type="Label" parent="mpnl/stabs/dbghelper"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 14.0
margin_top = 46.0
margin_right = -9.99994
margin_bottom = -20.0
text = "Interdependency: none
This addon is meant to provide a few scripts to help the debugging process.
Brief feature overview:
- overlayinfo.gd: Quickly add text labels on screen without the need to create temporary UI controls all over the place. It also allows timed labels to be shown for the specified amount of seconds. Labels are added/removed into/from a container box that expands/shrinks according to the contents.
- line3d.gd: Means to draw lines in 3D. It also allows timed lines to be drawn for the specified amount of seconds.
Demo Overview:
Press F1 to toggle the overlayinfo script. It contains very basic information that are updated during the physics process.
Press F2 to set the alignment to the left
Press F3 to set the alignment to the center
Press F4 to set the alignment to the right
A few buttons are there to add timed labels into the list.
To test the line drawer, two spheres are in the scene, which move up and down. Timed lines are used to connect those spheres while the \"ordinary lines\" are drawn to represent the moving direction of those spheres."
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="inventory" type="Panel" parent="mpnl/stabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="bt_invdemoload" type="Button" parent="mpnl/stabs/inventory"]
margin_left = 14.0
margin_top = 11.0
margin_right = 122.0
margin_bottom = 31.0
text = "Load"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="description" type="Label" parent="mpnl/stabs/inventory"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 14.0
margin_top = 46.0
margin_right = -9.99994
margin_bottom = -20.0
text = "Interdependency: None
The inventory addon brings two major new Control widgets, InventoryBag and InventorySpecialSlot. The features provided by those two controls allow the creation of a multitude of different inventory styles. Bellow are the feature highlights:
- The inventory bag provides two properties to define amount of columns and rows of slots.
- Items can span through multiple slots.
- Special slots can be \"linked\" one to another in order to provide easier means to equip items that would use both slots, like two handed weapons for example.
- A custom drag & drop system to allow a finer control over when and how to start/end the process.
- Items can have sockets. Adding/removing an item into/from a socket can be automatically handled by the custom drag & drop system if desired.
- Saving/loading inventory bag state into/from JSON data (binary support is in the TODO).
- Inventory bag can be expanded/shrinked without affecting item placement.
- Inventory bag can auto-sort items.
- Special slots can override maximum stack sizes to create specialized storing systems, like stash tabs for example.
This demo provides a lot of use case examples, including:
- Using several special slots to work as the character equipped items.
- Stash tab which includes specialized slots for specific items.
- A search box that highlight items matching the search criteria.
- Saving and loading the inventory state.
- Randomly generating items.
- A rudimentary Item database file.
- A special slot being used to simulate a crafting system.
- Inventory bag with some disabled slots added to stylebox that results in odd shaped bag.
- Inventory bag with some disabled slots to simulate a \"buy extra slots\" feature."
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="audiomaster" type="Panel" parent="mpnl/stabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="bt_amasterload" type="Button" parent="mpnl/stabs/audiomaster"]
margin_left = 14.0
margin_top = 11.0
margin_right = 122.0
margin_bottom = 31.0
text = "Load"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="description" type="Label" parent="mpnl/stabs/audiomaster"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 14.0
margin_top = 46.0
margin_right = -9.99994
margin_bottom = -20.0
text = "The AudioMaster addon is designed to be used as a \"singleton\" (auto-load script). When this addon is activated this auto-loading is automatically added into the list. An alternative is to manually add the audiomaster.gd script into that list.
Notice that part of the setup is performed in yet another auto-load script, defined in the gamestate.gd (shared/scripts subdirectory). Please pay close attention to the order in which the scripts are loaded. The \"gamestate\" must be loaded after the AudioMaster one.
Another thing that must be noted in this project is the fact that the \"default bus layout\" has been changed within the Project Settings window (under the General > Audio category).
In this demo:
- The left panel allows some configuration over audio output volume, music playback and output device
- Top panel allows choosing which audio stream player node type will be used for SFX.
- There is an area that can be clicked, which will result in a random sound effect. If 2D or 3D SFX mode, then the attenuation will consider the \"listener\" (represented by a person) related to where the click was performed.
- An expandable panel will show a little bit of debug information regarding the AudioMaster object.
There are 3 audio tracks composed by Rafael Krux, downloaded from https://freepd.com
All other assets used in the demo (texture and sound effects) are by Kenney (https://kenney.nl).
Sound effects have been converted from OGG into WAV because 2D and 3D playback resulted in some random \"pops\" when using OGG, but didn't have any problem with WAV."
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="radimpulse" type="Panel" parent="mpnl/stabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 8.0
margin_right = -4.0
margin_bottom = -4.0
[node name="bt_demo2d" type="Button" parent="mpnl/stabs/radimpulse"]
margin_left = 14.0
margin_top = 11.0
margin_right = 122.0
margin_bottom = 31.0
text = "Impulse 2D"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="bt_demo3d" type="Button" parent="mpnl/stabs/radimpulse"]
margin_left = 142.0
margin_top = 11.0
margin_right = 250.0
margin_bottom = 31.0
text = "Impulse 3D"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="description" type="Label" parent="mpnl/stabs/radimpulse"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 8.0
margin_top = 46.0
margin_right = -8.0
margin_bottom = -8.0
text = "Interdependency: None
This addon adds two new nodes, one for 2D (RadialImpulse2D) and another for 3D (RadialImpulse3D). Once the node's \"apply_impulse()\" function is called, all rigid bodies within radius will get an impulse applied to them, in the direction away from the RadialImpulse*D's center.
How the demos (2D and 3D) work:
* Moving the mouse within the area containing the rigid bodies will move the RadialImpulse node.
* There is a \"Settings\" expandable panel that allows changing two properties of the RadialImpulse node, FallOff mode and the base impulse value to be applied in case \"apply_impulse()\" is called.
* Left clicking will trigger the \"apply_impulse()\" function of the RadialImpulse in its current position, using the settings assigned to it.
* The mouse wheel can be used to change the radius property of the RadialImpulse.
The FallOff property works like this:
* If it's set to \"CONSTANT\" (default) then the base impulse value will be the same regardless of distance from the RadialImpulse's center
* If it's set to \"LINEAR\" then the impulse decreases linearly as it gets farther away from the center until it becomes 0 at \"radius\" distance.
"
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="mpnl/demo_list/pnl/bt_quit" to="." method="_on_bt_quit_pressed"]
[connection signal="pressed" from="mpnl/stabs/encdecbuffer/bt_encdecload" to="." method="_on_bt_encdecload_pressed"]
[connection signal="pressed" from="mpnl/stabs/quantize/bt_utilsload" to="." method="_on_bt_utilsload_pressed"]
[connection signal="pressed" from="mpnl/stabs/cam3d/bt_cam3dload" to="." method="_on_bt_cam3dload_pressed"]
[connection signal="pressed" from="mpnl/stabs/smooth/bt_smoothload" to="." method="_on_bt_smoothload_pressed"]
[connection signal="pressed" from="mpnl/stabs/network/bt_single" to="." method="_on_bt_single_pressed"]
[connection signal="pressed" from="mpnl/stabs/network/bt_create" to="." method="_on_bt_create_pressed"]
[connection signal="pressed" from="mpnl/stabs/network/bt_join" to="." method="_on_bt_join_pressed"]
[connection signal="pressed" from="mpnl/stabs/megademo/bt_megasingle" to="." method="_on_megabt_single_pressed"]
[connection signal="pressed" from="mpnl/stabs/megademo/bt_megacreate" to="." method="_on_megabt_host_pressed"]
[connection signal="pressed" from="mpnl/stabs/megademo/bt_megajoin" to="." method="_on_megabt_join_pressed"]
[connection signal="pressed" from="mpnl/stabs/fancyle/bt_fleload" to="." method="_on_bt_fleload_pressed"]
[connection signal="pressed" from="mpnl/stabs/dbghelper/bt_dbgload" to="." method="_on_bt_dbgload_pressed"]
[connection signal="pressed" from="mpnl/stabs/inventory/bt_invdemoload" to="." method="_on_bt_invdemoload_pressed"]
[connection signal="pressed" from="mpnl/stabs/audiomaster/bt_amasterload" to="." method="_on_bt_amasterload_pressed"]
[connection signal="pressed" from="mpnl/stabs/radimpulse/bt_demo2d" to="." method="_on_bt_demo2d_pressed"]
[connection signal="pressed" from="mpnl/stabs/radimpulse/bt_demo3d" to="." method="_on_bt_demo3d_pressed"]