diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index 04ff341..80f3f28 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -20,7 +20,7 @@ { constructor(renderer) { - if(Device.tablet || Device.phone) + if((Device.tablet || Device.phone) && !navigator.isCocoonJS) { this.createTouchHook(); } @@ -33,74 +33,73 @@ div.style.position = 'absolute'; div.style.top = 0; div.style.left = 0; - // div.style.zIndex = 2; - /** - * This is the dom element that will sit over the pixi element. This is where the div overlays will go. - * - * @type {HTMLElement} - * @private - */ - this.div = div; + /** + * This is the dom element that will sit over the pixi element. This is where the div overlays will go. + * + * @type {HTMLElement} + * @private + */ + this.div = div; - /** - * A simple pool for storing divs. - * - * @type {*} - * @private - */ - this.pool = []; + /** + * A simple pool for storing divs. + * + * @type {*} + * @private + */ + this.pool = []; - /** - * This is a tick used to check if an object is no longer being rendered. - * - * @type {Number} - * @private - */ - this.renderId = 0; + /** + * This is a tick used to check if an object is no longer being rendered. + * + * @type {Number} + * @private + */ + this.renderId = 0; - /** - * Setting this to true will visually show the divs - * - * @type {boolean} - */ - this.debug = false; + /** + * Setting this to true will visually show the divs + * + * @type {boolean} + */ + this.debug = false; - /** + /** * The renderer this accessibility manager works for. * * @member {PIXI.SystemRenderer} */ - this.renderer = renderer; + this.renderer = renderer; - /** + /** * The array of currently active accessible items. * * @member {Array<*>} * @private */ - this.children = []; + this.children = []; - /** + /** * pre-bind the functions * - * @private + * @private */ - this._onKeyDown = this._onKeyDown.bind(this); - this._onMouseMove = this._onMouseMove.bind(this); + this._onKeyDown = this._onKeyDown.bind(this); + this._onMouseMove = this._onMouseMove.bind(this); - /** + /** * stores the state of the manager. If there are no accessible objects or the mouse is moving the will be false. * * @member {Array<*>} * @private */ - this.isActive = false; - this.isMobileAccessabillity = false; + this.isActive = false; + this.isMobileAccessabillity = false; - // let listen for tab.. once pressed we can fire up and show the accessibility layer - window.addEventListener('keydown', this._onKeyDown, false); + // let listen for tab.. once pressed we can fire up and show the accessibility layer + window.addEventListener('keydown', this._onKeyDown, false); } createTouchHook() diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index 04ff341..80f3f28 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -20,7 +20,7 @@ { constructor(renderer) { - if(Device.tablet || Device.phone) + if((Device.tablet || Device.phone) && !navigator.isCocoonJS) { this.createTouchHook(); } @@ -33,74 +33,73 @@ div.style.position = 'absolute'; div.style.top = 0; div.style.left = 0; - // div.style.zIndex = 2; - /** - * This is the dom element that will sit over the pixi element. This is where the div overlays will go. - * - * @type {HTMLElement} - * @private - */ - this.div = div; + /** + * This is the dom element that will sit over the pixi element. This is where the div overlays will go. + * + * @type {HTMLElement} + * @private + */ + this.div = div; - /** - * A simple pool for storing divs. - * - * @type {*} - * @private - */ - this.pool = []; + /** + * A simple pool for storing divs. + * + * @type {*} + * @private + */ + this.pool = []; - /** - * This is a tick used to check if an object is no longer being rendered. - * - * @type {Number} - * @private - */ - this.renderId = 0; + /** + * This is a tick used to check if an object is no longer being rendered. + * + * @type {Number} + * @private + */ + this.renderId = 0; - /** - * Setting this to true will visually show the divs - * - * @type {boolean} - */ - this.debug = false; + /** + * Setting this to true will visually show the divs + * + * @type {boolean} + */ + this.debug = false; - /** + /** * The renderer this accessibility manager works for. * * @member {PIXI.SystemRenderer} */ - this.renderer = renderer; + this.renderer = renderer; - /** + /** * The array of currently active accessible items. * * @member {Array<*>} * @private */ - this.children = []; + this.children = []; - /** + /** * pre-bind the functions * - * @private + * @private */ - this._onKeyDown = this._onKeyDown.bind(this); - this._onMouseMove = this._onMouseMove.bind(this); + this._onKeyDown = this._onKeyDown.bind(this); + this._onMouseMove = this._onMouseMove.bind(this); - /** + /** * stores the state of the manager. If there are no accessible objects or the mouse is moving the will be false. * * @member {Array<*>} * @private */ - this.isActive = false; - this.isMobileAccessabillity = false; + this.isActive = false; + this.isMobileAccessabillity = false; - // let listen for tab.. once pressed we can fire up and show the accessibility layer - window.addEventListener('keydown', this._onKeyDown, false); + // let listen for tab.. once pressed we can fire up and show the accessibility layer + window.addEventListener('keydown', this._onKeyDown, false); } createTouchHook() diff --git a/src/core/text/Text.js b/src/core/text/Text.js index bc7752f..50b4193 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -584,6 +584,12 @@ } else { + // cocoon on canvas+ cannot generate textures, so use the first colour instead + if ( navigator.isCocoonJS ) + { + return style.fill[0]; + } + // the gradient will be evenly spaced out according to how large the array is. // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75 let gradient; @@ -717,7 +723,6 @@ } set style(style) { - style = style || {}; if (style instanceof TextStyle) {