@vpmedia/phaser 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  @vpmedia/phaser
2
2
  ===============
3
3
 
4
- [![npm version](https://badge.fury.io/js/@vpmedia%2Fphaser.svg?v=1.1.4)](https://badge.fury.io/js/@vpmedia%2Fphaser)
4
+ [![npm version](https://badge.fury.io/js/@vpmedia%2Fphaser.svg?v=1.1.6)](https://badge.fury.io/js/@vpmedia%2Fphaser)
5
5
  [![Node.js CI](https://github.com/vpmedia/phaser/actions/workflows/node.js.yml/badge.svg)](https://github.com/vpmedia/phaser/actions/workflows/node.js.yml)
6
6
 
7
7
  @vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpmedia/phaser",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2",
5
5
  "author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
6
6
  "license": "MIT",
@@ -6,7 +6,7 @@
6
6
  import DisplayObject from './display_object';
7
7
  import Image from './image';
8
8
  import Point from '../geom/point';
9
- import { BITMAP_TEXT } from '../core/const';
9
+ import { BITMAP_TEXT, SCALE_LINEAR, SCALE_NEAREST } from '../core/const';
10
10
 
11
11
  export default class extends DisplayObject {
12
12
 
@@ -313,9 +313,9 @@ export default class extends DisplayObject {
313
313
 
314
314
  set smoothed(value) {
315
315
  if (value) {
316
- this._data.base.scaleMode = 0;
316
+ this._data.base.scaleMode = SCALE_LINEAR;
317
317
  } else {
318
- this._data.base.scaleMode = 1;
318
+ this._data.base.scaleMode = SCALE_NEAREST;
319
319
  }
320
320
  }
321
321
 
@@ -4,7 +4,7 @@
4
4
  * @author Mat Groves http://matgroves.com/ @Doormat23
5
5
  * @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
6
6
  */
7
- import { RENDER_CANVAS, SCALE_LINEAR, BLEND_NORMAL, BLEND_ADD, BLEND_MULTIPLY, BLEND_SCREEN, BLEND_OVERLAY, BLEND_DARKEN, BLEND_LIGHTEN, BLEND_COLOR_DODGE, BLEND_COLOR_BURN, BLEND_HARD_LIGHT, BLEND_SOFT_LIGHT, BLEND_DIFFERENCE, BLEND_EXCLUSION, BLEND_HUE, BLEND_SATURATION, BLEND_COLOR, BLEND_LUMINOSITY } from '../../core/const';
7
+ import { RENDER_CANVAS, SCALE_LINEAR, BLEND_NORMAL, BLEND_ADD, BLEND_MULTIPLY, BLEND_SCREEN, BLEND_OVERLAY, BLEND_DARKEN, BLEND_LIGHTEN, BLEND_COLOR_DODGE, BLEND_COLOR_BURN, BLEND_HARD_LIGHT, BLEND_SOFT_LIGHT, BLEND_DIFFERENCE, BLEND_EXCLUSION, BLEND_HUE, BLEND_SATURATION, BLEND_COLOR, BLEND_LUMINOSITY, SCALE_NEAREST } from '../../core/const';
8
8
  import { getSmoothingPrefix } from './util';
9
9
  import { detectCapabilities } from './tinter';
10
10
  import * as CanvasMaskManager from './masker';
@@ -30,7 +30,7 @@ export default class {
30
30
  this.renderSession = {
31
31
  context: this.context,
32
32
  maskManager: CanvasMaskManager,
33
- scaleMode: null,
33
+ scaleMode: game.config.antialias ? SCALE_LINEAR : SCALE_NEAREST,
34
34
  smoothProperty: getSmoothingPrefix(this.context),
35
35
  roundPixels: game.config.roundPixels,
36
36
  };
@@ -135,8 +135,7 @@ export function setTransform(context, translateX, translateY, scaleX, scaleY, sk
135
135
  export function getSmoothingPrefix(context) {
136
136
  const VENDORS = ['i', 'webkitI', 'msI', 'mozI', 'oI'];
137
137
  for (let i = 0; i < VENDORS.length; i += 1) {
138
- const prefix = VENDORS[i];
139
- const s = VENDORS[prefix] + 'mageSmoothingEnabled';
138
+ const s = VENDORS[i] + 'mageSmoothingEnabled';
140
139
  if (context && context[s]) {
141
140
  return s;
142
141
  }
@@ -9,7 +9,7 @@ import EventManager from '../core/event_manager';
9
9
  import Rectangle from '../geom/rectangle';
10
10
  import DisplayObject from './display_object';
11
11
  import { clone } from '../geom/util/rectangle';
12
- import { IMAGE, PENDING_ATLAS, BLEND_NORMAL } from '../core/const';
12
+ import { IMAGE, PENDING_ATLAS, BLEND_NORMAL, SCALE_NEAREST } from '../core/const';
13
13
  import { setTexture, getBounds, getLocalBounds, renderCanvas, renderWebGL } from './sprite_util';
14
14
 
15
15
  export default class extends DisplayObject {
@@ -117,7 +117,7 @@ export default class extends DisplayObject {
117
117
  this._frame = clone(this.texture.frame);
118
118
  }
119
119
  if (!smoothed) {
120
- this.texture.baseTexture.scaleMode = 1;
120
+ this.texture.baseTexture.scaleMode = SCALE_NEAREST;
121
121
  }
122
122
  }
123
123