Druid 1.2.0
He-he-hello! It’s a new Druid update! Not so many big changes this time, but a lot of small improvements and fixes!
The Asset Store extension is now available and contains a Druid Widget Store! There is a place where we can all share our widgets and easily install them in your projects. It’s not a dependency and these widgets will be downloaded as files, so you can easily edit and adjust them for your needs. It also reduces the risk of breaking something while updating the Druid library, since these files become a part of your project.
This new Druid Widget Store contains several widgets, like the previously included widgets (properties_panel, fps_panel, memory_panel, mini_graph). Also it contains some new widgets, like on_screen_joystick, external_image, tiling_node and others. You can inspect live example of each widget, for example on_screen_joystick
The Druid Color module is now available! It’s a module which contains various color functions and utilities, plus palette management. If you wish you can use it to convert hex colors easily and also use a nice color lerp function.
I also finally had time to go through Druid’s issues to make some fixes and improvements.
Thanks for the attention and your support!
Changelog 1.2.0
- [Widgets] Removed all included widgets from the Druid library. Now you need to install them from the Druid Asset Store extension.
- Read the migration section below to learn how to migrate to the new widgets.
- [Color]
Add Druid Color module
- Use
local color = require("druid.color")to access the module - Use
color.get_color(color_id)to get color by ID from palette, hex string, or return vector as-is. - Use
color.set_color(gui_node, color_id)to set color to the GUI node directly, not touching the alpha channel. - Use
color.lerp(t, color1, color2)to interpolate between two colors using HSB space (better visual results than RGB). - Use
color.add_palette(palette_data)to add colors to the palette. Colors can be hex strings or vector4 values. - And various conversion functions between colors.
- Palette can be loaded at init step from the JSON file by path
druid.palette_pathin yourgame.projectfile.
- Use
- [Layout] Add
layout:set_position_functionfunction, similar to the Grid component - [Scroll] Add
scroll:scroll_to_make_node_visiblefunction- This scrolls to the element so it will be visible in the scroll view. If the element is already visible, nothing will happen.
- [Blocker] Fix for internal
is_enabledstate- Before, if the blocker node was disabled at init step and then enabled later, it kept the internal
is_enabledstate as false and had to be fixed by callingblocker:set_enabled(true)to make it work. Now it’s fixed and the blocker will work as expected.
- Before, if the blocker node was disabled at init step and then enabled later, it kept the internal
- [Button] Expose all click functions for the button
- Now you can call the
button:button_click(),button:button_double_click(),button:button_long_click()etc.
- Now you can call the
- [Container] Fix for container stretch mode
stretchandfitwere not initialized correctly in theinitfunction arguments
- [Rich Text] Using color names from the palette
- [Rich Text] Add
rich_text:set_split_to_characters(true)to split each letter node separately- With this option, each letter will be a separate node, which can be useful for some animations or other effects.
- Example: Druid 1.2.0
- [Rich Text] Add
set_widthandset_heightfunctions- Example: Druid 1.2.0
- [Rich Text] Add
rich_text:set_pivotfunction to adjust the alignment of the text inside the text area. - [Slider] Add
slider:set_end_posfunction to adjust the end position of the slider - [System] Migrated to
gui.cancel_animationsinstead ofgui.cancel_animation - [Examples] Add more Rich Text examples
- [GO Widgets] Now passes events in addition to functions from the widget to the GO context
- #286 Fix style button
on_disabledcall in HTML5 button mode - #289 Multiple Input field management + fixes on web input component.
- Fix for Button
on_click_outsideevent. It should now always be triggered on user click. Before, it did not always trigger when input was consumed by some other component.
- Fix for Button
- #291 Add
on_initfor button and input style callback- Using this style callback, you can add additional fields which can be used in other style callbacks for more flexibility.
- #297 Rich input hover animation fix for
rich_input:select()function. - #316 Button
on_hold_callbackcan now be used withouton_long_clickcallback- Before, the hold callback was required to be used with
on_long_clickcallback. Now it’s not required and can be used alone. - If hold_callback exists, the user can press and hold the button to trigger the hold callback.
- The button’s usual callback will not be triggered in this case.
- If both
on_long_clickandon_hold_callbackcallbacks exist, the user can press and hold the button to trigger the hold callback until the long click callback is triggered (time is adjusted byAUTOHOLD_TRIGGERstyle parameter).
- Before, the hold callback was required to be used with
- #320 Set inherit alpha for rich text images to true by default
- #329 Allow numeric characters in RichText tags
- #333 Add settings to enable/disable Editor Scripts for the Druid
- #335 Add slider default steps into slider’s style
Druid Widget Store
All Druid widgets were moved from the Druid library to the Druid Asset Store extension.
Several more widgets were also added to the Asset Store extension. Check it out!
Migration
If you are using the properties_panel, fps_panel, memory_panel, mini_graph widgets, you need to migrate to the Druid Asset Store extension.
To do that you should open the Asset Store extension and install them. After that you need to update GUI paths and require paths from druid.widget.* to widget.*
A big thanks to my Github supporters:
And all my other supporters! Much appreciated!
Support ![]()
Please support me if you like this project! It will help me keep engaged to update Druid and make it even better!
