UNPKG

phaser4-rex-plugins

Version:
18 lines (14 loc) 639 B
import CustomShapes from './CustomShapes.js'; const GetAdvancedValue = Phaser.Utils.Objects.GetAdvancedValue; const BuildGameObject = Phaser.GameObjects.BuildGameObject; export default function (config, addToScene) { if (config === undefined) { config = {}; } if (addToScene !== undefined) { config.add = addToScene; } var width = GetAdvancedValue(config, 'width', undefined); var height = GetAdvancedValue(config, 'height', width); var gameObject = new CustomShapes(this.scene, 0, 0, width, height, config); BuildGameObject(this.scene, gameObject, config); return gameObject; }