Added textAlpha and textActiveAlpha to Button and ButtonGroup.

This commit is contained in:
2019-10-15 14:56:24 +02:00
parent e50ea6af31
commit e2ea89cc0b
73 changed files with 440 additions and 161 deletions
+6
View File
@@ -81,6 +81,8 @@ export default class Button extends PIXI.Container {
* for possible options.
* @param {number} [opts.textStyleActive=Theme.textStyleActive] - A textstyle object for the styling of the label when the
* button is activated. See PIXI.TextStyle for possible options.
* @param {number} [opts.textAlpha=Theme.textAlpha] - The alpha value of the text.
* @param {number} [opts.textActiveAlpha=Theme.textActiveAlpha] - The alpha value of the text when activated.
* @param {string} [opts.style=default] - A shortcut for styling options. Possible values are default, link.
* @param {number} [opts.radius=Theme.radius] - The radius of the four corners of the button (which is a rounded rectangle).
* @param {boolean} [opts.disabled=false] - Is the button disabled? When disabled, the button has a lower alpha value
@@ -138,6 +140,8 @@ export default class Button extends PIXI.Container {
strokeActiveAlpha: theme.strokeActiveAlpha,
textStyle: {},
textStyleActive: {},
textAlpha: theme.textAlpha,
textActiveAlpha: theme.textActiveAlpha,
style: 'default',
radius: theme.radius,
disabled: false,
@@ -566,10 +570,12 @@ export default class Button extends PIXI.Container {
if (this._active) {
if (this.text) {
this.text.style = this.opts.textStyleActive
this.text.alpha = this.opts.textActiveAlpha
}
} else {
if (this.text) {
this.text.style = this.opts.textStyle
this.text.alpha = this.opts.textAlpha
}
}