Skip to content

Instantly share code, notes, and snippets.

View fkytks's full-sized avatar

F/T fkytks

  • dokokano.com
  • usagi star
View GitHub Profile
// テクスチャー読み込み (256x256 px)
img = new Texture("badlogic.jpg");
// スプライト初期化
sprite = new Sprite( new TextureRegion(img,0,0,256,256));
sprite.setSize(256, 256);
// 良くない例:画面いっぱいになってしまうので実際の画面の縦横比に影響されて、縦長or横長になってしまう
camera = new OrthographicCamera();
camera.setToOrtho(false, 640, 400);
batch.setProjectionMatrix(camera.combined);