大约有 31 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0026 秒)
...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_示例 发布时间: 20241117
...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_示例 发布时间: 20241117
...项目(排列成 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_示例 发布时间: 20241117
...类对应的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_示例 发布时间: 20241117
...开发更高效。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_示例 发布时间: 20241117
...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_示例 发布时间: 20241117
...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_示例 发布时间: 20241117
...项目开发更高效。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_示例 发布时间: 20241117
...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_示例 发布时间: 20241117
...texture Laya.stage.loadImage("res/pixi/laserBG.jpg"); Laya.stage.frameLoop(1, this, this.animate); } animate() { const Sprite = Laya.Sprite, Point = Laya.Point; let laser; if (tick > frequency) { tick = 0; // iterate through the dudes and update the positions laser = new Sprite(); laser.loadImage("r...
来源: Laya2.0_示例 发布时间: 20241117