Java tutorial
/** * Worms Game - Simple libGDX based vector game. * Copyright (C) 2015 Miroslav Ligas * <p/> * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * <p/> * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * <p/> * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package im.ligas.worms.screen; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.OrthographicCamera; import im.ligas.worms.WormsConstants; /** * @author Miroslav Ligas */ public class BaseScreen<T> implements Screen, InputProcessor { final T game; OrthographicCamera camera; public BaseScreen(T game) { this.game = game; camera = new OrthographicCamera(); camera.setToOrtho(false, WormsConstants.DIMENSION_X, WormsConstants.DIMENSION_Y); } @Override public void show() { Gdx.input.setInputProcessor(this); } @Override public void render(float delta) { } @Override public void resize(int width, int height) { } @Override public void pause() { } @Override public void resume() { } @Override public void hide() { Gdx.input.setInputProcessor(null); } @Override public void dispose() { } @Override public boolean keyDown(int keycode) { return false; } @Override public boolean keyUp(int keycode) { return false; } @Override public boolean keyTyped(char character) { return false; } @Override public boolean touchDown(int screenX, int screenY, int pointer, int button) { return false; } @Override public boolean touchUp(int screenX, int screenY, int pointer, int button) { return false; } @Override public boolean touchDragged(int screenX, int screenY, int pointer) { return false; } @Override public boolean mouseMoved(int screenX, int screenY) { return false; } @Override public boolean scrolled(int amount) { return false; } }