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

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

1. 网络和格式-ProtocolBuffer [ 100%]

...Browser = Laya.Browser; var Handler = Laya.Handler; var ProtoBuf = Browser.window.protobuf; Laya.init(550, 400); ProtoBuf.load("res/protobuf/awesome.proto", onAssetsLoaded); function onAssetsLoaded(err, root) { if (err) throw err; // Obtain a message type var AwesomeMessage = root.lookup("awesomepac...

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

2. 输入设备-地图 [ 91%]

...dChild(mapDiv); } initMap() { const Browser = Laya.Browser, BMap = Browser.window.BMap; // 初始化地图 map = new BMap.Map(mapDiv); // 禁用部分交互 //map.disableDragging(); map.disableKeyboard(); map.disableScrollWheelZoom(); map.disableDoubleClickZoom(); map.disablePinchToZoom(); // 初始...

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

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

...lider.x = 450; sensorCollider.y = 300; for (let i = 0, len = this.count; i window).box2d; // 遍历所有刚体 let bodys = this.bodys, body: RigidBody; for (let i = 0, len = this.count; i < len; i++) { body = bodys[i]; if (!this.touching[i]) { continue; } let bodyA: RigidBody = this.sensorCollider....

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

4. Sprite-屏幕截图 [ 73%]

...s.btnArr[index],this.nameArr[index],this._onclick,index); } this._canvas = window.document.getElementById("layaCanvas") as HTMLCanvasElement; this.aimSp = new Sprite(); this.aimSp.size(Browser.clientWidth/2,Browser.clientHeight/2); Laya.stage.addChild(this.aimSp); this.aimSp.graphics.drawRect(0,0,th...

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

5. 2D物理-碰撞过滤器 [ 67%]

...ript、TypeScript三种开发语言、LayaAirIDE让项目开发更高效。window.Laya=window.Laya||{}; (function (exports, Laya) { 'use strict'; class Physics_Physics_CollisionFiltering { constructor() { this.preMovementX = 0; this.preMovementY = 0; Laya.Config.isAntialias = true; Laya.Laya.init(12...

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

6. 2D物理-仿生机器人 [ 27%]

...der.points = "50,200,50,570,1050,570,1050,200"; // Balls for (let i = 1; i window).box2d; const wheelBody: RigidBody = this.wheel.getComponent(RigidBody); const chassisBody: RigidBody = this.chassis.getComponent(RigidBody); const p1 = [54 * s * this.scale, -61 * -1 * this.scale]; const p2 = [72 * s ...

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