java - LibGdx avoid TouchUp after screen change -


upon touchdown() call game.setscreen(new screenclass(this));

this works great when gets new screen , release mouse (or lift finger) new screen firing touchup() event. there way prevent first touchup getting recorded ?

you can add flag on second screen ignore first touchup event.

private boolean isfirsttouchup = true; 

in touchup event, add code,

if(isfirsttouchup){  isfirsttouchup = false; }else{  // touchup event here, } 

hope can :d


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -