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

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

1. Sprite-切换纹理 [ 100%]

...reUrl = (flag = !flag) ? texture1 : texture2; // 更换纹理 ape.graphics.clear(); var texture = Laya.loader.getRes(textureUrl); ape.graphics.drawTexture(texture, 0, 0); // 设置交互区域 ape.size(texture.width, texture.height); } })();module laya { import Sprite = Laya.Sprite; import Stage = L...

来源: Laya_示例 发布时间: 20240930

2. Sprite-切换纹理 [ 99%]

...ey = (this.flag = !this.flag) ? monkey1Res : monkey2Res; this.ape.graphics.clear(); this.ape.graphics.drawTexture(monkey, 0, 0); this.ape.size(monkey.width, monkey.height); } } new Sprite_SwitchTexture();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Texture = Laya.Text...

来源: Laya2.0_示例 发布时间: 20240930

3. flag的问题 [ 97%]

...color = (flag = !flag)?"#A52A2A":"#FFA500"         c.graphics.clear();         c.graphics.drawRect(50, 50, 300, 100, color);         Laya.stage.addChild(c);     } })();   2017-05-10 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 ...

来源: Laya_社区 发布时间: 20170510

4. Sprite loadImage 的时候出现多张图片同时显示 [ 87%]

...Sprite loadImage 的时候出现多张图片同时显示 this.img.graphics.clear(); var imgUrl = (this.flag = !this.flag)? this.imgUrl1 :this.imgUrl2; this.img.loadImage(imgUrl,100,50); 简单的点击sprite切换图片,结果会出现两张图片同时显示的情况 附件 : --> 2018-04-04 添...

来源: Laya_社区 发布时间: 20180404

5. 显示与切换图片(ActionScript-LayaAir基础篇(AS3)-位图) [ 86%]

... } private function switchImg(e:*=null):void { //清空图片 img.graphics.clear(); //获得要切换的图片资源路径 var imgUrl:String = (flag = !flag)? monkey1:monkey2; //加载显示图片,坐标位于100,50 img.loadImage(imgUrl); } } } ``` 运行代码效果如动图2-2所示: ![动图2...

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

6. 显示与切换图片(JavaScript-LayaAir基础篇(JS)-位图) [ 85%]

...reUrl = (flag = !flag) ? texture1 : texture2; // 更换纹理 ape.graphics.clear(); ape.loadImage(textureUrl); var texture = Laya.loader.getRes(textureUrl); } })(); ``` 运行代码效果如动图2-2所示: ![动图2-2](img/2-2.gif) (动图2-2) ## 2 、用drawTexture方法显示与切换图片 ###...

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

7. LayaAir2.13.0中的Camera.clearFlag设置为DepthOnly是改了机制还是BUG呢? [ 83%]

LayaAir2.13.0中的Camera.clearFlag设置为DepthOnly是改了机制还是BUG呢? 今天升级到最新的LayaAir2.13.0了,结果发现Camera.clearFlag有点问题了。 设置为 Camera.clearFlag = Laya.CameraClearFlags.DepthOnly后原来2.12.0中背景都是透明的,使用在UI中时显...

来源: Laya_社区 发布时间: 20220317

8. 显示与切换图片(TypeScript-LayaAir基础篇(TS)-位图) [ 82%]

...s.flag) ? this.texture1 : this.texture2; // 更换纹理 this.ape.graphics.clear(); var texture: Texture = Laya.loader.getRes(textureUrl); this.ape.loadImage(textureUrl); // 设置交互区域 this.ape.size(texture.width, texture.height); } } } new laya.Sprite_SwitchTexture(); ``` 运行代码效果...

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

9. 切换位图,点击图片距离容器的区域也会触发点击事件 [ 82%]

...点击事件 Laya.stage.addChild(img); function switchImg() { img.graphics.clear(); //清除绘制 var imgUrl = (this.flag = !this.flag) ? this.img1 : this.img2; img.loadImage(imgUrl, 100, 100) } }这是官方的切换位图的示例,但是点击位图距离容器top和left100的区域,还可以...

来源: Laya_社区 发布时间: 20180502

10. 关于切换图片的问题 [ 82%]

...g.loadImage(this.plane1); Laya.stage.addChild(this.img); this.img.graphics.clear(); this.img.loadImage(this.plane2); Laya.stage.addChild(this.img) } } new Main(); 出来的结果是两张图合并到了一起, 于是我再尝试 constructor() { Laya.init(1000,800); this.img = new Laya.Sprite; this...

来源: Laya_社区 发布时间: 20180406