大约有 617 项符合查询结果, 库内数据总量为 30,935 项。 (搜索耗时: 0.0046 秒)
Laya_社区(371) Laya3.0_api(64) Laya2.0_api(59) laya_api(55) Laya2.0_文档(24) Laya2.0_示例(19) Laya_示例(19) Laya3.0_文档(6)
...ild.y; } private createApe(): Sprite { var ape: Sprite = new Sprite(); ape.loadImage("../../res/apes/monkey2.png"); Laya.stage.addChild(ape); return ape; } } } new laya.Main(); ``` 在上面的代码中,我们创建了一个原始位图、一个红色滤镜效果位图、一个灰色滤镜效果...
来源: Laya2.0_文档 发布时间: 20210715
...img/flower1.jpg" : r > 0.33 ? "img/flower2.png" : "img/flower3.jpg" img.loadImage(s); img.on(Laya.Event.CLICK, this, () => { img.y -= 10; }) img.pos(100, 300) Laya.stage.addChild(img) } function createFlower() { var f = new Laya.Sprite(); var r = Math.random(); var s = r > 0.66 ? "img/flowe...
来源: Laya_社区 发布时间: 20180412
...r img:Sprite = new Sprite(); //加载显示图片,坐标位于100,50 img.loadImage("res/layabox.png"); img.x=(Laya.stage.width-256)/2; //添加到舞台 Laya.stage.addChild(img); var img2:Sprite = new Sprite(); //加载显示图片,坐标位于100,50 img2.loadImage("res/layabox.png"); img2.x=(La...
来源: Laya_社区 发布时间: 20200217
...} private function createApe():Sprite { var ape:Sprite = new Sprite(); ape.loadImage(ApePath); Laya.stage.addChild(ape); return ape; } } } ``` 在上面的代码中,我们创建了一个原始位图、一个红色滤镜效果位图、一个灰色滤镜效果位图。运行效果如图1所示: ![...
来源: Laya2.0_文档 发布时间: 20210715
...olor = "#232628"; showApe(); })(); function showApe() { // 方法1:使用loadImage var ape = new Sprite(); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey2.png"); let m = new Laya.Matrix() m.skew(-0.25, 0) // ape.graphics.save() ape.graphics.transform(m) // ape.graphics.restore() le...
来源: Laya_社区 发布时间: 20170609
...画的播放实质就是定时切换Graphics对象。 使用set source、loadImages(...)、loadAtlas(...)、loadAnimation(...)方法可以创建动画模版。使用play(...)可以播放指定动画。 Public Properties Hide Inherited Public Properties Show Inherited Public Properties PropertyDefin...
来源: laya_api 发布时间: 20170929
...同来自: var logo = new Laya.Sprite(); Laya.stage.addChild(logo); logo.loadImage("res/atlas/test.png", Laya.Handler.create(this, function(){ console.log("complete!!"); logo.x= Laya.stage.width/2-logo.width/2; logo.y= Laya.stage.height/2-logo.height/2; //logo.pos(Laya.stage.width/2-logo.width/2,Lay...
来源: Laya_社区 发布时间: 20181010
...eApe(); showDragRegion(); } function createApe() { ape = new Sprite(); ape.loadImage(ApePath); Laya.stage.addChild(ape); var texture = Laya.loader.getRes(ApePath); ape.pivot(texture.width / 2, texture.height / 2); ape.x = Laya.stage.width / 2; ape.y = Laya.stage.height / 2; ape.on(Event.MOUSE_DOWN, ...
来源: Laya_示例 发布时间: 20250312
...背景1 this.bg1 = new Laya.Sprite(); //加载并显示背景图 this.bg1.loadImage("ui/BG/play-bg.png", 0, 0, 720, 5120); //把背景图显示在容器内 this.addChild(this.bg1); //创建背景2 this.bg2 = new Laya.Sprite(); //加载并显示背景图 this.bg2.loadImage("ui/BG/play-bg.png", 0, 0, ...
来源: Laya_社区 发布时间: 20181105
...prite = Laya.Sprite, Event = Laya.Event; this.ape = new Sprite(); this.ape.loadImage(ApePath); Laya.stage.addChild(this.ape); let texture = Laya.loader.getRes(ApePath); this.ape.pivot(texture.width / 2, texture.height / 2); this.ape.x = Laya.stage.width / 2; this.ape.y = Laya.stage.height / 2; this....
来源: Laya2.0_示例 发布时间: 20250312