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

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

1. Sprite-轴心点 [ 100%]

...es(); })(); function createApes() { var gap = 300; sp1 = new Sprite(); sp1.loadImage("../../res/apes/monkey2.png", 0, 0); sp1.pos((Laya.stage.width - gap) / 2, Laya.stage.height / 2); //设置轴心点为中心 sp1.pivot(55, 72); Laya.stage.addChild(sp1); //不设置轴心点默认为左上角 sp2 =...

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

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

...reateAnimation = function(images) { animation = new Animation(); animation.loadImages(images); animation.interval = 70; animation.play(0); this.addChild(animation); } Character.prototype.createBloodBar = function() { bloodBar = new Sprite(); bloodBar.loadImage("../../res/cartoon2/blood_1_r.png"); bl...

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

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

...es() { //显示两只猩猩 ape1 = new Sprite(); ape2 = new Sprite(); ape1.loadImage("../../res/apes/monkey2.png"); ape2.loadImage("../../res/apes/monkey2.png"); ape1.pivot(55, 72); ape2.pivot(55, 72); ape1.pos(Laya.stage.width / 2, Laya.stage.height / 2); ape2.pos(200, 0); //一只猩猩在舞台...

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

4. 输入设备-摇一摇 [ 93%]

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

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

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

...色方块,不被抠图 var gameContainer = new Sprite(); gameContainer.loadImage("../../res/guide/crazy_snowball.png"); Laya.stage.addChild(gameContainer); // 引导所在容器 guideContainer = new Sprite(); // 设置容器为画布缓存 guideContainer.cacheAs = "bitmap"; Laya.stage.addChild(gui...

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

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

...ateApe(); applayFilter(); } function createApe() { ape = new Sprite(); ape.loadImage(apePath); var texture = Laya.loader.getRes(apePath); ape.x = (Laya.stage.width - texture.width) / 2; ape.y = (Laya.stage.height - texture.height) / 2; Laya.stage.addChild(ape); } function applayFilter() { //创建...

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

7. 滤镜-颜色滤镜 [ 88%]

...pe.y = secondChild.y; } function createApe() { var ape = new Sprite(); ape.loadImage("../../res/apes/monkey2.png"); Laya.stage.addChild(ape); return ape; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import ColorFilter = Laya.ColorFilter; import Texture = Laya.Texture;...

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

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

...232628"; createApe(); })(); function createApe() { ape = new Sprite(); ape.loadImage("../../res/apes/monkey2.png"); Laya.stage.addChild(ape); ape.pivot(55, 72); ape.x = Laya.stage.width / 2; ape.y = Laya.stage.height / 2; Laya.timer.frameLoop(1, this, animate); } function animate(e) { ape.rotation +...

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

9. Sprite-容器 [ 85%]

...4张猩猩图片 for (var i = 0; i < 4; i++) { var ape = new Sprite(); ape.loadImage("../../res/apes/monkey" + i + ".png"); ape.pivot(55, 72); // 以圆周排列猩猩 ape.pos( Math.cos(radianUnit * i) * layoutRadius, Math.sin(radianUnit * i) * layoutRadius); apesCtn.addChild(ape); } apesCtn.pos(Lay...

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

10. 鼠标交互-Hold [ 84%]

...})(); function createApe() { // 添加一只猩猩 ape = new Sprite(); ape.loadImage(apePath); var texture = Laya.loader.getRes(apePath); ape.pivot(texture.width / 2, texture.height / 2); ape.pos(Laya.stage.width / 2, Laya.stage.height / 2); ape.scale(0.8, 0.8); Laya.stage.addChild(ape); // 鼠标...

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