Skip to content

Commit 0d0846a

Browse files
committed
Calling a creator, such as GraphicsCreator, without passing in a config object, would cause an error to be thrown. All Game Object creators now catch against this.
1 parent dfc3cb9 commit 0d0846a

16 files changed

Lines changed: 30 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ The new Plugin Manager and associated classes are 100% covered by JSDocs and the
4949
* The Headless renderer was broken due to an invalid access during TextureSource.init.
5050
* Animation.yoyo was ignored when calculating the next frame to advance to, breaking the yoyo effect. It now yoyos properly (thanks Tomas)
5151
* Corrected an error in Container.getBoundsTransformMatrix that called a missing method, causing a `getBounds` on a nested container to fail. Fix #3624 (thanks @poasher)
52+
* Calling a creator, such as GraphicsCreator, without passing in a config object, would cause an error to be thrown. All Game Object creators now catch against this.
5253

5354
### Examples, Documentation and TypeScript
5455

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ The new Plugin Manager and associated classes are 100% covered by JSDocs and the
313313
* The Headless renderer was broken due to an invalid access during TextureSource.init.
314314
* Animation.yoyo was ignored when calculating the next frame to advance to, breaking the yoyo effect. It now yoyos properly (thanks Tomas)
315315
* Corrected an error in Container.getBoundsTransformMatrix that called a missing method, causing a `getBounds` on a nested container to fail. Fix #3624 (thanks @poasher)
316+
* Calling a creator, such as GraphicsCreator, without passing in a config object, would cause an error to be thrown. All Game Object creators now catch against this.
316317

317318
### Examples, Documentation and TypeScript
318319

src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCreator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue');
3434
*/
3535
GameObjectCreator.register('dynamicBitmapText', function (config, addToScene)
3636
{
37+
if (config === undefined) { config = {}; }
38+
3739
var font = GetAdvancedValue(config, 'font', '');
3840
var text = GetAdvancedValue(config, 'text', '');
3941
var size = GetAdvancedValue(config, 'size', false);

src/gameobjects/bitmaptext/static/BitmapTextCreator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ var GetValue = require('../../../utils/object/GetValue');
2525
*/
2626
GameObjectCreator.register('bitmapText', function (config, addToScene)
2727
{
28+
if (config === undefined) { config = {}; }
29+
2830
var font = GetValue(config, 'font', '');
2931
var text = GetAdvancedValue(config, 'text', '');
3032
var size = GetAdvancedValue(config, 'size', false);

src/gameobjects/blitter/BlitterCreator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
2424
*/
2525
GameObjectCreator.register('blitter', function (config, addToScene)
2626
{
27+
if (config === undefined) { config = {}; }
28+
2729
var key = GetAdvancedValue(config, 'key', null);
2830
var frame = GetAdvancedValue(config, 'frame', null);
2931

src/gameobjects/container/ContainerCreator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
2525
*/
2626
GameObjectCreator.register('container', function (config, addToScene)
2727
{
28+
if (config === undefined) { config = {}; }
29+
2830
var x = GetAdvancedValue(config, 'x', 0);
2931
var y = GetAdvancedValue(config, 'y', 0);
3032

src/gameobjects/graphics/GraphicsCreator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ var Graphics = require('./Graphics');
2222
*/
2323
GameObjectCreator.register('graphics', function (config, addToScene)
2424
{
25+
if (config === undefined) { config = {}; }
26+
2527
if (addToScene !== undefined)
2628
{
2729
config.add = addToScene;

src/gameobjects/image/ImageCreator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ var Image = require('./Image');
2424
*/
2525
GameObjectCreator.register('image', function (config, addToScene)
2626
{
27+
if (config === undefined) { config = {}; }
28+
2729
var key = GetAdvancedValue(config, 'key', null);
2830
var frame = GetAdvancedValue(config, 'frame', null);
2931

src/gameobjects/mesh/MeshCreator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ var Mesh = require('./Mesh');
2525
*/
2626
GameObjectCreator.register('mesh', function (config, addToScene)
2727
{
28+
if (config === undefined) { config = {}; }
29+
2830
var key = GetAdvancedValue(config, 'key', null);
2931
var frame = GetAdvancedValue(config, 'frame', null);
3032
var vertices = GetValue(config, 'vertices', []);

src/gameobjects/particles/ParticleManagerCreator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ var ParticleEmitterManager = require('./ParticleEmitterManager');
2424
*/
2525
GameObjectCreator.register('particles', function (config, addToScene)
2626
{
27+
if (config === undefined) { config = {}; }
28+
2729
var key = GetAdvancedValue(config, 'key', null);
2830
var frame = GetAdvancedValue(config, 'frame', null);
2931
var emitters = GetFastValue(config, 'emitters', null);

0 commit comments

Comments
 (0)