LibGDX 【画像表示】

//ピンク部分はその都度変更

 

〈基本〉

【import】

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.GL20;


【変数宣言】


SpriteBatch batch;
Texture Tx;
Spraite Sp;

 

【createメソッドでの処理】


batch = new SpriteBatch(); //描画クラス初期化?
Tx = new Texture("path"); //画像ロード
Sp = new Sprite(Tx); //スプライトを作成及びテクスチャ指定

【renderメソッドでの処理】


batch
.begin();
Sp.draw(batch);//スプライトSpを描画

〈画像移動〉

※後日記録