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

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

1. Sprite-显示图片 [ 100%]

...s/monkey1.png", monkey2Path = "./res/apes/monkey2.png"; // 方法1:使用loadImage let ape = new Laya.Sprite(); Laya.stage.addChild(ape); ape.loadImage(monkey1Path); // 方法2:使用drawTexture Laya.loader.load(monkey2Path, Laya.Handler.create(this, function () { let monkey2 = Laya.loader.getRe...

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

2. Sprite-节点控制 [ 98%]

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

3. Sprite-轴心点 [ 98%]

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

4. Sprite-遮罩-放大镜 [ 98%]

...s, this.setup)); } private setup():void { var bg:Sprite = new Sprite(); bg.loadImage("res/bg2.png"); Laya.stage.addChild(bg); this.bg2 = new Sprite(); this.bg2.loadImage("res/bg2.png"); Laya.stage.addChild(this.bg2); this.bg2.scale(3, 3); //创建mask this.maskSp = new Sprite(); this.maskSp.loadImag...

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

5. Sprite-新手引导 [ 92%]

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

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

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

7. 其他引擎的Demo-Example_23 [ 91%]

...gColor = "#232628"; Stat.show(); // create a background texture Laya.stage.loadImage("res/pixi/laserBG.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 updat...

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

8. Sprite-旋转缩放 [ 86%]

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

9. Sprite-容器 [ 84%]

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

10. 缓动-简单的Tween [ 84%]

...kin) { const Sprite = Laya.Sprite; let character = new Sprite(); character.loadImage(skin); Laya.stage.addChild(character); return character; } } new Tween_SimpleSample();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Browser = Laya.Browser; import Tween = Laya.Tween; i...

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