Missing properties: 'scale' and 'position' properties missing in type FancyButton but still editable
zachvoxwattz opened this issue · comments
Võ C. Kha commented
I would like to scale and position a FancyButton
after setting its defaultView
to a simple Sprite
. However, both properties are missing.
Example:
import { FancyButton } from '@pixi/ui'
class MenuButton extends FancyButton {
constructor() {
super()
this.defaultView = `shared_button_accept`
this.scale.set(0.5) // Property 'scale' does not exist on type 'MenuButton'.
this.position.set(500, 500) // Property 'position' does not exist on type 'MenuButton'.
}
}
After some experiments, I found out that the button is absolutely fine despite the errors mentioned above. It is scaled down 50% of its original size and placed at x = 500
and y = 500
.
Am I doing something wrong?
Expected Behavior
scale
and position
properties available for alternation.
Current Behavior
Both properties do not exist but are still editable.
Environment
- version: Pixi v8.1.0 & @Pixi/ui v2.0.1
- Browser & Version: Edge 124
- OS & Version: Windows 10
- IDE: VSC with TypeScript support extension.
Võ C. Kha commented
Apparently, reinstalling all of the dependencies worked. Closing this issue.