0
您好我正在嘗試使紋理垂直滾動,我無法獲得正確的行爲。LibGDX:垂直滾動紋理
這裏是我的代碼:
if (Gdx.input.isTouched()) {
if (startingy == 0) {
startingy = (Gdx.input.getY())
/(Gdx.graphics.getHeight()/MainGame.HEIGHT);
}
else if(getstart){
startingy = startingy-scroll;
getstart = false;
}
scroll = (Gdx.input.getY())
/(Gdx.graphics.getHeight()/MainGame.HEIGHT);
if (startingy -scroll < 0) {
startingy = 0;
scroll = 0;
}
if (startingy > img.getHeight()) {
startingy = img.getHeight();
}
} else {
getstart = true;
}
任何幫助,將不勝感激,三江源!