diff options
author | Hugues Ross <hugues.ross@gmail.com> | 2019-10-12 12:44:23 -0400 |
---|---|---|
committer | SmallJoker <SmallJoker@users.noreply.github.com> | 2019-10-12 18:44:23 +0200 |
commit | 69a2099c04527404f2d0942f2088b3d22dd75b5a (patch) | |
tree | 8d6fcc7dd688ace290b50f171dc319ccb68e5a5e /games/minimal/mods | |
parent | 894008ce6fa02aed05f1ac12e0d7bc62e2476359 (diff) | |
download | minetest-69a2099c04527404f2d0942f2088b3d22dd75b5a.tar.gz minetest-69a2099c04527404f2d0942f2088b3d22dd75b5a.tar.bz2 minetest-69a2099c04527404f2d0942f2088b3d22dd75b5a.zip |
Add more visual feedback for button states (#8916)
- Add style properties for overriding the the hovered/pressed state
- By default, hovered buttons are a lighter version of the base color
- By default, pressed buttons are a darker version of the base color
- Add hovered bg image support for image buttons (style property)
Diffstat (limited to 'games/minimal/mods')
-rw-r--r-- | games/minimal/mods/test/formspec.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/games/minimal/mods/test/formspec.lua b/games/minimal/mods/test/formspec.lua index a4d120b41..6371e3d44 100644 --- a/games/minimal/mods/test/formspec.lua +++ b/games/minimal/mods/test/formspec.lua @@ -27,19 +27,23 @@ local clip_fs = [[ local style_fs = [[
- style[one_btn1;bgcolor=red;textcolor=yellow]
+ style[one_btn1;bgcolor=red;textcolor=yellow;bgcolor_hovered=orange;
+ bgcolor_pressed=purple]
button[0,0;2.5,0.8;one_btn1;Button]
style[one_btn2;border=false;textcolor=cyan]
button[0,1.05;2.5,0.8;one_btn2;Text Button]
- style[one_btn3;bgimg=bubble.png;bgimg_pressed=heart.png]
+ style[one_btn3;bgimg=bubble.png;bgimg_hovered=default_apple.png;
+ bgimg_pressed=heart.png]
button[0,2.1;1,1;one_btn3;Bor]
- style[one_btn4;bgimg=bubble.png;bgimg_pressed=heart.png;border=false]
+ style[one_btn4;bgimg=bubble.png;bgimg_hovered=default_apple.png;
+ bgimg_pressed=heart.png;border=false]
button[1.25,2.1;1,1;one_btn4;Bub]
- style[one_btn5;bgimg=bubble.png;bgimg_pressed=heart.png;border=false;alpha=false]
+ style[one_btn5;bgimg=bubble.png;bgimg_hovered=default_apple.png;
+ bgimg_pressed=heart.png;border=false;alpha=false]
button[0,3.35;1,1;one_btn5;Alph]
style[one_btn6;border=true]
|