Builds a TextBox
Options
Usage
textBoxOptions = { positionX: value.positionX, positionY: value.positionY, width: value.width, height: value.height, lineWidth: 3, lineColor: 0x0000ff, textStatic: value.textStatic, textFontSize: value.textFontSize, textFontColor: 0x000000, shouldShowTrash: value.shouldShowTrash, trashCanImage: { sprite: "game", image: "trashCan" } } const textBox = new SZ.TextBox(this.game, textBoxOptions);
All properties are exposed using TypeScript Get/Set and can be accessed via
this.textBox.textFontColor = 0x0C0C0C; const textColor = this.textBox.textFontColor;
The TextBox also exposes all the component Phaser objects so they can be discretely manipulated after creation of the TextBox object
this.textBox.boxInstance: Phaser.Sprite this.textBox.borderInstance: Phaser.Sprite this.textBox.textInstance: Phaser.Text this.textBox.animation: Phaser.Tween
TextBox Animation
default animation: this.game.add.tween(this.borderInstance).to({ alpha: 0.2 }, 500, Phaser.Easing.Quadratic.InOut, false, 0, -1, true);
it is your responsibilty to clean up interrupted animations after a TextBox.pause(), only the borderInstance alpha is handled automatically and set back to its full alpha = 1.0
the Phaser.Game object
a JSON object for user configurable settings
TextBox
Builds a TextBox
Options
Usage
textBoxOptions = { positionX: value.positionX, positionY: value.positionY, width: value.width, height: value.height, lineWidth: 3, lineColor: 0x0000ff, textStatic: value.textStatic, textFontSize: value.textFontSize, textFontColor: 0x000000, shouldShowTrash: value.shouldShowTrash, trashCanImage: { sprite: "game", image: "trashCan" } } const textBox = new SZ.TextBox(this.game, textBoxOptions);
All properties are exposed using TypeScript Get/Set and can be accessed via
this.textBox.textFontColor = 0x0C0C0C; const textColor = this.textBox.textFontColor;
The TextBox also exposes all the component Phaser objects so they can be discretely manipulated after creation of the TextBox object
this.textBox.boxInstance: Phaser.Sprite this.textBox.borderInstance: Phaser.Sprite this.textBox.textInstance: Phaser.Text this.textBox.animation: Phaser.Tween
TextBox Animation
default animation: this.game.add.tween(this.borderInstance).to({ alpha: 0.2 }, 500, Phaser.Easing.Quadratic.InOut, false, 0, -1, true);
it is your responsibilty to clean up interrupted animations after a TextBox.pause(), only the borderInstance alpha is handled automatically and set back to its full alpha = 1.0
the Phaser.Game object
a JSON object for user configurable settings