android - Drawing one group over the other in libgdx (same stage) -


i have menu screen on game 2 groups using same stage: maingroup , popupgroup(hidden -> isvisible(false)). when button on maingroup clicked, popupgroup(isvisible(true)) added stage , comes imagebutton.

i darken entire screen extent except imagebutton on display. how can have such click anywhere else on screen except imagebutton remove() popupgroup , bring maingroup forefront?

code..

...addlistener(new inputlistener() {             public boolean touchdown(inputevent event, float x, float y, int pointer, int button) {                  maingroup.settouchable(touchable.disabled);                 popupgroup.setvisible(true);                 popupgroup.setcolor(1f, 1f, 1f, 0f);                 popupgroup.addaction(actions.fadein(1f));                  return true;             } 

is there clicklistener detect when you've pressed out of bounds of group or item?

thanks

first of - why not create 1 more stage? easier have 2 stages - 1 common sprites , second pop-ups.

anyway need set z-index of groups , should use tofront() , toback() methods

    //when need show popup     darkengroup.setvisible(true);     popupgroup.setvisible(true);      darkengroup.tofront();     popupgroup.tofront();      //hide them using setvisible(false)     darkengroup.setvisible(false);     popupgroup.setvisible(false); 

about creating darken semi-transparent group consider using @munyul's comment idea - keep 1x1px texture , stretch - should more optimized


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -