Initial commit
This commit is contained in:
5
src/Main.gwt.xml
Normal file
5
src/Main.gwt.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
|
||||
<module>
|
||||
<source path="ve/ucv/ciens/ccg/nxtar" />
|
||||
</module>
|
66
src/ve/ucv/ciens/ccg/nxtar/Main.java
Normal file
66
src/ve/ucv/ciens/ccg/nxtar/Main.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package ve.ucv.ciens.ccg.nxtar;
|
||||
|
||||
import com.badlogic.gdx.ApplicationListener;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.GL10;
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.Texture.TextureFilter;
|
||||
import com.badlogic.gdx.graphics.g2d.Sprite;
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
|
||||
public class Main implements ApplicationListener {
|
||||
private OrthographicCamera camera;
|
||||
private SpriteBatch batch;
|
||||
private Texture texture;
|
||||
private Sprite sprite;
|
||||
|
||||
@Override
|
||||
public void create() {
|
||||
float w = Gdx.graphics.getWidth();
|
||||
float h = Gdx.graphics.getHeight();
|
||||
|
||||
camera = new OrthographicCamera(1, h/w);
|
||||
batch = new SpriteBatch();
|
||||
|
||||
texture = new Texture(Gdx.files.internal("data/libgdx.png"));
|
||||
texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
|
||||
|
||||
TextureRegion region = new TextureRegion(texture, 0, 0, 512, 275);
|
||||
|
||||
sprite = new Sprite(region);
|
||||
sprite.setSize(0.9f, 0.9f * sprite.getHeight() / sprite.getWidth());
|
||||
sprite.setOrigin(sprite.getWidth()/2, sprite.getHeight()/2);
|
||||
sprite.setPosition(-sprite.getWidth()/2, -sprite.getHeight()/2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
batch.dispose();
|
||||
texture.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
Gdx.gl.glClearColor(1, 1, 1, 1);
|
||||
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
batch.setProjectionMatrix(camera.combined);
|
||||
batch.begin();
|
||||
sprite.draw(batch);
|
||||
batch.end();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resize(int width, int height) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pause() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resume() {
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user