If you set pixelArt to true in your game config (or antialias to false) then TileSprites will now respect this when using the Canvas Renderer and disable smoothing on the internal fill canvas.

This commit is contained in:
Richard Davey 2018-10-02 13:30:45 +01:00
parent e48d6bfb01
commit 66445c9fb1
2 changed files with 7 additions and 0 deletions

View file

@ -15,6 +15,7 @@
### Bug Fixes
* Fixed a bug in the canvas rendering of both the Static and Dynamic Tilemap Layers where the camera matrix was being multiplied twice with the layer, causing the scale and placement to be off (thanks galerijanamar)
* If you set `pixelArt` to true in your game config (or `antialias` to false) then TileSprites will now respect this when using the Canvas Renderer and disable smoothing on the internal fill canvas.
### Examples and TypeScript

View file

@ -10,6 +10,7 @@ var Components = require('../components');
var CONST = require('../../const');
var GameObject = require('../GameObject');
var GetPowerOfTwo = require('../../math/pow2/GetPowerOfTwo');
var Smoothing = require('../../display/canvas/Smoothing');
var TileSpriteRender = require('./TileSpriteRender');
var Vector2 = require('../../math/Vector2');
@ -504,6 +505,11 @@ var TileSprite = new Class({
var ctx = this.context;
if (!this.scene.sys.game.config.antialias)
{
Smoothing.disable(ctx);
}
var scaleX = this._tileScale.x;
var scaleY = this._tileScale.y;