com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener Java Examples

The following examples show how to use com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DiceWindow.java    From dice-heroes with GNU General Public License v3.0 6 votes vote down vote up
private EventListener createMinimizeListener(final Die die, final Iterable<Die> dice) {
    return new ActorGestureListener(){
        @Override public void tap(InputEvent event, float x, float y, int count, int button) {
            for (Die check : dice) {
                DiePane pane = map.get(check);
                if (pane == null)
                    continue;
                if (check == die) {
                    pane.setMinimized(!pane.isMinimized());
                } else {
                    pane.setMinimized(true);
                }
            }
        }
    };
}
 
Example #2
Source File: CreatureQueueWindow.java    From dice-heroes with GNU General Public License v3.0 5 votes vote down vote up
private EventListener createListener(final Creature creature) {
    return new ActorGestureListener(20, 0.4f, 0.5f, 0.15f) {
        @Override public boolean longPress(Actor actor, float x, float y) {
            creatureInfoWindow.show(new CreatureInfoWindow.Params(creature, array.first().world));
            return true;
        }
    };
}
 
Example #3
Source File: PotionsWindow.java    From dice-heroes with GNU General Public License v3.0 5 votes vote down vote up
private EventListener ingredientListener(final Item item) {
    return new ActorGestureListener() {
        @Override public void tap(InputEvent event, float x, float y, int count, int button) {
            ingredients.showIngredientWindow(item);
        }
    };
}
 
Example #4
Source File: PageView.java    From cocos-ui-libgdx with Apache License 2.0 5 votes vote down vote up
public void initGestureListener() {
    this.addListener(new ActorGestureListener() {
        @Override
        public void fling(InputEvent event, float velocityX, float velocityY, int button) {
            if (Math.abs(velocityX) > Math.abs(velocityY)) {
                if (velocityX > 0) {
                    previousView();
                } else {
                    nextView();
                }
            }
            super.fling(event, velocityX, velocityY, button);
        }
    });
}