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

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

441. 在 tiledmap 插入一个精灵在上面 [ 93%]

...ap; private sp:Laya.Sprite;   constructor(){   console.info("start");   this.init(); } init():void{   Laya.init(800, 700, Laya.WebGL);   Laya.loader.load("res/atlas/images.atlas",Laya.Handler.create(this,this.onLoaded),null,Laya.Loader.ATLAS); }   onLoaded(){   console.info("onLoaded");   th...

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

442. CPU优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 93%]

...,可以使用局部变量来保存它: ```typescript foo() { var prop=this.target.prop; //使用prop this.process1(prop); this.process2(prop); this.process3(prop); } ``` ### 二、计时器 LayaAir提供两种计时器循环来执行代码块。 1. `Laya.timer.frameLoop`执行频率依赖于帧...

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

443. UI-Slider [ 93%]

...er.png", "res/ui/vslider$bar.png"); Laya.loader.load(skins, Handler.create(this, this.onLoadComplete)); } onLoadComplete() { this.placeHSlider(); this.placeVSlider(); } placeHSlider() { const HSlider = Laya.HSlider, Handler = Laya.Handler; let hs = new HSlider("res/ui/hslider.png"); Laya.stage.addCh...

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

444. unity导出的3D动画模型,导入 laya环境报错: node._setParent is not a function [ 93%]

...play(); chrome 调试:  addChild(node) {             if (!node || this.destroyed || node === this)                 return node;             if (node._zOrder)                 this._setBit(Const.HAS_ZORDER, true);             if (node._parent === this) {       ...

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

445. UI-CheckBox [ 93%]

..., "../../res/ui/checkbox (6).png"]; Laya.loader.load(skins, Handler.create(this, onCheckBoxSkinLoaded)); })(); function onCheckBoxSkinLoaded() { var cb; for (var i = 0; i ; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(800, 600, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; L...

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

446. 关于下拉列表 [ 93%]

...拉列表 真的,真是服LAYA,哎,搞了我一晚上,真心不行 this.small_map.selectHandler = new Laya.Handler(this, onSelect_small); this.big_map.selectHandler = new Laya.Handler(this, onSelect_big); function onSelect_small(e) { Laya.big_switch = 0 Laya.maptype = "small" this.now_map.te...

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

447. laya中的截屏在WebGL下为什么无效呢? [ 93%]

...如些简单,且行之有效。 以下是 egret中截屏的关键代码 this._bmpSnap = new egret.Bitmap; this._bmpSnap.x = L.GAP_UNIFIED; this._bmpSnap.y = this._contMotion.y + L.H_CLIP + L.GAP_UNIFIED; this.addChild( this._bmpSnap ); /// 快照特效 this._shapeSnapEffect = new egret.Shape; this...

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

448. Sprite-旋转缩放 [ 93%]

...ya.stage.width / 2; ape.y = Laya.stage.height / 2; Laya.timer.frameLoop(1, this, animate); } function animate(e) { ape.rotation += 2; //心跳缩放 scaleDelta += 0.02; var scaleValue = Math.sin(scaleDelta); ape.scale(scaleValue, scaleValue); } })();module laya { import Sprite = Laya.Sprite; import ...

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

449. 摄像机不在原点的时候3D空间转2D空间会失效? [ 93%]

...3D空间转2D空间”实现了一下3D坐标转2D坐标,过程如下: this.point.elements[0] = Laya.stage.mouseX; this.point.elements[1] = Laya.stage.mouseY; this.camera.viewportPointToRay(this.point, this.ray); Laya.Physics.rayCast(this.ray, this._outHitInfo) 然后: this.camera.viewport.pro...

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

450. 事件函数作用域问题 [ 93%]

事件函数作用域问题 1. this.btn_Login.on(Laya.Event.CLICK, null, ()=>{ if (this.loginDig) { this.loginDig.removeSelf(); this.loginDig.destroy(); } 2.this.btn_ok.on(Laya.Event.RIGHT_CLICK, this, this.OnBut_Open); OnBut_Open() : void { this.removeSelf(); this.destroy(); } 就是这两个...

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