|
|
|
@ -3,9 +3,12 @@ package com.dungeoncrawler.view;
|
|
|
|
import com.badlogic.gdx.ApplicationAdapter;
|
|
|
|
import com.badlogic.gdx.ApplicationAdapter;
|
|
|
|
import com.badlogic.gdx.Gdx;
|
|
|
|
import com.badlogic.gdx.Gdx;
|
|
|
|
import com.badlogic.gdx.graphics.GL20;
|
|
|
|
import com.badlogic.gdx.graphics.GL20;
|
|
|
|
|
|
|
|
import com.badlogic.gdx.graphics.OrthographicCamera;
|
|
|
|
import com.badlogic.gdx.graphics.Texture;
|
|
|
|
import com.badlogic.gdx.graphics.Texture;
|
|
|
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
|
|
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
|
|
|
import com.badlogic.gdx.graphics.g2d.Sprite;
|
|
|
|
import com.badlogic.gdx.graphics.g2d.Sprite;
|
|
|
|
|
|
|
|
import com.badlogic.gdx.maps.tiled.TiledMapRenderer;
|
|
|
|
|
|
|
|
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
|
|
|
|
|
|
|
|
|
|
|
|
public class View extends ApplicationAdapter {
|
|
|
|
public class View extends ApplicationAdapter {
|
|
|
|
SpriteBatch batch;
|
|
|
|
SpriteBatch batch;
|
|
|
|
@ -13,6 +16,10 @@ public class View extends ApplicationAdapter {
|
|
|
|
Texture t;
|
|
|
|
Texture t;
|
|
|
|
Sprite button;
|
|
|
|
Sprite button;
|
|
|
|
Sprite title;
|
|
|
|
Sprite title;
|
|
|
|
|
|
|
|
Map map;
|
|
|
|
|
|
|
|
TiledMapRenderer tmr;
|
|
|
|
|
|
|
|
OrthographicCamera camera;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void create () {
|
|
|
|
public void create () {
|
|
|
|
@ -28,6 +35,12 @@ public class View extends ApplicationAdapter {
|
|
|
|
title.setY(h - 200);
|
|
|
|
title.setY(h - 200);
|
|
|
|
button.setX(wc - (button.getWidth()/2));
|
|
|
|
button.setX(wc - (button.getWidth()/2));
|
|
|
|
button.setY(400);
|
|
|
|
button.setY(400);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
map = new Map();
|
|
|
|
|
|
|
|
tmr = new OrthogonalTiledMapRenderer(map.getMap());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
camera = new OrthographicCamera(1, h/w);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@ -35,6 +48,13 @@ public class View extends ApplicationAdapter {
|
|
|
|
Gdx.gl.glClearColor(0, 0, 0, 1);
|
|
|
|
Gdx.gl.glClearColor(0, 0, 0, 1);
|
|
|
|
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
|
|
|
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tmr.setView(camera);
|
|
|
|
|
|
|
|
tmr.render();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
camera.zoom = 1000f;
|
|
|
|
|
|
|
|
camera.update();
|
|
|
|
|
|
|
|
batch.setProjectionMatrix(camera.combined);
|
|
|
|
|
|
|
|
|
|
|
|
batch.begin();
|
|
|
|
batch.begin();
|
|
|
|
title.draw(batch);
|
|
|
|
title.draw(batch);
|
|
|
|
button.draw(batch);
|
|
|
|
button.draw(batch);
|
|
|
|
|