Black areas in game when resizing on a few Android Chrome versions

オープン
#229 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
frontend, game-dev

調査の方向性

The report includes a runnable example and test code that resizes the game with game.scale.setGameSize and game.scale.refresh using WebGL with antialiasing enabled. Start by reproducing it on Android 6.0.1 with Chrome 58 while changing orientation, then compare with antialiasing disabled. Done means resizing no longer leaves black areas or causes blinking on the affected browser versions.

索引モデルが issue の本文から書いたものです。

説明

bug

This issue is about resizing the game. Tested it on Android 6.0.1 with Chrome 58.0.3029.83.
I guess the problem is with PIXI, because when antialiasing is enabled in WEBGL mode and the new size of the game is bigger than the old size, the new size has black areas by the amount exactly how much it is bigger than the old size. Tried a workaround to create a bigger initial game size (so the new dimension can only be smaller), but after resizing the game screen starts to blink on the affected browser.
When the antialiasing is disabled there is no issue. The problem appeared on Android 6.0.1 with Chrome 58, on other browsers it worked fine (Windows Phone Edge browser, IOS Safari, Andoid 5 with Chrome).

Phaser versions affected: all! Tested from 2.4.6 up to 2.7.9
Live example with antialising on:
http://icedevel.com/phaser-bug/antialias-yes/index.html
Antialiasing off:
http://icedevel.com/phaser-bug/antialias-no/index.html
In the example a simple image is stretched on the screen. Turn the orientation on mobile to see the resizing.
Here is the simple test code:

var game;
var imgTest;

function preload() {

	game.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL;
	game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
	game.scale.pageAlignHorizontally = true;
	game.scale.pageAlignVertically = true;
	window.addEventListener("resize", function(){
		game.scale.setGameSize(window.innerWidth, window.innerHeight);
		game.scale.refresh();
	});
	game.load.image("testimage", "test.png");
}
function create() {
	imgTest = game.add.image(game.width / 2, game.height / 2, 'testimage');
	imgTest.anchor.setTo(0.5, 0.5);
	imgTest.width = game.width;
	imgTest.height = game.height;
}

function update() {
	imgTest.x = game.width / 2;
	imgTest.y = game.height / 2;
	imgTest.width = game.width;
	imgTest.height = game.height;
}


window.onload = function(){
	var config = {
		width: 400,
		height: 400,
		renderer: Phaser.WEBGL,
		antialias: true,
		state: {
			preload: preload,
			create: create,
			update: update
		}
	}

	game = new Phaser.Game(config);
};
主要言語
JavaScript
スター
1.4k
フォーク
485
平均マージ
1日 2時間
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

phaserjs/phaser-ce のほかの issue

phaserjs/phaser-ce の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。