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

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

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

...1.png", monkey2Str = "res/apes/monkey2.png", monkey1Res, monkey2Res; class Sprite_SwitchTexture { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.al...

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

2. 滤镜-发光滤镜 [ 97%]

...; } setup() { this.createApe(); this.applayFilter(); } createApe() { const Sprite = Laya.Sprite; this.ape = new Sprite(); Laya.stage.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 ...

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

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

...} setup() { this.createApe(); this.showDragRegion(); } createApe() { const Sprite = 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); ...

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

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

...Laya.stage.bgColor = "#232628"; Stat.show(); this.init(); } init() { const Sprite = Laya.Sprite, Animation = Laya.Animation, Text = Laya.Text, Event = Laya.Event; // 创建背景 this.spBg = Sprite.fromImage(PathBg); Laya.stage.addChild(this.spBg); // 创建动画 this.aniFly = new Animation(); this...

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

5. 鼠标交互-Hold [ 93%]

...load(apePath, Handler.create(this, this.createApe)); } createApe() { const Sprite = Laya.Sprite, Event = Laya.Event; this.ape = new Sprite(); this.ape.loadImage(apePath); let texture = Laya.loader.getRes(apePath); this.ape.pivot(texture.width / 2, texture.height / 2); this.ape.pos(Laya.stage.width /...

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

6. Sprite-显示图片 [ 89%]

...TypeScript三种开发语言、LayaAirIDE让项目开发更高效。class Sprite_DisplayImage { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 2D场景不显示时打开 Laya.Config.isAntialias = true; // 2D场景显示错乱时打开 Laya.Config.useWebGL2 =...

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

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

...; } setup() { this.createApe(); this.applayFilter(); } createApe() { const Sprite = Laya.Sprite; this.ape = new Sprite(); Laya.stage.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 ...

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

8. Sprite-屏幕截图 [ 86%]

...TypeScript三种开发语言、LayaAirIDE让项目开发更高效。class Sprite_ScreenShot { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; this.btnArr = ["res/threeDimen/ui/button.png", "res/threeDimen/ui/button.png", "res/threeDimen/ui/button.png"]; this.nam...

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

9. 滤镜-颜色滤镜 [ 84%]

...ild.x + apeTexture.width; grayApe.y = secondChild.y; } createApe() { const Sprite = Laya.Sprite; let ape = new Sprite(); Laya.stage.addChild(ape); apeTexture = Laya.loader.getRes(apePath); ape.graphics.drawTexture(apeTexture); return ape; } } new Filters_Color();module laya { import Sprite = Laya.Sp...

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

10. 其他引擎的Demo-Example_23 [ 65%]

...BG.jpg"); Laya.stage.frameLoop(1, this, this.animate); } animate() { const Sprite = Laya.Sprite, Point = Laya.Point; let laser; if (tick > frequency) { tick = 0; // iterate through the dudes and update the positions laser = new Sprite(); laser.loadImage("res/pixi/laser0" + ((type % 5) + 1) + ".png")...

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