import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle;
public class button extends ApplicationAdapter{
private OrthographicCamera camera;
private SpriteBatch batch;
private TextureAtlas buttonsAtlas;
private TextButton button;
@<a rel="nofollow" href="https://www.androidiani.com/forum/members/override.html" target="_blank">Override</a>
camera = new OrthographicCamera();
camera.setToOrtho(false, 800, 480);
batch = new SpriteBatch();
buttonsAtlas = new TextureAtlas("ui/button.pack");
buttonSkin.addRegions(buttonsAtlas);
font = new BitmapFont(Gdx.files.internal("font/white32.fnt"),false);
Gdx.input.setInputProcessor(stage);
TextButtonStyle style = new TextButtonStyle();
style.up = buttonSkin.getDrawable("button.down.9.png");
style.down = buttonSkin.getDrawable("button.up.9.png");
button = new TextButton("", style);
button.setPosition(200, 100);
button.addListener(new InputListener() {
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button)
Gdx.app.log("my app", "Coin Pressed");
public void touchUp (InputEvent event, float x, float y, int pointer, int button) {
Gdx.app.log("my app", "Coin Released");
((Game) Gdx.app.getApplicationListener()).setScreen(new play());
@<a rel="nofollow" href="https://www.androidiani.com/forum/members/override.html" target="_blank">Override</a>
@<a rel="nofollow" href="https://www.androidiani.com/forum/members/override.html" target="_blank">Override</a>
Gdx.gl.glClearColor(1, 1, 1, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.setProjectionMatrix(camera.combined);
@<a rel="nofollow" href="https://www.androidiani.com/forum/members/override.html" target="_blank">Override</a>
public void resize(int width, int height) {
@<a rel="nofollow" href="https://www.androidiani.com/forum/members/override.html" target="_blank">Override</a>
@<a rel="nofollow" href="https://www.androidiani.com/forum/members/override.html" target="_blank">Override</a>