0
我試圖將我的遊戲從badlogicgame引擎「移植」到libgdx,而且我有一個奇怪的問題。 我看過一些這樣的帖子,但我認爲這是有點不同(這是我打開另一篇文章的原因,但如果你認爲這是在以前的答案,我會關閉它) 。與紋理區域的白色屏幕與一些圖像
嗯,我開始,我使用的超級彈跳字體
包com.redgehog;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector3;
public class MainMenuScreen extends ScreenAdapter {
IceBucketMulti game;
OrthographicCamera guiCam;
Rectangle soundBounds;
Rectangle playBounds;
Rectangle highscoresBounds;
Rectangle helpBounds;
Vector3 touchPoint;
public MainMenuScreen (IceBucketMulti game) {
this.game = game;
guiCam = new OrthographicCamera(480, 320);
guiCam.position.set(480/2, 320/2, 0);
soundBounds = new Rectangle(0, 0, 64, 64);
playBounds = new Rectangle(160 - 150, 200 + 18, 300, 36);
highscoresBounds = new Rectangle(160 - 150, 200 - 18, 300, 36);
helpBounds = new Rectangle(160 - 150, 200 - 18 - 36, 300, 36);
touchPoint = new Vector3();
}
public void draw() {
GL20 gl = Gdx.gl;
gl.glClearColor(1, 1, 1, 1);
gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
guiCam.update();
game.batcher.setProjectionMatrix(guiCam.combined);
game.batcher.disableBlending();
game.batcher.begin();
game.batcher.draw(Assets.backgroundRegionSU, 0, 0, 480, 320);
game.batcher.end();
game.batcher.enableBlending();
game.batcher.begin();
game.batcher.draw(Assets.mainMenuRegion, 10, 200 - 110/2, 300, 110);
game.batcher.end();
}
@Override
public void render (float delta) {
update();
draw();
}
@Override
public void pause() {
Settings.save();
}
}
它的工作原理與原來的背景,但是當我把我的形象,它停止工作...我不明白其中的道理。我試圖改變大小和PPP原始圖像匹配,但相同的結果。
我試圖把整個紋理,然後它的作品...我試着這個代碼與原始的libgdx superjumper版本和最後一個libgdx版本。
有什麼想法?
感謝,
您是否有任何控制檯輸出?也許像「java.io.IOException:加載像素映射:僅8位」? – nano 2014-12-05 20:49:29