SpineGameObject TS map seems to not be fully compatible with Phaser, cause it's missing few fields, or I got something messed up with the setup... Working with:
"@esotericsoftware/spine-phaser": "^4.2.75",
"phaser": "^3.88.2"
In Phaser config, I've got Spine configuration set up:
plugins: {
scene: [
{ key: "spine.SpinePlugin", plugin: SpinePlugin, mapping: "spine" }
]
}
When I create spine object and want to set the scale based on its size and window's height I got error that Property 'height' does not exist on type 'SpineGameObject'
even tho, it is there (checked via console.log(test)
). Seems like ts didn't map it properly?
const test = this.add.spine(
0,
0,
"spine-data",
"spine-atlas"
);
test.setScale((this.game.config.height as number) / test.height);
Workaround is to set test variable as any
(const test = this.add.spine(...) as any
) and it's working fine, but using it destroys the idea of typescript