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

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

1. Sprite-遮罩-放大镜 [ 100%]

...r.create(this, setup)); })(); function setup() { var bg = new Sprite(); bg.loadImage("../../res/bg2.png"); Laya.stage.addChild(bg); bg2 = new Sprite(); bg2.loadImage("../../res/bg2.png"); Laya.stage.addChild(bg2); bg2.scale(3, 3); //创建mask maskSp = new Sprite(); maskSp.loadImage("../../res/mask....

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

2. Sprite-显示图片 [ 96%]

...olor = "#232628"; showApe(); })(); function showApe() { // 方法1:使用loadImage var ape = new Sprite(); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); // 方法2:使用drawTexture Laya.loader.load("../../res/apes/monkey2.png", Handler.create(this, function() { var t = ...

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

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

...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

4. Sprite-轴心点 [ 94%]

...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

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

...色方块,不被抠图 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

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

...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

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

...caleMode = Stage.SCALE_NOBORDER; // create a background texture Laya.stage.loadImage("../../res/pixi/laserBG.jpg"); Laya.stage.frameLoop(1, this, animate); })(); function animate() { if (tick > frequency) { tick = 0; // iterate through the dudes and update the positions var laser = new Sprite(); las...

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

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

...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

9. Sprite-旋转缩放 [ 82%]

...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

10. 滤镜-发光滤镜 [ 81%]

...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