com.badlogic.gdx.controllers.ControllerAdapter Java Examples

The following examples show how to use com.badlogic.gdx.controllers.ControllerAdapter. 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: SplashScreen.java    From riiablo with Apache License 2.0 6 votes vote down vote up
@Override
public void show() {
  Controllers.addListener(controllerListener = new ControllerAdapter() {
    @Override
    public boolean buttonDown(Controller controller, int buttonIndex) {
      return pressToContinue();
    }
  });
  Riiablo.input.addProcessor(inputProcessor = new InputAdapter() {
    @Override
    public boolean keyDown(int keycode) {
      if (keycode == Input.Keys.BACK || keycode == Input.Keys.ESCAPE
          || keycode == Input.Keys.VOLUME_DOWN || keycode == Input.Keys.VOLUME_UP) {
        return true;
      }

      return pressToContinue();
    }

    @Override
    public boolean touchDown(int screenX, int screenY, int pointer, int button) {
      return pressToContinue();
    }
  });
  Riiablo.input.addProcessor(stage);
}
 
Example #2
Source File: GameOver.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
public GameOver (Invaders invaders) {
	super(invaders);
	spriteBatch = new SpriteBatch();
	background = new Texture(Gdx.files.internal("data/planet.jpg"));
	background.setFilter(TextureFilter.Linear, TextureFilter.Linear);

	logo = new Texture(Gdx.files.internal("data/title.png"));
	logo.setFilter(TextureFilter.Linear, TextureFilter.Linear);

	font = new BitmapFont(Gdx.files.internal("data/font16.fnt"), Gdx.files.internal("data/font16.png"), false);

	if (invaders.getController() != null) {
		invaders.getController().addListener(new ControllerAdapter() {
			@Override
			public boolean buttonUp(Controller controller,
					int buttonIndex) {
				controller.removeListener(this);
				isDone = true;
				return false;
			}
		});
	}
}
 
Example #3
Source File: MainMenu.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
public MainMenu (Invaders invaders) {
	super(invaders);

	spriteBatch = new SpriteBatch();
	background = new Texture(Gdx.files.internal("data/planet.jpg"));
	background.setFilter(TextureFilter.Linear, TextureFilter.Linear);

	logo = new Texture(Gdx.files.internal("data/title.png"));
	logo.setFilter(TextureFilter.Linear, TextureFilter.Linear);

	font = new BitmapFont(Gdx.files.internal("data/font16.fnt"), Gdx.files.internal("data/font16.png"), false);

	if (invaders.getController() != null) {
		invaders.getController().addListener(new ControllerAdapter() {
			@Override
			public boolean buttonUp(Controller controller, int buttonIndex) {
				controller.removeListener(this);
				isDone = true;
				return false;
			}
		});
	}
}