com.badlogic.gdx.InputProcessor Java Examples

The following examples show how to use com.badlogic.gdx.InputProcessor. 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: InputProxy.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
@Override
public InputProcessor getInputProcessor() {
    if (input != null) {
        return input.getInputProcessor();
    } else {
        return null;
    }
}
 
Example #2
Source File: GUIConsole.java    From libgdx-inGameConsole with Apache License 2.0 5 votes vote down vote up
/**
 * 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
 * @return processor == this.stage
 */
private boolean hasStage (InputProcessor processor) {
	if (!(processor instanceof InputMultiplexer)) {
		return processor == stage;
	}
	InputMultiplexer im = (InputMultiplexer)processor;
	SnapshotArray<InputProcessor> ips = im.getProcessors();
	for (InputProcessor ip : ips) {
		if (hasStage(ip)) {
			return true;
		}
	}
	return false;
}
 
Example #3
Source File: AbstractConsole.java    From libgdx-inGameConsole with Apache License 2.0 4 votes vote down vote up
@Override public InputProcessor getInputProcessor () {
	return null;
}
 
Example #4
Source File: Lwjgl3Mini2DxInput.java    From mini2Dx with Apache License 2.0 4 votes vote down vote up
@Override
public InputProcessor getInputProcessor() {
	return inputProcessor;
}
 
Example #5
Source File: Lwjgl3Mini2DxInput.java    From mini2Dx with Apache License 2.0 4 votes vote down vote up
@Override
public void setInputProcessor(InputProcessor processor) {
	this.inputProcessor = processor;
}
 
Example #6
Source File: IOSMini2DxInput.java    From mini2Dx with Apache License 2.0 4 votes vote down vote up
@Override
public InputProcessor getInputProcessor() {
	return inputProcessor;
}
 
Example #7
Source File: IOSMini2DxInput.java    From mini2Dx with Apache License 2.0 4 votes vote down vote up
@Override
public void setInputProcessor(InputProcessor processor) {
	this.inputProcessor = processor;
}
 
Example #8
Source File: InputProxy.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setInputProcessor(InputProcessor processor) {
    if (input != null) {
        input.setInputProcessor(processor);
    }
}
 
Example #9
Source File: PathFinderTestBase.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public void setInputProcessor (InputProcessor inputProcessor) {
	this.inputProcessor = inputProcessor;
}
 
Example #10
Source File: PathFinderTestBase.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public InputProcessor getInputProcessor () {
	return inputProcessor;
}
 
Example #11
Source File: PathFinderTestBase.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public PathFinderTestBase (PathFinderTests container, String testName, InputProcessor inputProcessor) {
	this.container = container;
	this.testName = testName;
	this.inputProcessor = inputProcessor;
}
 
Example #12
Source File: SteeringTestBase.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public void setInputProcessor (InputProcessor inputProcessor) {
	this.inputProcessor = inputProcessor;
}
 
Example #13
Source File: SteeringTestBase.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public InputProcessor getInputProcessor () {
	return inputProcessor;
}
 
Example #14
Source File: SteeringTestBase.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public SteeringTestBase (SteeringBehaviorsTest container, String engineName, String testName, InputProcessor inputProcessor) {
	this.container = container;
	this.engineName = engineName;
	this.testName = testName;
	this.inputProcessor = inputProcessor;
}
 
Example #15
Source File: Scene2dSteeringTest.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public Scene2dSteeringTest (SteeringBehaviorsTest container, String name, InputProcessor inputProcessor) {
	super(container, "Scene2d", name, inputProcessor);
}
 
Example #16
Source File: Box2dSteeringTest.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public Box2dSteeringTest (SteeringBehaviorsTest container, String name, InputProcessor inputProcessor) {
	super(container, "Box2d", name, inputProcessor);
}
 
Example #17
Source File: PrioritizedInputMultiplexer.java    From gdx-vfx with Apache License 2.0 4 votes vote down vote up
public void addProcessor (InputProcessor processor) {
    addProcessor(processor, 0);
}
 
Example #18
Source File: GUIConsole.java    From libgdx-inGameConsole with Apache License 2.0 4 votes vote down vote up
@Override public InputProcessor getInputProcessor () {
	return stage;
}
 
Example #19
Source File: PrioritizedInputMultiplexer.java    From gdx-texture-packer-gui with Apache License 2.0 4 votes vote down vote up
public Wrapper(InputProcessor processor, int priority) {
    this.processor = processor;
    this.priority = priority;
}
 
Example #20
Source File: PrioritizedInputMultiplexer.java    From gdx-texture-packer-gui with Apache License 2.0 4 votes vote down vote up
public void removeProcessor (InputProcessor processor) {
       processors.remove(processor);
}
 
Example #21
Source File: PrioritizedInputMultiplexer.java    From gdx-texture-packer-gui with Apache License 2.0 4 votes vote down vote up
public void addProcessor (InputProcessor processor, int priority) {
	if (processor == null) throw new NullPointerException("processor cannot be null");
	processors.put(processor, new Wrapper(processor, priority));
       processors.sort(comparator);
}
 
Example #22
Source File: ControllerToInputAdapter.java    From gdx-controllerutils with Apache License 2.0 4 votes vote down vote up
public void setInputProcessor(InputProcessor targetInput) {
    this.targetInput = targetInput;
}
 
Example #23
Source File: ControllerToInputAdapter.java    From gdx-controllerutils with Apache License 2.0 4 votes vote down vote up
public InputProcessor getInputProcessor() {
    return targetInput;
}
 
Example #24
Source File: PrioritizedInputMultiplexer.java    From gdx-vfx with Apache License 2.0 4 votes vote down vote up
public Wrapper(InputProcessor processor, int priority) {
    this.processor = processor;
    this.priority = priority;
}
 
Example #25
Source File: PrioritizedInputMultiplexer.java    From gdx-vfx with Apache License 2.0 4 votes vote down vote up
public void removeProcessor (InputProcessor processor) {
       processors.remove(processor);
}
 
Example #26
Source File: PrioritizedInputMultiplexer.java    From gdx-vfx with Apache License 2.0 4 votes vote down vote up
public void addProcessor (InputProcessor processor, int priority) {
	if (processor == null) throw new NullPointerException("processor cannot be null");
	processors.put(processor, new Wrapper(processor, priority));
       processors.sort(comparator);
}
 
Example #27
Source File: Console.java    From libgdx-inGameConsole with Apache License 2.0 2 votes vote down vote up
/**
 * @return {@link InputProcessor} for this {@link Console}
 */
InputProcessor getInputProcessor ();
 
Example #28
Source File: InputController.java    From TerraLegion with MIT License 2 votes vote down vote up
/**
 * Remove an input processor
 *
 * @param ip The processor
 */
public void removeInputProcessor(InputProcessor ip) {
	processors.removeProcessor(ip);
	Gdx.input.setInputProcessor(processors);
}
 
Example #29
Source File: InputController.java    From TerraLegion with MIT License 2 votes vote down vote up
/**
 * Add an input processor to accept input events
 *
 * @param ip The processor
 */
public void addInputProcessor(InputProcessor ip) {
	processors.addProcessor(ip);
	Gdx.input.setInputProcessor(processors);
}