Example usage for com.badlogic.gdx InputMultiplexer getProcessors

List of usage examples for com.badlogic.gdx InputMultiplexer getProcessors

Introduction

In this page you can find the example usage for com.badlogic.gdx InputMultiplexer getProcessors.

Prototype

public Array<InputProcessor> getProcessors() 

Source Link

Usage

From source file:com.strongjoshua.console.GUIConsole.java

License:Apache License

/** Compares the given processor to the console's stage. If given a multiplexer, it is iterated through recursively to check all
 * of the multiplexer's processors for comparison.
 * @param processor//from w w  w  .  j  a v a 2  s  .  co m
 * @return processor == this.stage */
private boolean hasStage(InputProcessor processor) {
    if (!(processor instanceof InputMultiplexer)) {
        return processor == stage;
    }
    InputMultiplexer im = (InputMultiplexer) processor;
    Array<InputProcessor> ips = im.getProcessors();
    for (InputProcessor ip : ips) {
        if (hasStage(ip)) {
            return true;
        }
    }
    return false;
}