Search the Community
Showing results for tags 'preventdefault'.
-
phaser canvas maybe stop propagation as default so i can't use jqueryUI draggable over this parent div, please help.
-
- help
- parent div
-
(and 1 more)
Tagged with:
-
I have been working with Phaser for a few months, and have started to use it in an application I am building and am running into an issue most likely tied to my ignorance of how Phaser events are implemented. I come from a web development background, and I feel my understanding of the dom and it's events are muddying my understanding of Phaser eventing. Before stepping through the input source I wanted to ask for help here to hopefully shed some light on my issue. General All events originate from the DOM, yet the DOM event is never passed for manipulation to the handler, why is this? Is there any way to get reference to the dom event in a given handler? Is there a reliable way to prevent the default behavior of an event? I am aware of the priorityID to control event priority and this has solved most of my use cases until now but it really only gives me control over bubbling and delegation. I also found the capture property on the mouse object but setting it to true does not appear to have effect on my issue. My Issue: Unable to prevent the default behavior of 'contextmenu' event in Phaser 2.4.4 My app has need to display a custom context menu over the canvas on right click, so I need to prevent the default behavior of the dom 'contextmenu' event I have tried setting a function to the game.canvas.oncontextmenu property, the function is never called and native context menu is shown I have tried selecting the canvas from the dom and adding an event listener to the contextmenu event, the handler is never raised and native context menu is shown I have even tried selecting the canvas' parent element from the dom and adding an event listener, handler is never raised and native context menu is shown I can select any element in my app phaser is unaware of and use this basic dom capability to assign the contextmenu event handler I can select the canvas or it's parent and bind to other dom events such as 'mousedown' So right now I am lost. Is there some kind of monkey patching going on with phaser and the events of dom elements it is aware of? I simply need to be able to prevent the default behavior of the 'contextmenu' dom event so the user is shown my custom menu and not the native browser context menu. Any advise or insight is greatly appreciated. Browser: Chrome, Phaser Version: 2.4.4, OSX
- 2 replies
-
- input
- contextmenu
-
(and 2 more)
Tagged with:
-
Hi! Im working on a webapp, and found out that in Safari I cant scroll by touching the phaser area. so I added game.input.touch.preventDefault = true; The problem Im having is that testing using the mouse works great. testing in the device itself (or in chrome's device testing), touch signals go a bit crazy, as if fired twice. has anyone experienced this as well? My goal is: Scroll enabled (so the user can remove the browser's topbar) and touch working as expected. Cheers! Felipe
-
I was a bit surprised, that the framework catch, them as I often press F5, or F12 So my request is if can be added some kind of global setting, to preserver the "F" keys default behavior and we can choose if we want it or not Maybe there is some deeper thoughts, so I'll be glad to hear Rich opinion