SHARE
TWEET
Untitled
a guest
Sep 3rd, 2014
216
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- public class StoneScreen implements Screen {
- OrthographicCamera camera;
- final TombStone game;
- //Textures and art.
- public Texture background, sdStone;
- public Sprite backgrounds;
- //TextField´s stuff
- private Stage stage;
- private Skin skin;
- public StoneScreen(TombStone gam) {
- this.game = gam;
- camera = new OrthographicCamera();
- camera.setToOrtho(false, 136, 204);
- game.assets.load();
- loadStandard();
- }
- public void loadStandard(){
- background = game.assets.background;
- sdStone = game.assets.sdStone;
- //backgrounds = Assets.backgrounds;
- }
- @Override
- public void render(float delta) {
- Gdx.gl.glClearColor(0, 0, 0.2f,1);
- Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
- //Recieves the screen width and height
- float gameHeight = Gdx.graphics.getHeight();
- float gameWidth = Gdx.graphics.getWidth();
- camera.update();
- game.batch.setProjectionMatrix(camera.combined);
- game.batch.begin();
- Gdx.app.log("X", "FPS:" + Gdx.graphics.getFramesPerSecond());
- game.batch.draw(background,0,0, 136, 204);
- game.batch.draw(sdStone, 40, 20, 70, 110);
- //SpriteBatch batcher = (SpriteBatch)stage.getBatch();
- game.batch.end();
- stage.act();
- stage.draw();
- }
- @Override
- public void resize(int width, int height) {
- // TODO Auto-generated method stub
- }
- @Override
- public void show() {
- // TODO Auto-generated method stub
- stage = new Stage();
- Gdx.input.setInputProcessor(stage);
- skin = new Skin(Gdx.files.internal("uiskin.json"));
- TextArea textArea = new TextArea("Text Area\nEssentially, a text field\nwith\nmultiple\nlines.\n" + "loooooo", skin);
- textArea.setX(155);
- textArea.setY(350);
- textArea.setWidth(270);
- textArea.setHeight(270);
- TextField textField = new TextField("Text Field", skin);
- textField.setX(150);
- textField.setY(350);
- textField.setWidth(270);
- textField.setHeight(50);
- stage.addActor(textArea);
- stage.addActor(textField);
- }
- @Override
- public void hide() {
- // TODO Auto-generated method stub
- }
- @Override
- public void pause() {
- // TODO Auto-generated method stub
- }
- @Override
- public void resume() {
- // TODO Auto-generated method stub
- }
- @Override
- public void dispose() {
- // TODO Auto-generated method stub
- }
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
