Определить одну временную переменную
static float time;
Введите приведенный ниже код, если вы хотите отключить сенсорный экран
this.schedule("touchdiablefor5sec",1f);
Теперь напишите ниже метод
public void touchdiablefor5sec(float dt) {
//first disable screen touch
this.setIsTouchEnabled(false);
time= time+1;
// if 5 second done then enable touch
if(time==5)
{
this.setIsTouchEnabled(true);
//unschedule the touchdiablefor5sec scheduler
this.unschedule("touchdiablefor5sec");
}
}