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

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

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

...mg.width / 2, compassImg.height / 2); compassImg.pos(Laya.stage.width / 2, 400); } function drawUI() { var canvas = new Sprite(); Laya.stage.addChild(canvas); canvas.graphics.drawLine(compassImg.x, 50, compassImg.x, 182, "#FFFFFF", 3); canvas.graphics.drawLine(-140 + compassImg.x, compassImg.y, 140 ...

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

2. UI-Tab [ 95%]

..."]; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(550, 400, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Laya.stage.bgColor = "#3d3d3d"; Laya.loader.load(skins, ...

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

3. UI-Input [ 89%]

...nput = new TextInput(); ti.skin = skin; ti.size(300, 50); ti.sizeGrid = "0,40,0,40"; ti.font = "Arial"; ti.fontSize = 30; ti.bold = true; ti.color = "#606368"; Laya.stage.addChild(ti); return ti; } } } new laya.UI_Input();package { import laya.display.Stage; import laya.ui.TextInput; import laya.uti...

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

4. 文本-自动换行 [ 85%]

...发者提供HTML5开发技术方案!"; txt.width = 300; txt.fontSize = 40; txt.color = "#ffffff"; //设置文本为多行文本 txt.wordWrap = true; txt.x = Laya.stage.width - txt.textWidth >> 1; txt.y = Laya.stage.height - txt.textHeight >> 1; Laya.stage.addChild(txt); } })();module laya { import...

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

5. 文本-复杂的文本样式 [ 83%]

...ML5开发技术方案!"; //设置宽度,高度自动匹配 txt.width = 400; //自动换行 txt.wordWrap = true; txt.align = "center"; txt.fontSize = 40; txt.font = "Microsoft YaHei"; txt.color = "#ff0000"; txt.bold = true; txt.leading = 5; //设置描边属性 txt.stroke = 2; txt.strokeColor = "...

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

6. 射线检测-放置物体 [ 82%]

...Laya.Browser.clientWidth / 2.5, 100); label.fontSize = 50; label.color = "#40FF40"; Laya.stage.addChild(label); var _position = new Laya.Vector3(0, 0, 0); var _offset = new Laya.Vector3(0, 0.25, 0); //鼠标事件 Laya.stage.on(Laya.Event.MOUSE_UP, this, function () { if (_outHitInfo.distance !== -1...

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

7. 高级应用-寻路导航 [ 80%]

...MeshAndHeightMap(meshSprite3D.meshFilter.sharedMesh, heightMap, 6.574996471405029, 10.000000953674316); //更新terrainSprite世界矩阵(为可行走区域世界矩阵) this.terrainSprite.transform.worldMatrix = meshSprite3D.transform.worldMatrix; //给terrainSprite添加PathFind组件 var pathFing...

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

8. 射线检测-点击行走 [ 79%]

...Laya.Browser.clientWidth / 2.5, 100); label.fontSize = 50; label.color = "#40FF40"; Laya.stage.addChild(label); var _offset = new Laya.Vector3(0, 0.25, 0); var _upVector3 = new Laya.Vector3(0, 1, 0); var _vector3 = new Laya.Vector3(); //鼠标事件 Laya.stage.on(Laya.Event.MOUSE_UP, this, function ...

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

9. 其他引擎的Demo-Example_23 [ 77%]

...Y = pos1.y - pos2.y; var dist = Math.sqrt(distX * distX + distY * distY) + 40; laser.scaleX = dist / 20; laser.pos(pos1.x, pos1.y); laser.pivotY = 43 / 2; laser.blendMode = "lighter"; laser.rotation = (Math.atan2(distY, distX) + Math.PI) * 180 / Math.PI; lasers.push(laser); Laya.stage.addChild(laser...

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

10. 射线检测-选取物体 [ 76%]

...Laya.Browser.clientWidth / 2.5, 100); label.fontSize = 50; label.color = "#40FF40"; Laya.stage.addChild(label); //鼠标事件 Laya.stage.on(Laya.Event.MOUSE_UP, this, function () { var str = ""; for (var i = 0; i ; private camera: Laya.Camera; private label: Laya.Label; constructor() { Laya3D.init(...

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