Added getter and setter for maxWidth and maxHeight for button groups.
This commit is contained in:
+12
-12
@@ -253,10 +253,10 @@ export default class Button extends PIXI.Container {
|
||||
})
|
||||
|
||||
this.button.on('pointerout', this.onEnd.bind(this))
|
||||
this.button.on('pointercancel', this.onEnd.bind(this))
|
||||
this.button.on('pointerupoutside', this.onEnd.bind(this))
|
||||
this.button.on('pointertap', this.onEnd.bind(this))
|
||||
this.button.on('scroll', this.onEnd.bind(this))
|
||||
this.button.on('pointercancel', this.onEnd.bind(this))
|
||||
this.button.on('pointerupoutside', this.onEnd.bind(this))
|
||||
this.button.on('pointertap', this.onEnd.bind(this))
|
||||
this.button.on('scroll', this.onEnd.bind(this))
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
this.button.on('pointerdown', e => {
|
||||
@@ -689,12 +689,12 @@ export default class Button extends PIXI.Container {
|
||||
this.icon.tint = value
|
||||
}
|
||||
}
|
||||
|
||||
onEnd(event) {
|
||||
this.capture(event)
|
||||
TweenLite.to([this.button, this.content], this.theme.fast, {
|
||||
alpha: 1,
|
||||
overwrite: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
onEnd(event) {
|
||||
this.capture(event)
|
||||
TweenLite.to([this.button, this.content], this.theme.fast, {
|
||||
alpha: 1,
|
||||
overwrite: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,6 +371,34 @@ export default class ButtonGroup extends PIXI.Container {
|
||||
this.buttons.forEach(it => (it.disabled = value))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets or sets the maximum width of the button group for stacking. Usefull when you want to resize the available space.
|
||||
*
|
||||
* @member {number}
|
||||
*/
|
||||
get maxWidth() {
|
||||
return this.opts.maxWidth
|
||||
}
|
||||
|
||||
set maxWidth(value) {
|
||||
this.opts.maxWidth = value
|
||||
this.layout()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets or sets the maximum height of the button group for stacking. Usefull when you want to resize the available space.
|
||||
*
|
||||
* @member {number}
|
||||
*/
|
||||
get maxHeight() {
|
||||
return this.opts.maxHeight
|
||||
}
|
||||
|
||||
set maxHeight(value) {
|
||||
this.opts.maxHeight = value
|
||||
this.layout()
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches all buttons of the button group and returns the maximum width of one button.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user