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

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

1. Sprite-绘制各种形状 [ 100%]

...0], "#ff0000", 5); //画曲线 sp.graphics.drawCurves(352, 58, [0, 0, 19, -100, 39, 0, 58, 100, 78, 0, 97, -100, 117, 0, 136, 100, 156, 0], "#ff0000", 5); //画矩形 sp.graphics.drawRect(10, 166, 166, 90, "#ffff00"); //画多边形 sp.graphics.drawPoly(264, 166, [0, 0, 60, 0, 78.48, 57, 30, 93.48, ...

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

2. 缓动-时间线 [ 96%]

...nkey2.png"); Laya.stage.addChild(target); target.pivot(55, 72); target.pos(100,100); } function createTimerLine() { timeLine.addLabel("turnRight",0).to(target,{x:450, y:100, scaleX:0.5, scaleY:0.5},2000,null,0) .addLabel("turnDown",0).to(target,{x:450, y:300, scaleX:0.2, scaleY:1, alpha:1},2000,null...

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

3. 鼠标交互-修正交互区域 [ 95%]

...ar deepSkyblueRect = new Sprite(); deepSkyblueRect.graphics.drawRect(0, 0, 100, 100, "#00BFFF"); //设置名称 deepSkyblueRect.name = "天蓝色矩形"; //设置宽高(要接收鼠标事件必须设置宽高,否则不会被命中) deepSkyblueRect.size(100, 100); deepSkyblueRect.pos(10, 10); L...

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

4. 屏幕适配-对齐模式 [ 93%]

...更高效。(function() { var Stage = Laya.Stage; (function() { Laya.init(100, 100); Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.bgColor = "#232628"; })(); })();module laya { import Stage = Laya.Stage; export ...

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

5. 屏幕适配-缩放-No Scale [ 91%]

...unction createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); updateRectPos(); } function updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import St...

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

6. 屏幕适配-缩放-No Border [ 91%]

...unction createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); updateRectPos(); } function updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import St...

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

7. 屏幕适配-缩放-Show All [ 91%]

...unction createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); updateRectPos(); } function updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import St...

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

8. 屏幕适配-缩放-Extract Fit [ 91%]

...unction createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); updateRectPos(); } function updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import St...

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

9. 加载-多种类型资源加载 [ 90%]

...URE_PATH = "../../res/skeleton/robot/texture.png"; (function() { Laya.init(100, 100); var assets = []; assets.push( { url: ROBOT_DATA_PATH, type: Loader.BUFFER }); assets.push( { url: ROBOT_TEXTURE_PATH, type: Loader.IMAGE }); Laya.loader.load(assets, Handler.create(this, onAssetsLoaded)); })(); fun...

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

10. 物理引擎-牛顿摆 [ 89%]

...} function initWorld() { var cradle = Matter.Composites.newtonsCradle(280, 100, 5, 30, 200); Matter.World.add(engine.world, cradle); Matter.Body.translate(cradle.bodies[0], { x: -180, y: -100 }); cradle = Matter.Composites.newtonsCradle(280, 380, 7, 20, 140); Matter.World.add(engine.world, cradle); ...

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