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

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

1. 输入设备-指南针 [ 100%]

...r = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(700, 1024, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Laya.loader.load(compassImgPath, Handler.create(this, t...

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

2. 输入设备-贪吃蛇(重力感应) [ 99%]

...ANGE, this, this.monitorAccelerator); // 游戏循环 Laya.timer.frameLoop(1, this, this.animate); // 食物生产 Laya.timer.loop(3000, this, this.produceFood); // 游戏开始时有一个食物 this.produceFood(); } initSnake() { const Point = Laya.Point; for (let i = 0; i 0) { let prevSeg = segme...

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

3. 滤镜-颜色滤镜 [ 98%]

...项目(排列成 4 x 5 矩阵)组成的数组,红色 let redMat = [ 1, 0, 0, 0, 0, // R 0, 0, 0, 0, 0, // G 0, 0, 0, 0, 0, // B 0, 0, 0, 1, 0 // A ]; //创建一个颜色滤镜对象,红色 let redFilter = new ColorFilter(redMat); // 红色的猩猩 let redApe = this.createApe(); redApe.filter...

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

4. UI-Tree [ 97%]

...类对应的json对象: // {"child": [{"type": "Clip", "props": {"x": "13", "y": "0", "left": "12", "height": "24", "name": "selectBox", "skin": "ui/clip_selectBox.png", "right": "0", "clipY": "2"}}, {"type": "Clip", "props": {"y": "4", "x": "14", "name": "folder", "clipX": "1", "skin": "ui/clip_t...

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

5. 其他引擎的Demo-Example_04 [ 96%]

...开发更高效。const Browser = Laya.Browser; let starCount = 2500, sx = 1.0 + (Math.random() / 20), sy = 1.0 + (Math.random() / 20), stars = [], w = Browser.width, h = Browser.height, slideX = w / 2, slideY = h / 2, speedInfo; class PIXI_Example_04 { constructor() { const WebGL = Laya.WebGL, Stag...

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

6. 缓动-简单的Tween [ 93%]

...minalX = 200; let characterA = this.createCharacter("res/cartoonCharacters/1.png"); characterA.pivot(46.5, 50); characterA.y = 100; let characterB = this.createCharacter("res/cartoonCharacters/2.png"); characterB.pivot(34, 50); characterB.y = 250; Laya.stage.graphics.drawLine(terminalX, 0, terminalX...

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

7. 性能测试-虫子(慎入) [ 93%]

...项目开发更高效。let texturePath = "res/tinyMaggot.png", padding = 100, maggotAmount = 5000, tick = 0, maggots = [], wrapBounds, maggotTexture; class PerformanceTest_Maggots { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Lay...

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

8. 计时器-间隔循环 [ 93%]

...age.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { let vGap = 100; this.rotateTimeBasedText = this.createText("基于时间旋转", Laya.stage.width / 2, (Laya.stage.height - vGap) / 2); this.rotateFrameRateBasedText = this.createText("基于帧频旋转", this.rotateTimeBasedText.x, th...

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

9. 缓动-时间线 [ 93%]

...dImage("res/apes/monkey2.png"); this.target.pivot(55, 72); this.target.pos(100,100); } createTimerLine() { const TimeLine = Laya.TimeLine, Event = Laya.Event; this.timeLine = new TimeLine(); // addLabel(label:String, offset:Number) offset: 标签事件相对于上个动画的偏移时间(单位:...

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

10. 2D物理-复合碰撞器 [ 93%]

...tage.addChild(box); let boxBody = box.addComponent(Laya.RigidBody); let box1Shape = box.addComponent(Laya.BoxCollider); let box2Shape = box.addComponent(Laya.BoxCollider); let box3Shape = box.addComponent(Laya.BoxCollider); let box4Shape = box.addComponent(Laya.BoxCollider); box1Shape.width = width ...

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