Added antialiasGL option

This commit is contained in:
Richard Davey 2019-08-29 11:46:58 +01:00
parent 24f0187028
commit e3039ffb64
4 changed files with 13 additions and 1 deletions

View file

@ -1,5 +1,11 @@
# Change Log
## Version 3.20.0 - Fitoria - in dev
### New Features
* `GameConfig.antialiasGL` is a new boolean that allows you to set the `antialias` property of the WebGL context during creation, without impacting any subsequent textures or the canvas CSS.
## Version 3.19.0 - Naofumi - 8th August 2019
### Tween Updates

View file

@ -337,6 +337,11 @@ var Config = new Class({
*/
this.antialias = GetValue(renderConfig, 'antialias', true);
/**
* @const {boolean} Phaser.Core.Config#antialiasGL - Sets the `antialias` property when the WebGL context is created. Setting this value does not impact any subsequent textures that are created, or the canvas style attributes.
*/
this.antialiasGL = GetValue(renderConfig, 'antialiasGL', true);
/**
* @const {boolean} Phaser.Core.Config#desynchronized - When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details.
*/

View file

@ -3,6 +3,7 @@
* @since 3.0.0
*
* @property {boolean} [antialias=true] - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled.
* @property {boolean} [antialiasGL=true] - Sets the `antialias` property when the WebGL context is created. Setting this value does not impact any subsequent textures that are created, or the canvas style attributes.
* @property {boolean} [desynchronized=false] - When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details.
* @property {boolean} [pixelArt=false] - Sets `antialias` and `roundPixels` to true. This is the best setting for pixel-art games.
* @property {boolean} [roundPixels=false] - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property.

View file

@ -59,7 +59,7 @@ var WebGLRenderer = new Class({
alpha: gameConfig.transparent,
desynchronized: gameConfig.desynchronized,
depth: false,
antialias: gameConfig.antialias,
antialias: gameConfig.antialiasGL,
premultipliedAlpha: gameConfig.premultipliedAlpha,
stencil: true,
failIfMajorPerformanceCaveat: gameConfig.failIfMajorPerformanceCaveat,