mirror of
https://github.com/wassname/phaser.git
synced 2026-08-18 12:20:33 +08:00
* Fixed issue in Sound.play where if you gave a missing marker it would play the whole sound sprite instead.
* Button.setFrames will set the current frame based on the button state immediately. * InputHandler now creates the _pointerData array on creation and populates with one empty set of values, so pointerOver etc all work before a start call. * Added Canvas.setUserSelect() to disable touchCallouts and user selections within the canvas. * When the game boots it will now by default disable user-select and touch action events on the game canvas. * Loaded.setPreloadSprite now rounds the width/height values and starts from 1. This fixes canvas draw errors in IE9/10 and Firefox.
This commit is contained in:
@@ -108,6 +108,20 @@ Phaser.Canvas = {
|
||||
|
||||
},
|
||||
|
||||
setUserSelect: function (canvas, value) {
|
||||
|
||||
canvas.style['-webkit-touch-callout'] = value;
|
||||
canvas.style['-webkit-user-select'] = value;
|
||||
canvas.style['-khtml-user-select'] = value;
|
||||
canvas.style['-moz-user-select'] = value;
|
||||
canvas.style['-ms-user-select'] = value;
|
||||
canvas.style['user-select'] = value;
|
||||
canvas.style['-webkit-tap-highlight-color'] = 'rgba(0, 0, 0, 0)';
|
||||
|
||||
return canvas;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds the given canvas element to the DOM. The canvas will be added as a child of the given parent.
|
||||
* If no parent is given it will be added as a child of the document.body.
|
||||
|
||||
Reference in New Issue
Block a user