# Event scope

**URL:** <https://phaser.discourse.group/t/event-scope/655>\
**Category:** Phaser 3\
**Created:** [January 8, 2019, 9:32am UTC](https://phaser.discourse.group/t/event-scope/655 "2019-01-08T09:32:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CubeDr](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@CubeDr](https://phaser.discourse.group/u/CubeDr)\
**Post date:** [January 8, 2019, 9:32am UTC](https://phaser.discourse.group/t/event-scope/655/1 "2019-01-08T09:32:35Z")

</div>

Hello, I am new to Phaser3 and am struggling with buildling UIs.

As far as I know, Phaser3 doesn’t support UIs such as layouts, buttons, lists, etc.

So I am trying to build my own flexible Phaser3 UI.

I built `Widget` class as the root class of all my UI elements.

The first problem is that I want my `Widget` to handle it’s own events and consume it.

Howerver, if I do `setInteractive()` to a `Widget`, it will not consume the event and the Scene will always respond the the event.

Are there any good ways to consume events or limit event to be called inside specific scope?

---

<div class="post-metadata">

**Author:** ![rich](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/rich/32/4_2.png) [@rich](https://phaser.discourse.group/u/rich)\
**Post date:** [January 8, 2019, 10:05pm UTC](https://phaser.discourse.group/t/event-scope/655/2 "2019-01-08T22:05:58Z")

</div>

Assuming `Widget` extends `GameObject`, then it already has an Event Emitter built into it. Which means it can already emit any custom event you need. What you have bound as a listener is up to you, though. If you make it interactive, then there is nothing stopping you binding the input events to methods on the Widget. The Widget will emit `pointerdown` etc, on itself, so you could listen for those and handle them without it ever touching the Scene.

---

<div class="post-metadata">

**Author:** ![CubeDr](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@CubeDr](https://phaser.discourse.group/u/CubeDr)\
**Post date:** [January 9, 2019, 12:50am UTC](https://phaser.discourse.group/t/event-scope/655/4 "2019-01-09T00:50:33Z")

</div>

Ohhh… So the event is emitted to the GameObject itself instead of the Scene… Thanks!!

---

<div class="post-metadata">

**Author:** ![rich](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/rich/32/4_2.png) [@rich](https://phaser.discourse.group/u/rich)\
**Post date:** [January 9, 2019, 9:57am UTC](https://phaser.discourse.group/t/event-scope/655/5 "2019-01-09T09:57:57Z")

</div>

The Game Object itself will emit some input events. Where you bind the listeners for those is up to you, but the events never touch the Scene. In fact, thinking about it, there isn’t a single Input event from anywhere that goes to the Scene!
