Skip to content

Commit

Permalink
Merge pull request #53 from erenerturk1/erenerturk1-patch-1
Browse files Browse the repository at this point in the history
Update _06-getting-interactive.md
  • Loading branch information
miltoncandelero committed Aug 22, 2023
2 parents a140bd1 + 95e588a commit 013bdd4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/includes/_06-getting-interactive.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Scene extends Container {
// this.clampy.on("tap", this.onClicky, this);

// Super important or the object will never receive mouse events!
this.clampy.interactive = true;
this.clampy.eventMode = 'dynamic';
}

private onClicky(e: FederatedPointerEvent): void {
Expand All @@ -59,7 +59,7 @@ The basic anatomy of adding an event listener to an imput is:
`yourObject.on("stringOfWhatYouWantToKnow", functionToBeCalled, contextForTheFunction)`

and the second super important thing is:
`yourObject.interactive = true`
`yourObject.eventMode = 'dynamic'`

### Touch? Mouse? I want it all!
The web has moved forward since its first inception and now we have mouses and touchscreens!
Expand All @@ -73,7 +73,7 @@ The rule of thumb is that if it has `pointer` in the name, it will catch both mo
| `mouseup` | `touchend` | `pointerup` |
| `mousemove` | `touchmove` | `pointermove` |

<aside class="warning">Still not working? You forgot the <code>.interactive = true</code>, didn't you?</aside>
<aside class="warning">Still not working? You forgot the <code>.eventMode = 'dynamic'</code>, didn't you?</aside>

### The event that fired

Expand Down Expand Up @@ -222,4 +222,4 @@ Let's see a quick overview of how EventEmitter3 works:

<aside class="warning">
An event listener will keep an object alive. Calling <code>.destroy()</code> will remove all listeners. Otherwise you need to call <code>.off(...)</code> for each event (or call <code>.removeAllListeners()</code>)
</aside>
</aside>

0 comments on commit 013bdd4

Please sign in to comment.