java - Libgdx reset checked state of a button programatically -
i have 2 buttons (a & b) , i'm trying have code such when click on button click on b, resets normal state(released). each of buttons has 3 states: up, down , checked.
if (one_h.ispressed()) { //reset button 2 if pressed two_h.getstyle().up = menuskin10.getdrawable("200 released"); two_h.getstyle().down = menuskin10.getdrawable("200 pressed"); two_h.getstyle().checked = menuskin10.getdrawable("200 gray"); } else if (two_h.ispressed()) { //reset button 1
got ! buttons in libgdx have toggle() state. in case...
if (buttona.ispressed()) { if (buttonb.ischecked()) { buttonb.toggle(); //reset normal state } }
Comments
Post a Comment