Java Code Examples for com.badlogic.gdx.InputMultiplexer#removeProcessor()

The following examples show how to use com.badlogic.gdx.InputMultiplexer#removeProcessor() . 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: SteeringBehaviorsTest.java    From gdx-ai with Apache License 2.0 6 votes vote down vote up
private void changeTest (int engineIndex, int testIndex) {
	// Remove the old test and its window
	if (currentTest != null) {
		if (currentTest.getDetailWindow() != null) currentTest.getDetailWindow().remove();
		currentTest.dispose();
	}

	// Add the new test and its window
	currentTest = tests[engineIndex][testIndex];
	currentTest.create();
	testHelpLabel.setText(currentTest.getHelpMessage());
	InputMultiplexer im = (InputMultiplexer)Gdx.input.getInputProcessor();
	if (im.size() > 1) im.removeProcessor(1);
	if (currentTest.getInputProcessor() != null) im.addProcessor(currentTest.getInputProcessor());
	if (currentTest.getDetailWindow() != null) stage.addActor(currentTest.getDetailWindow());
}
 
Example 2
Source File: PathFinderTests.java    From gdx-ai with Apache License 2.0 6 votes vote down vote up
void changeTest (int index) {
	// Remove the old behavior and its window
	testsTable.clear();
	if (currentTest != null) {
		if (currentTest.getDetailWindow() != null) currentTest.getDetailWindow().remove();
		currentTest.dispose();
	}

	// Add the new behavior and its window
	currentTest = tests[index];
	currentTest.create();
	InputMultiplexer im = (InputMultiplexer)Gdx.input.getInputProcessor();
	if (im.size() > 1) im.removeProcessor(1);
	if (currentTest.getInputProcessor() != null) im.addProcessor(currentTest.getInputProcessor());
	if (currentTest.getDetailWindow() != null) stage.addActor(currentTest.getDetailWindow());
}