Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当touchDown()我打电话game.setScreen(new ScreenClass(this));
touchDown()
game.setScreen(new ScreenClass(this));
这很好用,但是当它到达新屏幕并且我释放鼠标(或抬起手指)时,新屏幕正在触发一个touchUp()事件。有没有办法防止这首先touchUp被记录?
touchUp()
touchUp
您可以简单地在第二个屏幕上添加一个标志来忽略第一个修饰事件。
private boolean isFirstTouchUp = true;
在 touchup 事件中,添加此代码,
if(isFirstTouchUp){ isFirstTouchUp = false; }else{ // Do you touchup event here, }
希望我能帮助你:D