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

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

281. UI-Tab [ 84%]

...electedIndex); tab.selectHandler = new Handler(this, onSelect); Laya.stage.addChild(tab); return tab; } function onSelect(index) { console.log("当前选择的标签页索引为 " + index); } })();module laya { import Stage = Laya.Stage; import Tab = Laya.Tab; import Handler = Laya.Handler; import W...

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

282. BUG:添加RigidBody组件会使anchorX、anchorY失效 [ 84%]

... = sp.anchorY = 0.5; sp.pos(event.stageX, event.stageY); this.owner.parent.addChild(sp); }p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Hannotate SC'; -webkit-text-stroke: #000000} span.s1 {font-kerning: none}添加RigidBody组件后anchorX与anchorY失效,去掉sp.addComponentIntance(body)...

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

283. 计时器-延迟调用 [ 84%]

...wordWrap = true; text.valign = "middle"; text.align = "center"; Laya.stage.addChild(text); } } new Timer_CallLater();module laya { import Stage = Laya.Stage; import Text = Laya.Text; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Timer_CallLater { constructor() { // 不支持...

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

284. 绘制能力 · LayaAir3.3 · 引擎文档 · LAYABOX [ 84%]

...hics.drawRect(20, 20, 100, 50, "#ffff00", "#00ff00", 5, false); this.owner.addChild(sp); 示例中的 20,20 是矩形起始点坐标,100是向右的宽度,如果是负数则是向左的宽度。50是向下的高度,如果是负数则是向上的高度。 运行效果: (图2-3) 2.3 用d...

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

285. 动画-SWF动画 [ 84%]

..."; let MCWidth = 318, MCHeight = 406; let mc = new MovieClip(); Laya.stage.addChild(mc); mc.x = (Laya.stage.width - MCWidth) / 2; mc.y = (Laya.stage.height - MCHeight) / 2; mc.load(SWFPath); } } new Animation_SWF();module laya { import MovieClip = Laya.MovieClip; import Stage = Laya.Stage; import Br...

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

286. 物理引擎-牛顿摆 [ 84%]

...esize); } function initMatter() { var gameWorld = new Sprite(); Laya.stage.addChild(gameWorld); // 初始化物理引擎 engine = Matter.Engine.create( { enableSleeping: true }); Matter.Engine.run(engine); var render = LayaRender.create( { engine: engine, container: gameWorld, width: stageWidth, hei...

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

287. 3D场景跳转到2D场景问题 [ 84%]

... //创建胜利的UI界面 let victoryScene=new VictoryScene(); Laya.stage.addChild(victoryScene);   this.isDelete=true;  // console.log(Scene3DControl.GameSceneB);   } }结束界面跳转到3D场景 import {VictorySceneUI} from '../ui/layaMaxUI' import GameScene from './GameScene'; export defaul...

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

288. 源码List的一次代码错误 [ 84%]

... * cellWidth, (this._isVertical ? startY : 0) * cellHeight); this._content.addChild(cacheBox); this._content.optimizeScrollRect = true; box = cacheBox; } else { [b] var arr = []; [/b] for (var i = this._cells.length - 1; i > -1; i--) { var item = this._cells[i]; item.removeSelf(); arr.push(item);...

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

289. list item 添加事件后无法监听 [ 84%]

...5);     api_list_view.dataSource = createAPIList();     Laya.stage.addChild(api_list_view);   }   2018-07-24 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 2 个回复 Laya_Aaron 赞同来自: 问题描述具体一...

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

290. Sprite3D添加组件或脚本(TypeScript-3D基础(TS)-LayaAir3D之精灵) [ 84%]

..., 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_文档 发布时间: 20210715