EZGUI icon indicating copy to clipboard operation
EZGUI copied to clipboard

Click through?

Open Shadowstep33 opened this issue 8 years ago • 5 comments

Hi, currently I have a Layout the size of the canvas but it is blocking the clicks of objects underneath. The layout contains some buttons, essentially at the corners of the screen:

is there a way to make an EZGUI component (Layout) ignore interaction, but allow some of its children components be interactive or do I have to add the buttons separately so there is no contiguous blocking element in front of the rest of the scene?

Shadowstep33 avatar Apr 06 '16 17:04 Shadowstep33

this is possible, but I think that the behaviour was inconsistend between PIXI and Phaser. to allow click through, you need to add an EZGUI click event handler, and set event.stopped to false.

if you can show a code examples it'll be easier to understand your issue :)

alaa-eddine avatar Apr 09 '16 09:04 alaa-eddine

Hello, I am also interested in this issue. I have a layout in the form:

{
  component: 'Window'
  children: [
    {
      component: 'Layout'
      children: [
        { id: 'btnClose', text: 'Close', component: 'Button', position: { x: 5, y: 5 }, width: 60, height: 40 },
      ]
    }
  ]
}

I've set an event listener like:

EZGUI.components.btnClose.on('click', () => {
  console.log("Close clicked!");
  aboutScreen.visible = false;
});

But I can't manage to make the click event to happen. I've also tried to add

z: 1

Or higher numbers like doc says at the level of Layout and Button without any results.

fr0gs avatar Jul 11 '16 20:07 fr0gs

Hello @fr0gs , have you tried to set btnClose z to a value and its parent z to a lower value ? if you did and still not working can you please tell me what version of Phaser/Pixi are you using ?

alaa-eddine avatar Jul 12 '16 07:07 alaa-eddine

Hello @alaa-eddine , I've set btnClose z value to 10 and it's parent (the Layout component) z value to 1, still no luck. I've seen that among the examples in this repo a very similar structure is shown and it works properly, I may miss something. I am using Phaser 2.4.9 and the phaser-compat-2.4 file from the dist/ folder in EZGUI

fr0gs avatar Jul 13 '16 17:07 fr0gs

Oki doki, with Phaser 2.4.9 EZGUI does not respond to any events in the GUI definition. I will keep trying with older versions.

fr0gs avatar Jul 15 '16 15:07 fr0gs