mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Fix Pixi flickering on some mobile phones (#566)
* Fix flickering on some mobile devices (Android/Ubuntu Touch)
This commit is contained in:
@@ -37,8 +37,12 @@ gdjs.RuntimeGameRenderer = gdjs.RuntimeGamePixiRenderer; //Register the class to
|
|||||||
gdjs.RuntimeGamePixiRenderer.prototype.createStandardCanvas = function(canvasArea) {
|
gdjs.RuntimeGamePixiRenderer.prototype.createStandardCanvas = function(canvasArea) {
|
||||||
this._canvasArea = canvasArea;
|
this._canvasArea = canvasArea;
|
||||||
|
|
||||||
|
//This prevents flickering on some mobile devices
|
||||||
|
PIXI.glCore.VertexArrayObject.FORCE_NATIVE = true;
|
||||||
|
|
||||||
//Create the renderer and setup the rendering area
|
//Create the renderer and setup the rendering area
|
||||||
this._pixiRenderer = PIXI.autoDetectRenderer(this._game.getDefaultWidth(), this._game.getDefaultHeight());
|
//"transparent: true" is needed to avoid flickering issues on some mobile phones (see #566)
|
||||||
|
this._pixiRenderer = PIXI.autoDetectRenderer(this._game.getDefaultWidth(), this._game.getDefaultHeight(), {transparent: true} );
|
||||||
canvasArea.style["position"] = "absolute";
|
canvasArea.style["position"] = "absolute";
|
||||||
canvasArea.appendChild(this._pixiRenderer.view); // add the renderer view element to the DOM
|
canvasArea.appendChild(this._pixiRenderer.view); // add the renderer view element to the DOM
|
||||||
canvasArea.tabindex = "1"; //Ensure that the canvas has the focus.
|
canvasArea.tabindex = "1"; //Ensure that the canvas has the focus.
|
||||||
|
Reference in New Issue
Block a user