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

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

381. 【LIST无法拖动】参照官方实例做的 [ 65%]

...g.x = (list.width - paihangbang.fontSize * 3) / 2;         console.info(list.x + "---"+list.y + "---"+paihangbang.x + "---"+paihangbang.y + "---")         paihangbang.y -= (paihangbang.fontSize + 20);         paihangbang.color="#ffffff";          ...

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

382. 请问HtmlDivElement控件在innerHTML中有<div>标签的情况下获取实际宽高为0的问题? [ 65%]

...3'&gt;HTML文本&lt;/span&gt;"; html += "&lt;/div&gt;" p.innerHTML = html; console.log(p.contextWidth); //0 p.frameOnce(2,this,function(){ console.log(p.contextWidth); //0 }) } function showExternalHTML() { var p = new HTMLIframeElement(); Laya.stage.addChild(p); p.href = "../../res/html/test.html";...

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

383. LayaNative 2.8.0 加载的TTF字体不生效,附复现工程。 [ 65%]

...", Laya.Handler.create(this, (success) =&gt; {             console.log("2.8.0 字体加载是否成功:", success);             Laya.Text.defaultFont = "OPPOSANS-H";         }), null, Laya.Loader.TTF) 附件 : --> laya复现工程_2.6_.0和2_.8_.0_.zip 相...

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

384. 计时器-延迟调用 [ 65%]

...Later(this, this.onCallLater); } } onCallLater() { const Text = Laya.Text; console.log("onCallLater triggered"); let text = new Text(); text.font = "SimHei"; text.fontSize = 30; text.color = "#FFFFFF"; text.text = "打开控制台可见该函数仅触发了一次"; text.size(Laya.stage.width, Laya.s...

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

385. image在相应loaded的时候,无法正确获取高度 [ 65%]

...or() { super(); this.on('start', this, this.init); } private init():void { console.log("init", this.x, this.y, this.width, this.height, this.scaleX, this.scaleY); var createOption: any = { isStatic: false, }; this.matterBody = Matter.Bodies.rectangle(this.x, this.y, this.width, this.height, createOp...

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

386. 请问graphics.drawTexture(texture)中如何增加一个matrix,只显示图中的一个圆形区域 [ 65%]

...n(){ if(miniMap.complete==true){ var img = circle_image(miniMap,750,1334); console.log(miniMap); var miniMap1 = new Laya.Image(); miniMap1.loadImage(img); Laya.stage.addChild(miniMap1); } } miniMap.src=url;     function circle_image(img, oldImgWidth, oldImgHeight) { var width, height, canvas, cont...

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

387. matter中有没有类似于unity中的OnCollision碰撞检测函数呀,用js怎么写 [ 65%]

...', this.onCollision);   2.碰撞检测 private onCollision(event): void { console.log("碰撞了..");  var home = _gamePage._mainPage._playPage;  for(var i = 0; i &lt; event.pairs.length; i++) {  var pair = event.pairs[i];  if(!(pair.bodyA.label === 'gun' || pair.bodyB.label == "gun")) continue...

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

388. 微信小游戏分包实战(JavaScript-小游戏适配文档-微信小游戏) [ 65%]

...。示例代码如下: ```javascript loadTask.onProgressUpdate(res => { console.log('下载进度', res.progress) console.log('已经下载的数据长度', res.totalBytesWritten) console.log('预期需要下载的数据总长度', res.totalBytesExpectedToWrite) }) ``` 本篇文档主要是讲分...

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

389. 自定义组件时,设置组件子节点的image的skin时,路径为layaIde的路径而非项目路径 [ 65%]

... super.changeValue(); _proMask.scaleX = _value / _max; _proMask.repaint(); console.log("改变值: " + _proMask.scaleX); } /** *@inheritDoc */ override public function destroy(destroyChild:Boolean = true):void { super.destroy(destroyChild); _proMask &amp;&amp; _proMask.destroy(_proMask); _progress &...

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

390. 插件开发说明 · LayaAir3.4 · 引擎文档 · LAYABOX [ 65%]

...e.runNodeScript(node.id, node.getComponent("MyScript").id, "test", "abc"); console.log(ret); 3、自定义一个函数,并执行。例如: //下面是场景进程的代码 //注意:IEditorEnv.regClass是必须的 @IEditorEnv.regClass() export class TestSceneScript { //注意:this是当前的...

来源: Laya3.0_文档 发布时间: 20251010