Skip to content

Commit 66445c9

Browse files
committed
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.
1 parent e48d6bf commit 66445c9

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
### Bug Fixes
1616

1717
* 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)
18+
* 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.
1819

1920
### Examples and TypeScript
2021

src/gameobjects/tilesprite/TileSprite.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var Components = require('../components');
1010
var CONST = require('../../const');
1111
var GameObject = require('../GameObject');
1212
var GetPowerOfTwo = require('../../math/pow2/GetPowerOfTwo');
13+
var Smoothing = require('../../display/canvas/Smoothing');
1314
var TileSpriteRender = require('./TileSpriteRender');
1415
var Vector2 = require('../../math/Vector2');
1516

@@ -504,6 +505,11 @@ var TileSprite = new Class({
504505

505506
var ctx = this.context;
506507

508+
if (!this.scene.sys.game.config.antialias)
509+
{
510+
Smoothing.disable(ctx);
511+
}
512+
507513
var scaleX = this._tileScale.x;
508514
var scaleY = this._tileScale.y;
509515

0 commit comments

Comments
 (0)