• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 617 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0045 秒)

131. 设置滤镜(TypeScript-LayaAir基础篇(TS)-位图) [ 69%]

...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

132. 加上size设置后,精灵不能点击. [ 69%]

...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

133. RopeJoint代码动态创建 无法设置otherbody等属性 [ 69%]

...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

134. 设置滤镜(ActionScript-LayaAir基础篇(AS3)-位图) [ 69%]

...} private function createApe():Sprite { var ape:Sprite = new Sprite(); ape.loadImage(ApePath); Laya.stage.addChild(ape); return ape; } } } ``` 在上面的代码中,我们创建了一个原始位图、一个红色滤镜效果位图、一个灰色滤镜效果位图。运行效果如图1所示: ![...

来源: Laya2.0_文档 发布时间: 20210715

135. graphics 问题 [ 69%]

...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

136. 【laya2.0】加载并且显示图片,并且让该图片居于舞台中央,怎么写? [ 69%]

...同来自: 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

137. laya.display.Animation [ 69%]

...画的播放实质就是定时切换Graphics对象。 使用set source、loadImages(...)、loadAtlas(...)、loadAnimation(...)方法可以创建动画模版。使用play(...)可以播放指定动画。 Public Properties Hide Inherited Public Properties Show Inherited Public Properties PropertyDefin...

来源: laya_api 发布时间: 20170929

138. 鼠标交互-拖动 [ 69%]

...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_示例 发布时间: 20240930

139. 微信小游戏图片加载不出来 [ 69%]

...背景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

140. 鼠标交互-拖动 [ 68%]

...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_示例 发布时间: 20240930