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

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

1. 性能测试-骨骼 [ 100%]

...ngX, mSpacingY, mAnimationArray = [], mFactory, mActionIndex = 0; class PerformanceTest_Skeleton { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler, Loader = Laya.Loader; // 不支持WebGL时自动切换至Canvas Laya.init...

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

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

...一个食物 this.produceFood(); } initSnake() { const Point = Laya.Point; for (let i = 0; i 0) { let prevSeg = segments[segments.length - 1]; seg.rotation = prevSeg.rotation; let point = seg.getPinPosition(); seg.x = prevSeg.x - point.x; seg.y = prevSeg.y - point.y; } segments.push(seg); } animate(...

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

3. 其他引擎的Demo-Example_05 [ 95%]

...tion setup() { Laya.stage.on(Event.RESIZE, this, onResize); makeObject(0); for (var i = 0; i objs) { current = 0; } makeObject(current); } function makeObject(t) { var xd; var i; switch (t) { case 0: for (i = 0; i tpoint1[i]) { tpoint1[i] = tpoint1[i] + 1; } if (points1[i] tpoint2[i]) { tpoint2[i] =...

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

4. 缓动-逐字缓动 [ 93%]

...w >> 1; let endY = Laya.stage.height / 2 - 50; let demoString = "LayaBox"; for (let i = 0, len = demoString.length; i > 1; var endY: number = Laya.stage.height / 2 - 50; var demoString: string = "LayaBox"; for (var i: number = 0, len: number = demoString.length; i > 1; var endY:int = Laya.stage.heig...

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

5. UI-CheckBox [ 93%]

...eate(this, this.onCheckBoxSkinLoaded)); } onCheckBoxSkinLoaded() { let cb; for (let i = 0; i ; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(800, 600, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOW...

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

6. 网络和格式-Socket [ 92%]

...onstrate "); // 使用output.writeByte发送 let message = "demonstrate "; for (let i = 0; i "); // 使用output.writeByte发送 var message: string = "demonstrate "; for (var i: number = 0; i "); // 使用output.writeByte发送 var message:String = "demonstrate "; for (var i:int = 0; i < message.le...

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

7. 网络和格式-XML [ 90%]

...ren(xml) { let rootNode = xml.firstChild; let nodes = rootNode.childNodes; for (let i = 0; i item aitem bsomethis..."; var xmlValue:string = "item aitem bsomethings..."; this.proessXML(xmlValueContainsError); console.log("\n"); this.proessXML(xmlValue); } // 使用xml private proessXML(source:string...

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

8. 2D物理-碰撞事件与传感器 [ 87%]

...nsorCollider.radius = 100; sensorCollider.x = 450; sensorCollider.y = 300; for (let i = 0, len = this.count; i = []; private touching: Array = []; constructor(maincls: typeof Main) { this.Main = maincls; Laya.Config.isAntialias = true; Laya.init(1200, 700, WebGL); Stat.show(); Physics.enable(); Phys...

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

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

... extraSpace = 50, moveSpeed = 2, rotateSpeed = 2, characterGroup; class PerformanceTest_Cartoon { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler, Loader = Laya.Loader; // 不支持WebGL时自动切换至Canvas Laya.init(...

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

10. 计时器-延迟调用 [ 86%]

...ge.bgColor = "#232628"; Stat.show(); this.demonstrate(); } demonstrate() { for (let i = 0; i < 10; i++) { Laya.timer.callLater(this, this.onCallLater); } } onCallLater() { const Text = Laya.Text; console.log("onCallLater triggered"); let text = new Text(); text.font = "SimHei"; text.fontSize = 30; t...

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