Example usage for com.badlogic.gdx.scenes.scene2d.ui Button isDisabled

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui Button isDisabled

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui Button isDisabled.

Prototype

public boolean isDisabled() 

Source Link

Usage

From source file:com.vlaaad.dice.util.SoundHelper.java

License:Open Source License

public static void initButton(final Button value) {
    value.addListener(new InputListener() {
        @Override/*w  w  w.  j a  v  a2 s  .c om*/
        public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            if (value.isDisabled())
                return false;
            SoundManager.instance.playSound("ui-button-down");
            return true;
        }

        //            @Override public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
        //                if (value.isDisabled() || !value.isOver())
        //                    return;
        //
        //            }
    });
    value.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            SoundManager.instance.playSound("ui-button-up");
        }
    });
}