-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHANGELOG-CURR.txt
1327 lines (1196 loc) · 66.8 KB
/
CHANGELOG-CURR.txt
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
* 5.27
** [mRuby] [Bugfix] Incoporated fix: Array#shuffle(!) result distribution #6227
https://github.com/mruby/mruby/pull/6227
Patch info located at =./docs/oss/mruby/dragonruby-mruby-3.patch=
Congrats to levi@discord for this getting merged into mRuby!
Special thanks to Pineapple@discord for creating a minimum repro to verify fix in DR.
* 5.26
** [Pro] [iOS] Initial cut of accessibility APIs that interact with iOS's VoiceOver capabilities.
A sample app has been created showing the release candidate api.
=./samples/09_ui_controls/04_accessiblity_for_the_blind/=
These accessibility functions will be expanded to cover more platforms over time and will be
available at all License tiers.
Users on the Standard License can run this sample app which will emulate iOS VoiceOver behavior by
posting notification entries during dev mode.
Pro users can release to their device and enable VoiceOver to demo the fully integrated experience.
To use VoiceOver on your iOS device:
1. Deploy app to device.
2. Say "Hey Siri, enable voice over.".
3. Make a capital Z gesture using two fingers to dismiss Siri.
4. Swipe left or right to navigate to your app.
5. Double tap to open your app.
6. Swipe left and right to navigate within your app.
7. Double tap accessibility elements and a click event will be issued.
** [Pro] [Bugfix] Fixed letterbox background color rendering for games that have ~hd_max_scale~ set to a non-zero value.
** [Pro] [Android] AndroidManifest.xml updated to be in compliance with Google Play Pass requirements.
** [Support] Added top level function ~shutdown~ which will be invoked before your game exits.
There are four top level functions that DragonRuby will be aware of:
- ~tick~: Your game loop.
- ~boot~: Invokes once when your game starts up.
- ~reset~: Invoked before ~$gtk.reset~ occurs.
- ~shutdown~: Invoked before your game exists.
See docs API -> Runtime -> Top Level Functions documentation for detailed explanations.
** [Bugfix] ~$gtk.calcstringbox~ respects ~size_enum:~ named parameter.
* 5.25
** [Pro] [iOS] Added new collection of icons that cover new devices.
** [Pro] [Android] [Bugfix] Fixed warning message about sprites being too large for Android to load.
** [Support] Added support for ~ignore_directories~ to =game_metadata.txt= which will not be packaged during ~dragonruby-publish~.
A comma delimited list of directories that should be ignored during the
publishing process. For example, if your game supports saves, you'd want to ignore
that directory (example format: ignore_directories=tmp,saves,dev,assets).
IMPORTANT:
Any directory that matches the ignore list will be ignored (REGARDLESS OF HIERARCHY).
For example:
ignore_directories value: saves
Directory structure:
- mygame
- saves <---- This directory will be ignored
- libs
- saves <---- This directory will be ignored
ignore_directories=saves
** [Support] Controllers now have a ~name~ property that will be set when a controller is connected.
** [Support] Removed custom overrides of ~const_defined?~ and ~const_missing~ (no longer needed).
** [Support] ~Geometry::rect_navigate~ left right wrapping behavior improved.
** [Support] ~Runtime#calcstringbox~ supports ~size_px~ via a named parameter.
** [Support] Source code backups now organized under =YYYY-MM-DDDD= directories.
** [OSS] ~Runtime#platform?~, ~Runtime#platform?~, and ~Runtime#platform_mappings~ open sourced.
** [Bugfix] ~Inputs#up_down_perc~ consults WASD/has parity with ~Inputs#left_right_perc~.
* 5.24
** [Pro] [Android] Fixed IP Address retrieval for remote hotload on Window.
** [Support] ~$gtk.notify! STRING~ respects new lines and will increase height accordingly.
** [Samples] Added sample app that shows how to create a radial menu that works with mouse and controller.
Sample app location: =samples/09_ui_controls/03_radial_menu=
** [Bugfix] Reverted experimental terminal stdin/stdout for MacOS and Linux.
* 5.23
** [Pro] [Support] Improved documentation for All Screen Mode.
** [Pro] [Indie] [Shaders] A beta of ~dragonruby-shadersim~ has been released.
Login and download at dragonruby.org.
The Keeper tech demo [https://youtu.be/xEqggoZoYAo] is the main sample app that ships with DragonRuby ShaderSim.
** [Pro] [Indie] [Shaders] Documentation added for shaders API.
** [Support] Docsify version of docs can now be run locally.
You can now view the docs offline using ~./dragonruby-httpd ./docs~
** [Support] ~args.outputs.debug~ when given a String is newline aware.
#+begin_src ruby
def tick args
# two watch labels will be generated given the newline character
args.outputs.debug << "hello\nworld"
end
#+end_src
** [Support] Added ~args.outputs.debug.watch(o, label_style:, background_style:)~
~args.outputs.debug~ has a ~watch~ function which lets you pass in a non-string value
and optional ~label_style:~, and ~background_style~ named parameters.
#+begin_src ruby
def tick args
args.state.enemies ||= 10.map do |i|
{
x: rand(1280),
y: rand(720),
w: 100,
h: 100
}
end
args.outputs.debug.watch pretty_format(args.state),
label_style: { r: 0,
g: 0,
b: 255,
size_px: 10 },
background_style: { r: 0,
g: 255,
b: 0,
a: 128,
path: :solid }
end
#+end_src
** [Support] Replay captures textinput events.
Recordings created via ~$recording.start_recording~ or via the
DragonRuby Console's "Record Gameplay" button now populate ~args.inputs.text~.
** [Support] Ctrl+R will stop a replay that is currently running.
** [Support] ~$gtk.reset_and_replay~ now takes in an optional implicit block.
The implicit block can be used to provide debug information during a replay execution.
#+begin_src ruby
def tick args
args.state.player ||= {
x: 100,
y: 100
}
if args.inputs.keyboard.key_down.space
args.state.player.x += 1
args.gtk.notify! "space pressed!"
end
end
# implicit block is called after tick is completed.
$gtk.reset_and_replay "replay.txt", speed: 1 do |args|
if args.state.player.x != 100
puts args.state.player.x
end
end
#+end_src
** [Bugfix] Warning for sprites greater than 1600x1600 correctly prints sprite path.
* 5.22
** [Support] [Pro] ~$wizards.ios.start~ sends build output immediately to standard out.
** [Support] Added ~Geometry::rect_navigate~ to support the navigation of menus using the keyboard/dpad.
Sample app demonstrating menu navigation added at =./samples/09_ui_controls/02_menu_navigation=.
** [Support] ~Geometry::center~ supports rects and lines.
~Geometry.center~ check to for w/h properties to determine if center point
computation should occur for a rect or a line.
** [Support] Added ~args.inputs.keyboard.key_(up|down|held).directional_vector.
** [Support] SDL_SetHint(SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS, "1") enabled.
** [Support] Warnings added for render targets and sprites above 1600x1600 pixels.
Android has a hard limit 4096x4096 for textures. A warning has been added to let you know
if you are exceeding this limit. Androids max hd scaling is also capped at 1800p (scale 2.5x).
Browser games opened on Android's mobile browser are also capped at 1800p with HighDPI disabled
to prevent skewing of aspect ratios.
** [Support] Warning is presented if ~:[]~ is invoked on an Entity, use ~.~ accessor instead.
** [Support] ~$gtk.delete_file~ checks to see if file exists before attempting to delete it.
** [Support] Docs migrated to use Docsify.
=./docs= directory contains markdown files. One page version of docs moved to =./docs/static=.
Special thanks to Redspark@discord and f_3r@discord for providing a Docsify proof of concept.
** [Bugfix] [mRuby] Fixed bug in Enumerable gems.
Exception would be raised for some functions on classes that override ~==~. Patch information
is located at =./docs/oss/mruby/dragonruby-mruby-2.patch=
Special thanks to jujule@discord, kfischer_okarin@discord, and levi@discord for troubleshooting
and finding a fix to mRuby gems.
** [Bugfix] ~Ctrl+R~ to reset game works even if Console is open.
** [Bugfix] ~args.inputs.last_active~ set to ~:mouse~ if touch event occurs.
** [Bugfix] ~args.inputs.(left_right|up_down) checks key_down states instead of key_up states.
** [Bugfix] Added ~args.inputs.up_down_directional_perc~ to compliment ~left_down_directional_perc~.
~left_down_directional_perc~ was flattered by the compliment.
* 5.21
** [Support] ~args.grid~ and ~args.layout~ can be accessed as a singleton via class functions.
Instead of calling ~$args.layout.rect~ or ~$args.grid.w~, you can now do ~Layout::rect~ or
~Grid::w~. Top level class functions forward to ~$args~. This is an initial cut and
all functions may not be forwarded.
** [Support] ~args.gtk~ functions can be accessed as a singleton via class functions.
Instead of calling ~$gtk.reset~, you can now do ~GTK::reset~. Top level class
functions forward to ~$gtk~. This is an initial cut and all functions may not be forwarded.
** [Support] Initial work for ~args.events.raw~
Property is an array of hashes ray representing all events from SDL occurred during a tick.
Mapping of all event types is pending. This is primarily used for debugging/observing what
could potential be codified into args.inputs.
** [Bugfix] Fixed exception when hotloading a file which includes a call ~$gtk.reset~.
Thanks to akzidenz@discord for reporting this issue.
** [Support] Better descriptions in ~$gtk.benchmark~ plus ~duration~ override.
~$gtk.benchmark~ now supports either passing in ~interations:~ or
~durations:~ in seconds. If ~iterations~ is passed in then the
winner is decided based on time to complete target iterations. If
~duration~ is passed in then winner is determined based on number
of iterations completed within the ~duration~ provided.
* 5.20
** [Bugfix] Fixed scenario where audio synchronization could throw an unhandled exception.
** [Support] DragonRuby version is logged to the console on startup.
* 5.19
** [Pro] [Bugfix] [iOS] [Android] Remote hotload fixed.
** [Support] Added ~args.inputs.keyboard.key_(down|held|up).keycodes~.
The ~keycodes~ attribute returns a ~Hash~ where the key is the SDL keycode and the value is the
~tick_count~. This contains all keycodes providing you access even if we don't have a named attribute.
For a list of all keycodes, see: https://wiki.libsdl.org/SDL2/SDLKeycodeLookup
** [Support] Added ~args.inputs.keyboard.key_(down|held|up).ac_back~
The ~ac_back~ key represents the "Application Control Back Button" on Android Devices.
** [Support] Added ~args.gtk.set_window_title(string)~.
This function takes in a string updates the title of the game in the Menu Bar.
Note: The default title for your game is specified in via the ~gametitle~ property in ~mygame/metadata/game_metadata.txt~.
** [Samples] Added sample app that shows off how an alchemy game can be created.
Sample app location: =samples/99_genre_crafting/alchemy_starting_point=
** [Bugfix] Fixed clipping of sound volume for very short sound effects.
** [Bugfix] Removed divergent behavior of web builds which marked render_targets as ~transient!~ by default.
Render targets by default are cached by DragonRuby. This allows for the texture to be reconstituted
in the event a window is resized. If the render target you are creating it updated every frame, it's
important to mark the render_target as ~transient~ (you'll get a warning recommending to do this if we
detect consequtive updates to a render target).
** [Bugfix] ~args.outputs.background_color~ can accept a Hash with keys ~r~, ~g~, ~b~(, ~a~).
The ~a~ key of the hash will be ignored for the top level output.
** [Bugfix] [mRuby] Fixed arithmetic comparison errors in web builds for integers with values greater than 1 Billion.
For web builds the following returned ~true~ incorrectly:
#+begin_src
puts (1_073_741_824 < 1_000_000_000) # returned true in web builds, wtf?
#+end_src
The mRuby virtual machine was patched to fix this error.
** [OSS] Open Sourced parts of the engine are now packaged within the zip as seperate ruby files under ~./docs/oss~.
Given the number of files that have been open sourced, having a single ~./docs/oss.txt~ file was getting a bit too large.
** [OSS] Custom patches made to mRuby are now packaged within the zip under ~./docs/dragonruby-mruby.patch~.
The arithmetic bugfix that was made for web builds is included within this patch file for your reference.
* 5.18
** [Performance] Rendering sprites using hashes improved (in some cases it's 30% faster).
** [Performance] Experimental enumerable/hash apis added.
The following experimental apis have been added. While they don't have exact parity to
core lib apis, the can be up to 300% faster:
- Array::map(array) do ... end
- Array::map!(array) do ... end
- Array::each(array) do ... end
- Enumerable::find_all(enum) do ... end
- Hash::merge(h_1, h_2) do ... end
- Hash::merge!(h_1, h_2) do ... end
- Hash::find_all(h) do ... end
NOTE: These apis are class level functions (the instance level functions are left unchanged).
** [Bugfix] The default font.ttf correctly renders Cryllic characters.
A special thanks to kota@discord and funkyloverone@discord for troubleshooting and fixing the default font.
Unfortunately, this fix did increase the size to 3.1MB (which is still less than the core engine which clocks in at 4.2MB).
** [Bugfix] Exceptions are correctly reported if main.rb has exceptions on startup as opposed to presenting a blank screen.
** [Bugfix] ~Enumberable#sum~ moved to ~Array#sum~.
** [Bugfix] ~Geometry::(line|ray)_intersect~ no longer throws an exception if given parallel lines.
** [Bugfix] Sounds queued up on the same frame via ~args.audio~ and ~args.outputs.sounds~ are synchronized.
** [Support] ~$gtk.reset~ additionaly garbage collects render_targets.
NOTE: You can use ~$gtk.reset_sprite(rt_name)~ to garbage collect render_targets that you are no longer using.
* 5.17
** [Samples] Path-finding sample app added that shows a preview of a player's path around walls.
Sample app location: =samples/13_path_finding_algorithms/10_moveable_squares=
** [Samples] Bullet Heaven sample app added.
Sample app location: =samples/99_genre_arcade/bullet_heaven=
** [Support] Added Geometry#angle_turn_direction
~args.geometry.angle_turn_direction angle, target_angle~
Returns ~1~ or -1 depending on which direction the ~angle~ needs to
turn to reach the ~target_angle~ most efficiently. The angles are
assumed to be in degrees. ~1~ means turn clockwise, and ~-1~ means
turn counter-clockwise.
** [Support] Added Geometry#angle(start_point, end_point)
This is an alias to ~args.geometry.angle_to~.
** [Support] ~Numeric#frame_index~ accepts either ~count:~ or ~frame_count:~ for determining animation length.
If both are provided, ~frame_count~ will be used.
#+begin_src
def tick args
index = Numeric.frame_index start_at: 0,
frame_count: 7,
hold_for: 8,
repeat: true
args.outputs.sprites << {
x: 0,
y: 0,
w: 64,
h: 64,
source_x: 32 * index,
source_y: 0,
source_w: 32,
source_h: 32,
path: "sprites/misc/explosion-sheet.png"
}
end
#+end_src
** [Bugfix] ~Numeric#frame_index~ ~repeat_index:~ optional parameter resets correctly for animations with frames > 3.
See =samples/03_rendering_sprites/03_animation_states_2= for example usage.
* 5.16
** [Support] Increased precision of the percentage and raw values returned by controller left/right analog sticks.
** [Support] ~args.inputs.left_right~ consults WASD scancodes as opposed to keycodes.
More scancode values will be supported in the future. Docs have been updated to enumerate new scancode properties
and behavior.
** [Support] Web builds will automatically mute if the game doesn't have focus.
** [Samples] Added sample app that shows how to create a repeating texture.
Sample app location: =samples/07_advanced_rendering/02_render_targets_repeating_texture=
** [Samples] Sample apps will include preview videos over time to mirror https://samples.dragonruby.org (be sure to check out the website).
The preview videos are fairly small (trying to keep them to less than 500KB each).
** [Bugfix] Fixed the letter "S" glyph in lowrez.ttf.
** [Bugfix] Added polyfill for renamed/normalized keyboard properties for backwards compatability with keyboard libraries.
** [Bugfix] ~$gtk.set_window_scale~ invalidates font textures so they can be redrawn at the new window size.
* 5.15
** [Pro] [iOS] [Bugfix] Fixed issue where game would crash after tomb-stoned for an extended period of time.
** [Pro] [iOS] [Bugfix] Fixed remote hotloading to device when app is signed with developer provisioning profile.
** [Bugfix] Keyboard input changes are reported correctly when modifier keys are exclusively pressed, held, or released.
* 5.14
** [Pro] [iOS] Warnings added if thermal state of the device increases above "fair".
This will be expanded to support more platforms.
** [Bugfix] DR starts up correctly even if =app/main.rb= contains syntax errors.
Syntax errors will be shown in the console on startup.
** [Bugfix] Fixed placement of summary information for ~args.layout.debug_primitives~.
** [Samples] Dueling Starships sample app cleaned up.
Sample app location: =./samples/99_genre_arcade/dueling_starships=
** [Support] Warning of file names containing capital letter/spaces will not show up in production.
** [Support] Adding warnings related to Array based primitives containing nested arrays/hashes.
While DR allows for this (is helpful for quick debugging), it's expensive to flatten
these jagged data structures.
NOTE: To audit your codebase of array based primitives usage, add ~$gtk.warn_array_primitives!~
to the bottom of =app/main.rb= (outside of your ~tick~ method).
* 5.13
** [Pro] [iOS] [Bugfix] iOS remote hotload continues to query for new code updates regardless of current exceptions.
** [Pro] [Android] minSDKVersion has been dropped to API 26 with targetSDKVersion set to 31.
This change is in compliance with Google and expands the devices that can run DR games.
** [Bugfix] dragonruby-publish updated to write marker files that aren't screaming caps.
** [Bugfix] Removed unnecessary parameter from ~Geometry::line_angle~.
** [Bugfix] Intermittent re-rendering of an already rendered frame no longer occurs.
You should see a reduction of checker box render_targets (that have been defined)
and a reduction in "studders" on high refresh rate monitors.
** [Bugfix] Hash methods that have been deprecated now get reported in logs.
This also fixes an issue with using these deprecated methods with compile_ruby=true.
** [Bugfix] ~$gtk.reset_and_replay~ starts replay on the correct frame.
Replays invoked via this fucntion are no longer shifted by one frame.
** [Bugfix] Mouse grab configuration is reinitialized if a game enters or leaves fullscreen mode.
Setting mouse grab and then entering/leving fullscreen mode no longer restricts mouse
movement to the previous window size.
* 5.12
** [Pro] [Android] minSdk for Android APK exports lowered to API 30.
Lowering the minSdk for APK export ensures compatibility with
Retroid Pocket (which is a great test device).
NOTE: The Google Play export remains unchanged (minSDK 31) to ensure
compliance with game submission requirements.
** [Pro] [Bugfix] ~args.grid.offset_(x|y)~ reports correct values when your game metadata has ~hd_letterbox~ set to ~false~.
** [Samples] Bouncing ball sample app reworked/simplified.
Sample app location: =samples/04_physics_and_collisions/11_bouncing_ball_with_gravity=
** [Support] New geometry functions + docs added (extracted from bouncing ball sample app).
- Geometry::line_angle
- Geometry::vec2_dot_product
- Geometry::vec2_normalize
- Geometry::line_vec2
- Geometry::vec2_magnitude
- Geometry::distance_squared
- Geometry::vec2_normal
- Geometry::circle_intersect_line?
- Geometry::line_normal
- Geometry::point_on_line?
** [Support] args.audio.volume added.
All sounds for your game can be globally controlled via the ~args.outputs.volume~
property (float value between 0.0 and 1.0).
** [Support] CTRL+R resets game.
Pressing CTRL+R will invoke ~$gtk.reset_next_tick~ and is now baked-in (so you don't
have to code this functionality in every game).
** [Support] "Quick Watch" via ~args.outputs.debug~.
~args.outputs.debug~ allows you to pass in a ~String~ as a primitive. This is helpful for quickly showing the
value of a variable on the screen. A label with black text and a white background will be created
for each ~String~ sent in. The labels will be automatically stacked vertically for you.
Example:
#+begin_src
def tick args
args.state.player ||= { x: 100, y: 100 }
args.state.player.x += 1
args.state.player.x = 0 if args.state.player.x > 1280
# the following string values will generate labels with backgrounds
# and will auto stack vertically
args.outputs.debug << "current tick: \#{args.state.tick_count}"
args.outputs.debug << "player x: \#{args.state.player.x}"
end
#+end_src
If you want something more fully-featured, check out Palantir: https://kfischer-okarin.itch.io/palantir
** [Support] T-Pose placeholders sprites added to zip.
** [Support] Warnings added if file paths contain spaces or capital letters (xplat compatibility guarantees).
** [Support] Nintendo Switch Pro Controller mappings added/are now built-in.
** [Docs] Syntax highlighting added to code examples.
** [Bugfix] Setting your sprite path to ~:solid~ (an alias for ~:pixel~) no longer warns that it must be marked as ~transient!~.
** [Bugfix] Web builds automatically mark all render targets as ~transient!~.
Non-transient render targets causes durable caching of the texture and is needed if the
game is resized while running under DirectX. This is not needed for web builds (and may not be
needed for Mac/Linux builds, but further testing needs to be done).
* 5.11
** [Samples] Added sample app that shows how to implement a clipping of a sprite.
Sample app location: =samples/07_advanced_rendering/01_render_targets_clip_area=
** [Bugfix] Audio was not looping in web builds. This has been fixed.
** [Bugfix] ~args.inputs.keyboard.key_held.char~ has parity with ~.key_(up|down).char~.
NOTE: ~args.inputs.keyboard.key_held.char~ will only return the ascii value
of the last key that was held. Use ~args.inputs.keyboard.key_held.truthy_keys~
to get an ~Array~ of ~Symbols~ representing all keys being held.
To get a picture of all key states ~args.inputs.keyboard.keys~ returns a ~Hash~
with the following keys: ~:down~, ~:held~, ~:down_or_held~, ~:up~.
This is a demonstration of the behavior (see =./samples/02_input_basics/01_keyboard= for a more detailed example):
#+begin_src
def tick args
# uncomment the line below to see the value changes at a slower rate
# $gtk.slowmo! 30
keyboard = args.inputs.keyboard
args.outputs.labels << { x: 30,
y: 720,
text: "use the J key to test" }
args.outputs.labels << { x: 30,
y: 720 - 30,
text: "key_down.char: #{keyboard.key_down.char.inspect}" }
args.outputs.labels << { x: 30,
y: 720 - 60,
text: "key_down.j: #{keyboard.key_down.j}" }
args.outputs.labels << { x: 30,
y: 720 - 30,
text: "key_held.char: #{keyboard.key_held.char.inspect}" }
args.outputs.labels << { x: 30,
y: 720 - 60,
text: "key_held.j: #{keyboard.key_held.j}" }
args.outputs.labels << { x: 30,
y: 720 - 30,
text: "key_up.char: #{keyboard.key_up.char.inspect}" }
args.outputs.labels << { x: 30,
y: 720 - 60,
text: "key_up.j: #{keyboard.key_up.j}" }
end
#+end_src
* 5.10
** [Support] [Pro] Support added for XCode 15.0, 15.1 Beta and MacOS Sonoma.
~$wizards.ios~ enhanced to automatically install a default device if none are present.
NOTE: If you are creating C Extensions for iOS, take note that a new linker
has been released with XCode 15.0 and may require you to add the following
compilation flags for your C Extension to work: ~-Wl,-undefined -Wl,dynamic_lookup~
** [Support] Added ~$wizards.itch.help~ and ~$wizards.ios.help~.
* 5.9
** [Support] [Pro] HD scaling "stretch to fit" has been added.
There are scenarios where a dev may prefer their HD game to fill the entire screen
instead of being pixel perfect. To set your game to be scaled to fit (while still
retaining a 16:9 aspect ratio) set the following properties inside of =./metadata/game_metadata.txt=:
#+begin_src
# enables hd mode
hd=true
# render the letterbox
hd_letterbox=true
# set the scaling to "stretch to fit"
hd_max_scale=0
#+end_src
A full explanation of the hd_max_scale property is available in =./metadata/game_metadata.txt=.
** [Support] [Pro] Added support for texture atlases for games at 1.75 scale (2240x1260)
See args.grid documentation for details of this new texture atlas.
** [Bugfix] Defining a top level method called ~event~ no longer causes an exception.
** [Support] ~args.layout.rect~ and ~args.layout.debug_primitives~ documentation added.
** [Support] ~args.layout.debug_primitives~ enhanced to provide more layout information.
* 5.8
** [Bugfix] Wasm/web builds with looping audio no longer crash.
* 5.7
** [Support] Added ~Geometry::find_all_intersect_rect_quad_tree~.
Function is useful if ~Geometry::find_all_intersect_rect~ doesn't meet performance needs
and if the rectangles that are checked do not change every frame. See docs for usage example.
** [Support] Better handling of full screen mode for web builds.
** [Bugfix] [mRuby] ~Hash~ double-splat format in mRuby 3.0 changed the original Hash. This has been fixed.
Special thanks to Sophira@discord and Pineapple@discord for finding and bumping the fix of this issue.
*** Repro:
#+begin_src
hash = { }
result = { **hash, a: 1, b: 2 }
puts result # { a => 1, b => 2 }
puts hash # Wrong: { a => 1, b => 2 } mRuby <3.2 (DragonRuby <5.7)
puts hash # Right: { } mRuby 3.2 (DragonRuby 5.7)
#end_src
*** Pertinent links that describe the issue in detail:
- https://github.com/mruby/mruby/commit/12d51807a397545d5cf423d2f9bd9b52b7e4a786
- https://github.com/mruby/mruby/pull/5640#issuecomment-1032674395
*** Performance of ~Hash~ double-splat vs ~merge~ vs ~merge!~
#+begin_src
def tick args
if args.inputs.keyboard.key_down.r
args.gtk.console.show
args.gtk.benchmark iterations: 100000,
merge: -> () {
a = { x: 0, y: 0, w: 100, h: 100 }
b = { r: 255, g: 255, b: 255 }
c = { anchor_x: 0.5, anchor_y: 0.5 }
d = { path: :pixel }
e = a.merge(b).merge(c).merge(d)
},
merge_bang: -> () {
a = { x: 0, y: 0, w: 100, h: 100 }
b = { r: 255, g: 255, b: 255 }
c = { anchor_x: 0.5, anchor_y: 0.5 }
d = { path: :pixel }
e = a.merge(b).merge!(c).merge!(d)
},
splat: -> () {
a = { x: 0, y: 0, w: 100, h: 100 }
b = { r: 255, g: 255, b: 255 }
c = { anchor_x: 0.5, anchor_y: 0.5 }
d = { path: :pixel }
e = { **a, **b, **c, **d }
}
end
end
* BENCHMARK RESULT: splat is fastest
** Iterations: 100000
** Fastest: splat
** Second: merge_bang
** Margin %: merge_bang was 465% slower than splat
** Margin ms: merge_bang took 723ms longer than splat (198ms vs 921ms)
** Times:
*** splat: 198ms (0% 0ms).
*** merge_bang: 921ms (465% 723ms).
*** merge: 993ms (502% 795ms).
#+end_src
* 5.6
** [Pro] [Android] Minimum target SDK increased to API 31 to stay in compliance with Google Play App submissions.
** [Pro] [BugFix] Nested required files are correctly loaded if ~compile_ruby=true~ for the game's metadata.
Thank you to dishcandanty@discord and drewhamlett@discord for repro and testing support.
** [Performance] ~args.geometry.find_all_intersect_rect rect, rects~ is 20% faster.
** [Docs] Docs added for ~args.audio[].(x|y|z)~ usage.
** [Support] ~$gtk.platform? key~ and ~$gtk.platform_mappings~ provides more granularity across platforms.
Example:
#+begin_src
def tick args
label_style = { x: 640, y: 360, anchor_x: 0.5, anchor_y: 0.5 }
if args.gtk.platform? :macos # other options :win, :linux, :web, :android, :ios
args.outputs.labels << { text: "I am running on MacOS.", **label_style }
elsif args.gtk.platform? :touch
args.outputs.labels << { text: "I am running on a device that supports touch (either iOS/Android native or mobile web).", **label_style }
elsif args.gtk.platform? :steam
args.outputs.labels << { text: "I am running via steam (covers both desktop and steamdeck).", **label_style }
elsif args.gtk.platform? :steam_deck
args.outputs.labels << { text: "I am running via steam on the Steam Deck (not steam desktop).", **label_style }
elsif args.gtk.platform? :steam_desktop
args.outputs.labels << { text: "I am running via steam on desktop (not steam deck).", **label_style }
end
end
#+end_src
For additional details, see docs.
** [Support] ~Numeric#frame_index~ now supports allows for a ~repeat_index:~ option.
The ~repeat_index~ option is helpful if your sprite animation has start frames that shouldn't be
considered if a loop of the animation occurs.
Example:
#+begin_src
def tick args
start_looping_at = 0
sprite_index =
start_looping_at.frame_index count: 5, # sprite animation contains 2 starting frames
hold_for: 4,
repeat: true,
repeat_index: 2, # start from index 2 on repeat
tick_count_override: args.state.tick_count
sprite_index ||= 0
args.outputs.sprites << [
640 - 50,
360 - 50,
100,
100,
"sprites/dragon-\#{sprite_index}.png"
]
end
#+end_src
** [Support] Added ~args.inputs.locale~.
The function returns the ISO 639-1 two-letter language code based on OS preferences (see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
** [BugFix] ~Numeric#idiv~ returns correct values for integer division of negative numbers.
Thank you to Ceph@discord for pointing out this oversight.
** [Samples] Added sample app that shows how to use the new ~repeat_index~ parameter on ~Numeric#frame_index~.
Sample app location: =samples/03_rendering_sprites/03_animation_states_intermediate=
* 5.5
** [Bugfix] [Support] Web builds hosted on Itch.io were not working in
Safari nor Chrome on Android. We found a work around for this.
** [Samples] Added sample app that shows how to use cameras in combination with a tactical grid.
Location of sample app: =./samples/07_advanced_rendering/16_camera_space_world_space_simple_grid_map=
* 5.4
** [Bugfix] ~outputs.static_primitives~ now correctly renders labels.
* 5.3
** [Support] ~require~ statements are now processed synchronously.
** [Support] ~require_relative~ added.
** [Bugfix] ~outputs.primitives~ checks for ~draw_override~ before looking for ~primitive_marker~.
* 5.2
** [Support] [Pro] [Indie] C Extensions can be used on WASM/Web builds.
$gtk.dlopen will look for assemblies under =mygame/native/emscripten-wasm=.
See Emscripten docs for compilation steps [[https://emscripten.org/docs/getting_started/downloads.html]].
** [Samples] Added sample app that shows how to convert from screen space to world space without using matricies.
Location of sample: =./samples/07_advanced_rendering/16_camera_space_world_space_simple=
NOTE: This is a **really** good foundation for building games with a camera that pans and zooms.
** [Support] Suppress framerate warnings after a recent =$gtk.reset= or =require= of a file.
** [Bugfix] Passing nested enumerables to ~args.outputs...~ no longer causes a segfault.
* 5.1
** [Support] Added ~Inputs#last_active~.
This function returns the last active input which will be set to either ~:keyboard~,
~:mouse~, or ~:controller~. The function is helpful when you need to present on screen
instructions based on the input the player chose to play with.
Example:
#+begin_src
def tick args
if args.inputs.last_active == :controller
args.outputs.labels << { x: 60, y: 60, text: "Use the D-Pad to move around." }
else
args.outputs.labels << { x: 60, y: 60, text: "Use the arrow keys to move around." }
end
end
#+end_src
** [Support] Added ~cvars~ attribute accessor to the ~attr_gtk~ class macro.
~args.cvars~ is now accessible at the top level if you mix in ~attr_gtk~.
Example:
#+begin_src
class Game
attr_gtk
def tick
# render a label with the game version
# (no need to prefix cvars with args)
outputs.labels << {
x: 640,
y: 360,
text: args.cvars["game_metadata.version"].value.to_s
}
end
end
def tick args
$game ||= Game.new
$game.args = args
$game.tick
end
def reset
$game = nil
end
#+end_src
** [Bugfix] [Pro] [iOS] Regress in ~$wizards.ios.start env: :sim~ has been resolved.
** [OSS] [Performance] More preformant ~Numeric#map(_with_index)~ and Numeric#each(_with_index).
Performance improvements made to ~NumericHmap~ and ~Numeric#each~. Special thanks to
levi@discord for contributing this optimization.
* 5.0
** [IMPORTANT] This release has minor breaking changes. They are trivial to resolve.
Come to the DragonRuby Discord Server and we'll help you work through any issues.
[[http://discord.dragonruby.org]].
Let's start with some good news before we get into breaking changes.
** [Support] Portrait orientation enabled for all license tiers.
In ~metadata/game_metadata.txt~, you can set ~orientation=portrait~ and DragonRuby will
be presented with a logical resolution of 720x1280.
*** Limitations/Differences between license tiers.
- The Standard and Indie tier's portrait resolution is fixed to 720p (with scaling).
- You will still need a Pro license to:
- Render your game in HD and High DPI.
- Leverage auto-discovery of Texture Atlases (Pro tier supports resolutions
from 720p all the way to 4K).
- Deploy your portrait (or landscape) game to a mobile device, AppStore, or Google Play.
- Render outside of the game's safe area (All Screen Mode).
I hope the ability to prototype a portrait game encourages y'all to upgrade to Pro
so you can play the games you've built on your phone (even potentially release to the AppStore and Google Play).
Okay, now for the breaking changes (don't panic).
** [BREAKING] ~Outputs#sounds~ no longer supports looping audio. Migrate to ~Args#audio~.
If you were passing ~.ogg~ values into ~args.outputs.sounds~, they will no longer loop.
All sounds passed into this collection will play once. Example:
#+begin_src
def tick args
if args.state.tick_count == 0
# bg music will not loop after completion
# use args.audio to create a looping (see below)
args.outputs.sounds << "sounds/bg-music.ogg"
end
end
#+end_src
If you want audio to loop, use ~args.audio~:
#+begin_src
def tick args
if args.state.tick_count == 0
args.audio[:bg_music] = { input: "sounds/bg-music.ogg", looping: true }
end
end
#+end_src
A warning message will be provided by DrangonRuby if we detect this breaking change.
** [BREAKING] Property based access in ~Hash#(x|x1|y|y1)~ no longer consults ~rect~, ~point~.
The following behavior of ~Hash#(x|x1|y|y1)~ was experimental and has been removed
(it's unlikely that you even used this/knew about it).
This is the ~Hash~ behavior in 4.x:
#+begin_src
some_hash = {
rect: {
x: 0,
y: 0,
w: 100,
h: 100
}
}
puts some_hash.x # -> 0
puts some_hash.x1 # -> 0
puts some_hash.rect.x # -> 0
#+end_src
This is the ~Hash~ behavior in 5.0:
#+begin_src
some_hash = {
rect: {
x: 0,
y: 0,
w: 100,
h: 100
}
}
puts some_hash.x # -> nil
puts some_hash.x1 # -> nil
puts some_hash.rect.x # -> 0
#+end_src
Keep an eye out for null reference exceptions and check to see if
you have a nested ~Hash~ with ~rect~ or ~point~ defined.
That's it for breaking changes.
** [Pro] [iOS] Device type can now be specified when deploying to the simulator.
~$wizards.ios.start~ now supports a ~:sim_name~ argument. If you don't provide one, your
game will be deployed to an iPhone 14 Simulator. Example:
#+begin_src
# this command is run in DragonRuby's Console
$wizards.ios.start env: :sim, sim_name: "iPad Pro (12.9-inch)"
#+end_src
To get available simulators, you can run the following command in a terminal window:
#+begin_src
# run this command in a terminal window (not DragonRuby's Console)
xcrun simctl list devices
#+end_src
A thank you goes out to death.au@discord for adding this capability.
** [Performance] Performance of property based access of ~Hash~ values improved by ~30%.
Expect to see a small improvement if you use attribute accessors to access
~Hash~ values (eg ~some_hash.x~ vs ~some_hash[:x]~).
** [Support] Framerate notification made less obtrusive and can be disabled.
The FPS warning messages have been modified to not show a wall of text in the console. You
can toggle the warning message using ~$gtk.(disable|enable)_framerate_warning!~. It is enabled
by default and will provide instructions on how to disable the warning in case you forget
this method name.
** [Bugfix] Fixed segfault of http apis if an invalid URL is passed to the function.
A thank you goes out to thedarkmagi@discord for finding unique was of crashing
DragonRuby.
** [Bugfix] ~$gtk.reset_and_replay FILE_NAME, speed: SPEED~ no longer ignores the ~speed:~ parameter.
** [Bugfix] Invocation of ~$gtk.calcstringbox~ no longer crashes web builds.
** [Docs] Added more comprehensive docs for ~args.audio~ and fixed code examples for ~gtk.http_post~.
** [OSS] ~attr_gtk~ implementation uses predictable ~iVar~ names.
A number of people got tripped up in using ~attr_gtk~ because of the ~@__PROP__~ naming
convention. The naming convention has been changed to the more easily guessable ~@PROP~ format.
** [mRuby] Small performance improvements to ~mrb_obj_value~ have been made.
The function is used frequently in the virtual machine, so it was worth making a small change
to this runtime machinery.
** [Note] My sincerest condolences to anyone upset about not having a DR version number of 4.20.
* 4.19
** [Pro] [iOS] Fixed iOS wizard's simulator deployment.
** [Performance] Small performance improvement to value retrieval of ~Hash~ via ~method_missing~.
** [Docs] Docs added/refined for creating a new DR project and deploying/publishing.
** [Bugfix] Web games no longer crash on Safari.
Note: There is a bug in how Itch.io serves up the COOP COEP headers which needs to be fixed
before web games will work with Safari (opening up an issue with Itch pending).
* 4.18
** [Pro] C Extensions has access to more mRuby functions.
You now have access to ~300 mRuby functions. For usage example, see the sample located at
=samples/12_c_extensions/04_handcrafted_extension_advanced=
Let us know if there's a function you'd like added that we haven't exposed.
** [Bugfix] ~Module#purge_class~ takes into consideration the module context as opposed to ~Object~.
This function is useful if you want to reinitialize a class without functions that may have been
added via hotloading but no longer exist in source code.
** [Docs] New doc pages have been added.
- Both Docs and Samples are located at =index.(html|txt)=
- Just Docs are located at =docs.(html|txt)=
- Just Samples are located at =samples.(html|txt)=
- Open Sourced files are located at =oss.txt=
The pages above are located locally within the =./docs= directory and online at [[docs.dragonruby.org]]
Note:
This change breaks permalinks to samples. If you have them referenced anywhere, you'll need to update them. :sadpanda:
* 4.17
** [Bugfix] Fixed file persistence accross sessions for webbuilds.
** [Performance] Added caching of symbols used in C (minor performance improvement in load times).
* 4.16
** [Pro] [iOS] Http apis have been re-introduced.
Http apis have be re-enabled and use standard iOS apis as opposed
to libcurl. With this change, TestFlight builds will be accepted by
Apple.
*** IMPORTANT:
Apple requires all http requests to be over https and will not allow http
requests to unencrypted urls in production packages (they are allowed in
dev builds however).
** [Pro] [iOS] Simulator support added.
You can now run your game with hotloading directly on the simulator. From the
Console run ~$wizards.ios.start env: :sim~ to do so.
** [Performance] Web builds now use Emscripten multi-threaded capabilities.
Expect to see performance improvements for web builds with this change.
*** IMPORTANT:
Web builds now require the use of SharedArrayBuffer which will require you to
enable the ~SharedArrayBuffer~ support on Itch.io. An error message will be presented
on your game if we detect that this property has not been set correctly.
If you are self-hosting your game, your web server must include the COOP and COEP HTTP
Headers for your game to work. More info here: [[https://web.dev/coop-coep/]].
Additionally, because of these headers, you will not be able to issue HTTP requests
within a web build that are Cross Origin.
** [Support] ~Added $gtk.disable_controller_config!~
DR presents a wizard for unrecognized controllers. If you want to disable this wizard,
you can use this function to do so.
** [Performance] Label rendering performance improved.
Expect to see a performance improvement of over 100% for labels rendered as Hashes, Entities, and Classes.
** [Support] ~$gtk.reset~ also resets sprites.
If you do not want to reset sprites, you can do ~$gtk.reset include_sprites: false~
** [Support] Current DragonRuby version and changelog can be viewed at [[version.dragonruby.org]] and [[changelog.dragonruby.org]].
* 4.15
** [Bug] Removed mouse wheel debug statements.
** [Bug] Fixed regression where ~args.inputs.mouse.click~ no longer returned true for middle and right mouse buttons.
** [Support] Added ~args.inputs.keyboard.active~ and ~args.inputs.controller.active~.
This property will return true if any of keys or buttons were pressed on the frame. It's useful
for instructions contextually to which input device the player is using.
* 4.14
** [Pro] [iOS] Fixed iOS binaries so that they will be accepted by TestFlight.
We have temporarily disabled $gtk.http_* apis until we isolate what part of that machinery
is causing the binary to be rejected by TestFlight (instead of waiting for Apple to fix the bug
on their end).
** [Pro] [iOS] Fixed scaling issue for games running on the iPhone 13 mini.
** [Support] ~$gtk.platform~ returns "Steam Deck" if the game is being run on the Steam Deck.
** [Bugfix] Removed mouse wheel debug statements.
** [Docs] Added docs for deploying to a local Steam Deck.
* 4.13
** [Indie] [Pro] [Support] Beta release of Steam distribution.
~dragonruby-publish~ now supports the creation of a Steam package containing Linux, Mac, and Windows
binaries of your game. A "Deploying to Steam" section has been added to documentation (which is available
locally at http://localhost:9001 while DragonRuby is running, and online at docs.dragonruby.org).
This is a beta iteration with some rough edges. Let us know if you hit any snags and we'll improve
on what's there.
This enhancement to ~dragonruby-publish~ streamlines should prove to be a significant time
saver over creating payload using the Steamworks toolchain :-)
** [Bugfix] Pixel arrays are now fully unlocked in the Standard license tier. I swear it'll work this time.
** [Performance] Increased the polling interval between simulation ticks for web builds.
The faster interval helped top end machines, but taxed lower end machines a bit too much. Frame rates
will be more stable, but a little lower.
** [Bugfix] Mouse wheel input will now be captured during game play recording.
* 4.12
** [Bugfix] Fixed Raspberry Pi and Web Builds.
Tweetcart updates had an unintended side effect and broke Raspberry Pi and Web. Regression suites
have been put into place to make sure this doesn't happen again. We are unsure of why only those platforms
failed, but think it's a bug in mRuby's byte-code compilation (further research needed).
The Tweetcart source has been mostly reverted except for the addition of the ~pixels!~ and ~color~
method. We will work with OSS contributers to flesh out a fuller api (and get closer to finding the
mRuby bug).
* 4.11
** [Support] $args.pixel_arrays unlocked for all license tiers!
All license tiers can now use both sound synthesis and pixel arrays, woo hoo!
** [OSS] Tweetcart apis enhanced given that everyone can now use pixel arrays.
Source code for tweetcart.rb is available locally at =./docs/oss.txt= and
online at https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/blob/main/dragon/tweetcart.rb.
You can download the GitHub version by invoking the following function in the DragonRuby Console:
$gtk.download_stb_rb "dragonruby", "dragonruby-game-toolkit-contrib", "tweetcart.rb"
** [Support] A "Close Console" button is available in a production build.
It's helpful to have this button if you're running the game on a touch device w/o a keyboard.
** [Bugfix] render_targets will no longer be randomly lost on Windows+DirectX when the game window is resized.
No really. This time we definitely maybe have this resolved.
** [Performance] Performance improvements to web builds.
Invocation of ~tick~ should happen more frequently bringing web games closer to 60fps.
* 4.10
** [Samples] Added sample app that shows how to orchestrate a sequence of animations (eg cutscenes).
Sample app location: =./samples/08_tweening_lerping_easing_functions/08_cutscenes=
** [Samples] Added sample app/reference implementation for a casual arcade game.
Sample app location: =samples/99_genre_arcade/squares=
** [Samples] Added sample that show's how to create an animated button.
Sample app location: =./samples/08_tweening_lerping_easing_functions/04_pulsing_button=
** [Samples] Added sample app that shows how to do drag and drop (leverages ~$args.inputs.mouse.held~).
Sample app location: =./samples/02_input_basics/04_mouse_drag_and_drop=
** [Bugfix] dragonruby-publish ignores unrecognized files as opposed to failing (such as .DS_Store).
** [Bugfix] dragonruby-publish gives a better error message if game icons are too large.
** [Bugfix] render_targets will no longer be randomly lost on Windows+DirectX when the game window is resized.
NOTE: There was a lot of rewiring of outputs and render targets behind the scenes. Please bring up
issues on the DragonRuby Discord Server's feedback-bug-report channel: https://discord.com/channels/608064116111966245/895482347250655292
** [Support] ~args.outputs.background_color~ now accepts both colors in Hash and Array format.
** [Support] Added ~$gtk.reset_sprites "DIRECTORY"~.
Function will recursively go through the the directory provided and reset
all pngs/invalidate DR cached textures.
** [OSS] Open sourced =./runtime/async_require.rb=.
Source code is under =./docs/oss.txt=
** [Support] Added ~$gtk.download_stb_rb~ and ~$gtk.download_stb_rb_raw~.
These two functions can help facilitate the integration of external code files. OSS contributors
are encouraged to create libraries that all fit in one file (lowering the barrier to
entry for adoption).
Examples:
#+begin_src
def tick args
end
# option 1:
# source code will be downloaded from the specified GitHub url, and saved locally with a
# predefined folder convension.
$gtk.download_stb_rb "https://github.com/xenobrain/ruby_vectormath/blob/main/vectormath_2d.rb"
# option 2:
# source code will be downloaded from the specified GitHub username, repository, and file.
# code will be saved locally with a predefined folder convension.
$gtk.download_stb_rb "xenobrain", "ruby_vectormath", "vectormath_2d.rb"
# option 3:
# source code will be downloaded from a direct/raw url and saved to a direct/raw local path.
$gtk.download_stb_rb_raw "https://raw.githubusercontent.com/xenobrain/ruby_vectormath/main/vectormath_2d.rb",
"lib/xenobrain/ruby_vectionmath/vectormath_2d.rb"
#+end_src
* 4.9
** [Support] ~anchor_x~, ~anchor_y~ has been added to labels, borders, and solids.
For labels the following lines are equivalent:
#+begin_src
def tick args
args.outputs.labels << {
x: 640,
y: 360,
text: "Hello World",
alignment_enum: 1,
vertical_alignment_enum: 1
}
args.outputs.labels << {
x: 640,
y: 360,
text: "Hello World",
anchor_x: 0.5,
anchor_y: 0.5
}
end
#+end
If ~alignment~ keys and ~anchor~ keys are both provided, the ~anchor~ keys
will be given precedence (their default value is ~nil~).
Borders and solids behave like sprites (see notes about ~anchor~ attributes in 4.8 change log).
** [Support] ~args.geometry.intersect_rect?~ and ~args.geometry.inside_rect?~ respect ~anchor_x~ and ~anchor_y~.
Given the addition of the ~anchor~ properties to rect-based primitives, these geometry functions
have been updated to take the new properties into consideration when determining collision.
A special thank you to @Ceph@discord and @Dominic@dicord for making a valid case
for adding this functionality through the use of a sample app that ships with DR.
** [Support] ~$gtk.set_window_scale(float_value)~ has been added.
This is a helper method that will resize your game window to a scaled 16:9 (or 9:16 for portrait mode) aspect ratio.
The float value that is passed into the method will be floored to the closest supported scale:
0.1 (160x90), 0.25 (320p), 0.5 (540p), 0.75 (960p), 1.0 (720p), 1.25 (HD+), 1.5 (1080p), 2.0 (1440p), 2.5 (1800p), 3.0 (4k), 4.0 (5k)
Note: This method does not change the logical resolution of 1280x720 (it just resizes your game window).
** [Support] Added ~args.inputs.mouse.held~
This method compliments ~args.inputs.mouse.(click|down)~ and ~args.inputs.mouse.up~ (about damn time).
** [Samples] Animation states sample app has been updated to leverage the new ~anchor_x~, ~anchor_y~ properties.
Sample app location: =./samples/03_rendering_sprites/03_animation_states=
** [Samples] Clepto Frog sample app has been rewritten/significantly cleaned up.
The Clepto Frog platformer reference implementation has been cleaned up significantly.
The reference implementation covers the following concepts in a non-trivial way:
- Rendering a camera viewport with pan and zoom using render targets.
- Saving and loading game data from the file system.