Page 1 of 1

[posila] [0.18.12] Style.draw_shadow_under_picture has no effect on custom GUI sprite buttons

Posted: Sun Mar 15, 2020 10:51 am
by Deadlock989
The style quick_bar_slot_button, defined in core/prototypes/style.lua, has the property draw_shadow_under_picture set to true. It results in a darker gradient around the sprite button's sprite, giving it a nice contrast, consistent with how items and recipes are rendered elsewhere in the game, e.g. tooltips. You can see this style in use currently on the quickbar, and the CTRL-F6 style browser confirms that the property has been set. From the screenshots in the most recent FFF, it looks like the upcoming character GUI is also making use of this property.

shadow1.png
shadow1.png (57.54 KiB) Viewed 2113 times
shadow2.png
shadow2.png (113.32 KiB) Viewed 2113 times

However, sprite buttons in custom GUIs which are given this style (or any custom-made style which uses the property) do not seem to get the same shadow treatment, despite the style browser confirming it is set:

shadow3.png
shadow3.png (71.5 KiB) Viewed 2113 times
shadow4.png
shadow4.png (99.53 KiB) Viewed 2113 times

Re: [posila] [0.18.12] Style.draw_shadow_under_picture has no effect on custom GUI sprite buttons

Posted: Tue Mar 17, 2020 8:16 am
by posila
Should be fixed for 0.18.13.

Note: This is probably not problem for you, but just in case ... the shadow uses signed distance field sprite, that is generated for icons on startup. It is currently not possible to configure other sprites to have SDF generated, so it is not possible to have "shadow" under non-icons.

Re: [posila] [0.18.12] Style.draw_shadow_under_picture has no effect on custom GUI sprite buttons

Posted: Tue Mar 17, 2020 10:14 am
by Deadlock989
Many thanks.