在libgdx和riodjava中进行背景滚动
我是游戏开发新手,尝试滚动我的背景纹理。 现在贴图移动,但纹理变得模糊 这是我的错误快照 这是我的密码在libgdx和riodjava中进行背景滚动,java,android,Java,Android,我是游戏开发新手,尝试滚动我的背景纹理。 现在贴图移动,但纹理变得模糊 这是我的错误快照 这是我的密码 SpriteBatch batch; Texture bg; float bgx; float speed = 0; float scrollTimer = 2; 在create()方法中,代码是 batch=new SpriteBatch(); bg=新纹理(“background.jpg”) 在render方法中,代码是 speed = 25; speed = speed - scrol
SpriteBatch batch;
Texture bg;
float bgx;
float speed = 0;
float scrollTimer = 2;
在create()方法中,代码是
batch=new SpriteBatch();
bg=新纹理(“background.jpg”)代码>
在render方法中,代码是
speed = 25;
speed = speed - scrollTimer;
bgx += speed;
batch.begin();
batch.draw(bg, bgx, 0, bg.getWidth(), bg.getHeight());
batch().end();
请告诉我少了什么