java - Make an ImageButton touchable only the first time -


so created button:

  tile = new imagebutton(up,null,checked);   tile.setposition(x, 800);   tile.setsize(118,200);   tile.addlistener(new inputlistener(){     @override     public boolean touchdown(inputevent event, float x, float y, int pointer, int button) {       return true;     }   }); 

right changes texture checked image every time button touched. want texture changes checked ,only first time button touched , becomes "untouchable" after. there way this? eventlisteners don't have feature these.

imagebutton has method settouchable(touchable touchable) inherited actor. "determines how touch events distributed actor. default touchable.enabled."

touchable hase 3 enum constants:

  • childrenonly: no touch input events received actor, children still receive events.

  • disabled: no touch input events received actor or any
    children.

  • enabled: touch input events received actor , children.

on first touch call settouchable(touchable.disabled) on particular imagebutton


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -