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

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

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

... let monkey = (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 = ...

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

2. Sprite-屏幕截图 [ 93%]

...dth/2,Browser.clientHeight/2); Laya.stage.addChild(this.aimSp); this.aimSp.graphics.drawRect(0,0,this.aimSp.width,this.aimSp.height,"#333333"); this.monkeyTexture = Laya.loader.getRes("res/apes/monkey3.png"); this.aimSp.graphics.drawTexture(this.monkeyTexture,0,0,this.monkeyTexture.width,this.monkey...

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

3. 鼠标交互-拖动 [ 88%]

...1, dragWidthLimit, dragHeightLimit); //画出拖动限制区域 Laya.stage.graphics.drawRect( dragRegion.x, dragRegion.y, dragRegion.width, dragRegion.height, null, "#FFFFFF", 2); } onStartDrag(e) { //鼠标按下开始拖拽(设置了拖动区域和超界弹回的滑动效果) this.ape.startDrag(dr...

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

4. Sprite-显示图片 [ 85%]

...onkey2Path); let ape2 = new Laya.Sprite(); Laya.stage.addChild(ape2); ape2.graphics.drawTexture(monkey2, 100, 0); })); } } new Sprite_DisplayImage();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Texture = Laya.Texture; import Browser = Laya.Browser; import Handler = La...

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

5. 加载-销毁Texture使用的图片资源 [ 84%]

...s.aniFly); // 创建按钮 this.btn = new Sprite().size(205, 55); this.btn.graphics.drawRect(0, 0, this.btn.width, this.btn.height, "#057AFB"); this.txt = new Text(); this.txt.text = "销毁"; this.txt.pos(75, 15); this.txt.fontSize = 25; this.txt.color = "#FF0000"; this.btn.addChild(this.txt); this...

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

6. 滤镜-发光滤镜 [ 76%]

...ge.addChild(this.ape); let texture = Laya.loader.getRes(apePath); this.ape.graphics.drawTexture(texture); this.ape.x = (Laya.stage.width - texture.width) / 2; this.ape.y = (Laya.stage.height - texture.height) / 2; } applayFilter() { // 创建一个发光滤镜 const GlowFilter = Laya.GlowFilter; let...

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

7. 滤镜-模糊滤镜 [ 68%]

...ge.addChild(this.ape); let texture = Laya.loader.getRes(apePath); this.ape.graphics.drawTexture(texture); this.ape.x = (Laya.stage.width - texture.width) / 2; this.ape.y = (Laya.stage.height - texture.height) / 2; } applayFilter() { // 创建一个模糊滤镜 const BlurFilter = Laya.BlurFilter; // ...

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

8. 滤镜-颜色滤镜 [ 60%]

...); Laya.stage.addChild(ape); apeTexture = Laya.loader.getRes(apePath); ape.graphics.drawTexture(apeTexture); return ape; } } new Filters_Color();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import ColorFilter = Laya.ColorFilter; import Texture = Laya.Texture; import Browser ...

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