PointerOver / PointerOut events only fire when clicking
See original GitHub issueVersion
- Phaser Version: 3.17.0
- Operating system: Win64
- Browser: Google Chrome
Description
I am registering pointerover
and pointerout
events for a game object so I can create a hover effect, but it seems like these events are not firing when I hover over it. They only fire when I click and hold down the mouse button, but then, they also only fire once. Is this intended, or a I doing something wrong?
Example Test Code
this.sprite = scene.add.image(this.x, this.y, this.template.id);
// Register a handler for when the user clicks on this sprite
this.sprite.on("pointerup", function() {
this.template.onInteract(this);
}, this);
// Register a handler for when the users mouse hovers over the sprite
this.sprite.on("pointerover", function() {
console.log("hover");
}, this);
this.sprite.on("pointerout", function() {
console.log("out");
})
// Enable interactivity so pointer events actually fire
this.sprite.setInteractive();
Additional Information
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Pointer events - Web APIs | MDN
A browser fires this event if it concludes the pointer will no longer be able to generate events (for example the related device...
Read more >Is there a pointer event that equals to 'click' event?
This means "click" event is generic, it will tell you "what clicked" in its event details. At least on chrome. Edit: I just...
Read more >Pointer Events - W3C
Only a primary pointer will produce compatibility mouse events. ... A user agent MUST fire a pointer event named pointerover when a pointing ......
Read more >Pointer events - The Modern JavaScript Tutorial
Long ago, in the past, there were only mouse events. ... The pointercancel event fires when there's an ongoing pointer interaction, ...
Read more >Pointer events - Unity - Manual
Target: {(evt.target as VisualElement).name}"); } private void OnPointerOutEvent(PointerOutEvent evt) { Debug.Log($"Pointer OUT Event.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found on Mac, using Chrome 87.0.4280.88, the chrome developer console interfered with the pointerover events. So you might want to just turn off your dev console (if it’s open) to see if its the source of your problem.
i think the problem is while you have opened your dev tools you have choose mobile view , and mobile does not have pointer thats why your pointer over and out works only on clicking. please close the dev tool or just change from mobile view to desktop and things will work out smooth for you