Answer the question
In order to leave comments, you need to log in
How to catch touchup event after double click?
I need to add a Listener to the stage so that after double-clicking when we release the button, the method will work.
Now the code is like this:
stage.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y) {
if( getTapCount() == 2)
{
circle.accelerate();
dbClick = true;
return;
}
};
@Override
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
return true;
}
@Override
public void touchUp (InputEvent event, float x, float y, int pointer, int button) {
if(dbClick)
circle.accelerate = -40;
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question