[LayaAir 2.0]timeline播放完成Bug
class Sprite_DisplayImage {第二次播放会停止.
constructor() {
const
Browser = Laya.Browser,
WebGL = Laya.WebGL,
Stage = Laya.Stage;
// 不支持WebGL时自动切换至Canvas
Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL);
Laya.stage.alignV = Stage.ALIGN_MIDDLE;
Laya.stage.alignH = Stage.ALIGN_CENTER;
Laya.stage.scaleMode = Stage.SCALE_SHOWALL;
Laya.stage.bgColor = "#232628";
const monkey1Path = "https://layaair2.ldc2.layabox. ... 3B%3B
Laya.loader.load(monkey1Path, Laya.Handler.create(this, function() {
let monkey = Laya.loader.getRes(monkey1Path);
let ape = new Laya.Sprite();
Laya.stage.addChild(ape);
ape.graphics.drawTexture(monkey, 0, 0);
var tl = new Laya.TimeLine();
tl.once('complete', this, function() {
ape.x = 0;
tl.reset();
tl.to(ape, { x: 100 }, 1000);
tl.play();
});
tl.to(ape, { x: 100 }, 1000);
tl.play();
}));
}
}
new Sprite_DisplayImage();
红框处执行顺序问题
没有找到相关结果
已邀请:
1 个回复
Aar0n
赞同来自: