I'm importing an image from a JSON spritesheet, which works okay. However, I want to get the sprite to scale once it is in the game. Using the code below, I get the error in console:
Uncaught TypeError: plane.scale is not a function
const config = {
type: Phaser.AUTO,
width: 800,
height: 600,
scene: {
preload: preload,
create: create
}
};
const game = new Phaser.Game(config);
function preload () {
this.load.image('background', 'assets/1.jpg');
this.load.multiatlas('aircraft', 'assets/texture.json', 'assets');
}
function create () {
const background = this.add.image(800, 600, 'background');
const plane = this.add.sprite(200, 200, 'aircraft', 'Glider2.png');
plane.scale(0.1, 0.1);
}