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

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

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

...nsor(); } createSensor() { let ground = new Laya.Sprite(); Laya.Laya.stage.addChild(ground); let groundBody = new Laya.RigidBody(); groundBody.type = "static"; ground.addComponentIntance(groundBody); let chainCollider = ground.addComponent(Laya.ChainCollider); chainCollider.points = "50,400,50,600,1...

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

222. 鼠标交互-键盘交互 [ 86%]

...= "#FFFFFF"; logger.align = 'center'; logger.valign = 'middle'; Laya.stage.addChild(logger); } keyboardInspector() { let numKeyDown = keyDownList.length; let newText = '[ '; console.log(numKeyDown); for (let i = 0; i ; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clien...

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

223. 文本-位图字体 [ 86%]

...Text(fontName); } createText(font) { let txt = new Laya.Text(); Laya.stage.addChild(txt); txt.width = 250; txt.wordWrap = true; txt.text = "Do one thing at a time, and do well."; txt.font = font; // 文本的字体名称,以字符串形式表示 txt.leading = 5; // 垂直行间距 txt.pos(Laya.sta...

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

224. DrawPie例子中无法显示遮罩区域 [ 86%]

...})(); function showApe() { // 方法1:使用loadImage var p = Laya.stage.addChild(new Sprite()); var ape = new Sprite(); p.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); //创建遮罩对象 this.cMask = new Laya.Sprite(); //画一个圆形的遮罩区域 this.cMask.graphics.drawPie(8...

来源: Laya_社区 发布时间: 20180313

225. UI-ComboBox [ 86%]

...ox = new ComboBox(skin, "item0,item1,item2,item3,item4,item5"); Laya.stage.addChild(comboBox); comboBox.labelSize = 30; comboBox.itemSize = 25; comboBox.selectHandler = new Handler(this, this.onSelect, [comboBox]); return comboBox; } onSelect(cb) { console.log("选中了: " + cb.selectedLabel); } ...

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

226. 这样的panel请问如何实现比较好? [ 86%]

... var item = new Item(); item.pos(0, i * (item.height + 1)); this.container.addChild(item); } } }   3,加载资源,完成后再加载界面 import WebGL = Laya.WebGL; // 程序入口 class GameMain { constructor() { Laya.init(500, 1000, WebGL); Laya.stage.scaleMode = Laya.Stage.SCALE_FIXED_WIDTH; ...

来源: Laya_社区 发布时间: 20180810

227. 计时器-间隔循环 [ 86%]

...t.bold = true; t.pivot(t.width / 2, t.height / 2); t.pos(x, y); Laya.stage.addChild(t); return t; } function animateTimeBased() { rotateTimeBasedText.rotation += 1; } function animateFrameRateBased() { rotateFrameRateBasedText.rotation += 1; } })();module laya { import Stage = Laya.Stage; import Tex...

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

228. 3d下阴影渲染问题求解 [ 86%]

...0; i < 10; i++) { for (var j = 0; j < 10; j++) { // var box = parent.addChild(new Laya.MeshSprite3D(new Laya.PlaneMesh(boxSize,boxSize,2,2))); var box = parent.addChild(new Laya.MeshSprite3D(new Laya.BoxMesh(boxSize, boxSize, .5))); // var boxSys = new Zszen.BoxPlus(boxSize,boxSize,boxSize,"re...

来源: Laya_社区 发布时间: 20180117

229. Sprite3D添加组件或脚本(JavaScript-3D基础(JS)-LayaAir3D之精灵) [ 86%]

..., this.onComplete)); } onComplete(){ //记载场景 var scene = Laya.stage.addChild(new Laya.Scene3D()); //加载相机 var camera = scene.addChild(new Laya.Camera(0, 0.1, 100)); camera.transform.translate(new Laya.Vector3(0, 0.8, 1.5)); camera.transform.rotate(new Laya.Vector3(-15, 0, 0), true, fal...

来源: Laya2.0_文档 发布时间: 20210714

230. 克隆sprite [ 86%]

...                 tempImg.y = maxY;                 tempSpr.addChild(tempImg);             }              this.bg1.addChild(tempSpr);             if (data && data.turnOut == 1 && tempSpr) //翻转放上面             {                 ...

来源: Laya_社区 发布时间: 20170508