У меня есть спрайт с 6 кадрами, и когда я нажимаю на кнопку, я хочу показать кадр 3, например.Я пытаюсь этот код, но он все еще останавливается в кадре 1.
function preload (){
this.load.spritesheet('info', 'images/info.png', { frameWidth: 550, frameHeight: 400 });
}
function create (){
var infos = this.add.sprite(275,200,"info")
this.anims.create({
key: "informations",
frames: this.anims.generateFrameNumbers("info", { start: 0, end: 6 }),
frameRate: 10,
repeat: -1
});
// I'm try to show the frame 3 here.
informations.pause(3);
// When I play, the animation work!
//infos.anims.play("informations", true);
}
Я нашел документацию для pause ([atFrame]) , но этоне работает.