From 69a2099c04527404f2d0942f2088b3d22dd75b5a Mon Sep 17 00:00:00 2001 From: Hugues Ross Date: Sat, 12 Oct 2019 12:44:23 -0400 Subject: 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) --- games/minimal/mods/test/formspec.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'games/minimal') 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] -- cgit v1.2.3