Skip to content

Commit 05e3520

Browse files
committed
The Mesh.setAlpha method has been restored, even though it's empty and does nothing, to prevent runtime errors when adding a Mesh or Quad object to a Container. Fix phaserjs#4338 phaserjs#4343
1 parent b09fa3f commit 05e3520

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Version 3.17.0 - Togusa - in development
44

5+
### Bug Fixes
56

7+
* The `Mesh.setAlpha` method has been restored, even though it's empty and does nothing, to prevent runtime errors when adding a Mesh or Quad object to a Container. Fix #4338 #4343 (thanks @pfdtravalmatic @charmingny)
68

79

810

src/gameobjects/mesh/Mesh.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var Class = require('../../utils/Class');
88
var Components = require('../components');
99
var GameObject = require('../GameObject');
1010
var MeshRender = require('./MeshRender');
11+
var NOOP = require('../../utils/NOOP');
1112

1213
/**
1314
* @classdesc
@@ -152,7 +153,16 @@ var Mesh = new Class({
152153
this.setPosition(x, y);
153154
this.setSizeToFrame();
154155
this.initPipeline();
155-
}
156+
},
157+
158+
/**
159+
* This method is left intentionally empty and does not do anything.
160+
* It is retained to allow a Mesh or Quad to be added to a Container.
161+
*
162+
* @method Phaser.GameObjects.Mesh#setAlpha
163+
* @since 3.17.0
164+
*/
165+
setAlpha: NOOP
156166

157167
});
158168

0 commit comments

Comments
 (0)