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

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

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

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

3. 滤镜-模糊滤镜 [ 94%]

...his, createApe)); })(); function createApe() { var ape = new Sprite(); ape.loadImage(apePath); ape.x = (Laya.stage.width - ape.width) / 2; ape.y = (Laya.stage.height - ape.height) / 2; Laya.stage.addChild(ape); applayFilter(ape); } function applayFilter(ape) { var blurFilter = new BlurFilter(); blur...

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

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

5. 输入设备-摇一摇 [ 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_示例 发布时间: 20240929

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

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

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

...eApe(); showDragRegion(); } function createApe() { ape = new Sprite(); ape.loadImage(ApePath); Laya.stage.addChild(ape); var texture = Laya.loader.getRes(ApePath); ape.pivot(texture.width / 2, texture.height / 2); ape.x = Laya.stage.width / 2; ape.y = Laya.stage.height / 2; ape.on(Event.MOUSE_DOWN, ...

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

9. 滤镜-颜色滤镜 [ 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_示例 发布时间: 20240929

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