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

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

1. Sprite-轴心点 [ 100%]

...= 150; this.ape1 = new Sprite(); Laya.stage.addChild(this.ape1); this.ape1.loadImage(monkey2Path); // 设置轴心点为中心 this.ape1.pivot(55, 72); this.ape1.pos(Laya.stage.width / 2 - gap, Laya.stage.height / 2); // 不设置轴心点默认为左上角 this.ape2 = new Sprite(); Laya.stage.addCh...

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

2. 性能测试-卡通人物2 [ 98%]

...Laya.stage.screenMode = Stage.SCREEN_HORIZONTAL; Stat.enable(); Laya.stage.loadImage("res/cartoon2/background.jpg", 0, 0, 1280, 900); this.createCharacters(); text = new Text(); text.zOrder = 10000; text.fontSize = 60; text.color = "#ff0000" Laya.stage.addChild(text); Laya.timer.frameLoop(1, this, t...

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

3. Sprite-节点控制 [ 93%]

...onkey2.png"; this.ape1 = new Sprite(); this.ape2 = new Sprite(); this.ape1.loadImage(monkey2Path); this.ape2.loadImage(monkey2Path); this.ape1.pivot(55, 72); this.ape2.pivot(55, 72); this.ape1.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.ape2.pos(200, 0); // 一只猩猩在舞台上,另...

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

4. Sprite-新手引导 [ 93%]

...ontainer = new Sprite(); Laya.stage.addChild(gameContainer); gameContainer.loadImage("res/guide/crazy_snowball.png"); gameContainer.on(Laya.Event.CLICK, this, this.nextStep); // 引导所在容器 guideContainer = new Sprite(); Laya.stage.addChild(guideContainer); guideContainer.cacheAs = "bitmap"; ...

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

5. 输入设备-摇一摇 [ 92%]

...ePic() { const Sprite = Laya.Sprite; let shakePic = new Sprite(); shakePic.loadImage("res/inputDevice/shake.png"); Laya.stage.addChild(shakePic); } showConsoleText() { const Text = Laya.Text; console = new Text(); Laya.stage.addChild(console); console.y = picH + 10; console.width = Laya.stage.width;...

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

6. 鼠标交互-拖动 [ 92%]

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

7. Sprite-旋转缩放 [ 90%]

...() { this.ape = new Laya.Sprite(); Laya.stage.addChild(this.ape); this.ape.loadImage("res/apes/monkey2.png"); this.ape.pivot(55, 72); // this.ape.pos( Laya.stage.width / 2, Laya.stage.height / 2); this.ape.x = Laya.stage.width / 2; this.ape.y = Laya.stage.height / 2; this.scaleDelta = 0; Laya.timer....

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

8. 滤镜-模糊滤镜 [ 88%]

...teApe)); } private createApe(): void { var ape: Sprite = new Sprite(); ape.loadImage(this.apePath); ape.x = (Laya.stage.width - ape.width) / 2; ape.y = (Laya.stage.height - ape.height) / 2; Laya.stage.addChild(ape); this.applayFilter(ape); } private applayFilter(ape: Sprite): void { var blurFilter: ...

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

9. 滤镜-发光滤镜 [ 87%]

...yFilter(); } private createApe(): void { this.ape = new Sprite(); this.ape.loadImage(this.apePath); var texture: Texture = Laya.loader.getRes(this.apePath); this.ape.x = (Laya.stage.width - texture.width) / 2; this.ape.y = (Laya.stage.height - texture.height) / 2; Laya.stage.addChild(this.ape); } pr...

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

10. Sprite-容器 [ 85%]

...t i = 0; i < 4; i++) { ape = new Sprite(); this.apesCon.addChild(ape); ape.loadImage(`res/apes/monkey${i}.png`); ape.pivot(55, 72).pos( Math.cos(radianUnit * i) * layoutRadius, Math.sin(radianUnit * i) * layoutRadius ); } this.apesCon.pos(Laya.stage.width / 2, Laya.stage.height / 2); Laya.timer.fram...

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