pixijs / ui

Commonly used UI components for PixiJS
https://pixijs.io/ui/
MIT License
187 stars 17 forks source link

Missing properties: 'scale' and 'position' properties missing in type FancyButton but still editable #158

Closed zachvoxwattz closed 4 months ago

zachvoxwattz commented 4 months ago

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

zachvoxwattz commented 4 months ago

Apparently, reinstalling all of the dependencies worked. Closing this issue.