@koreez/phaser3-isometric-plugin
Version:
Phaser3 isometirc plugin
28 lines • 1.43 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var IsoBitmapText_1 = require("../impl/IsoBitmapText");
var handleSceneIsoProjector_1 = require("./handleSceneIsoProjector");
function isoBitmapTextFactory(x, y, z, font, text, size, align) {
handleSceneIsoProjector_1.handleSceneIsoProjector(this.scene);
return this.scene.add.existing(new IsoBitmapText_1.IsoBitmapText(this.scene, x, y, z, font, text, size, align));
}
exports.isoBitmapTextFactory = isoBitmapTextFactory;
function isoBitmapTextCreator(config, addToScene) {
var getAdvancedValue = Phaser.Utils.Objects.GetAdvancedValue;
var getValue = Phaser.Utils.Objects.GetValue;
config = config || {};
config.add = addToScene;
var x = getAdvancedValue(config, 'x', 0);
var y = getAdvancedValue(config, 'y', 0);
var z = getAdvancedValue(config, 'z', 0);
var font = getValue(config, 'font', '');
var text = getValue(config, 'text', '');
var size = getValue(config, 'size', false);
var align = getValue(config, 'align', 0);
handleSceneIsoProjector_1.handleSceneIsoProjector(this.scene);
var isoBitmapText = new IsoBitmapText_1.IsoBitmapText(this.scene, x, y, z, font, text, size, align);
Phaser.GameObjects.BuildGameObject(this.scene, isoBitmapText, config);
return isoBitmapText;
}
exports.isoBitmapTextCreator = isoBitmapTextCreator;
//# sourceMappingURL=isoBitmapTextFactories.js.map