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

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

641. FontClip问题 [ 91%]

...置为竖型的图集。 现在问题来了。根据代码 for (var i=0,sz=this._valueArr.length;i < sz;i++){   var index=this._indexMap[this._valueArr.charAt(i)];   if (!this.sources[index])continue ;   texture=this.sources[index];   if (isHorizontal)this.graphics.drawTexture(texture,dX+...

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

642. 基于Cannon.js的物理系统(TypeScript-3D基础(TS)-LayaAir3D之物理系统) [ 91%]

...r中使用Cannon.js** - 1.创建盒型MeshSprite3D ```typescript var box = this.scene.addChild(new MeshSprite3D(PrimitiveMesh.createBox(sX, sY, sZ))); ``` - 2.为精灵添加CannonRigidbody3D组件 ```typescript var rigidBody = box.addComponent(CannonRigidbody3D); ``` - 3.设置碰撞器形状 ```ty...

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

643. 定义了var 但是this.xxx显示红色线 求指教 [ 91%]

定义了var 但是this.xxx显示红色线 求指教 2.0创建项目用js版本的话  非脚本模式的js代码里面能用this.xx的方式获取var变量 但是用ts脚本创建的方式this.xx(var变量)会提示红色线  无法编译通过  社区说的分离模式什么的我这边都试...

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

644. 图片添加点击事件 有的不生效 [ 91%]

...击事件 有的不生效 private init():void { //添加点击事件处理 this.v_btn_boy.on(Laya.Event.CLICK, this, this.onClickBtnBoy); this.v_btn_friend.on(Laya.Event.CLICK, this, this.onClickBtnFriend); this.v_btn_shop.on(Laya.Event.CLICK, this, this.onClickBtnShop); console.log("init main scene...

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

645. 设置pivot后,精灵位置显示位置不正确 [ 91%]

...a.init(2000, 1500); //设置舞台背景色 Laya.stage.bgColor = "#ffffff" this.sp = new Laya.Sprite(); let width = 660 let height = 420 this.sp.size(width, height) this.sp.pivot(Math.round(width / 2), Math.round(height / 2)) this.sp.graphics.drawCircle(0, 0, 5, "#000000") this.sp.graphics.drawRect(...

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

646. laya中js 如何实现Sprite类继承 [ 91%]

...决方法 主文件:a.js    组件文件:Role.js a.js文件代码: this.Role = new Role(); this.RoleMap = new Laya.Sprite(); this.RoleMap.size(Laya.stage.width, Laya.stage.height/2); Laya.stage.addChild(this.RoleMap); this.RoleMap.addChild(this.Role); this.Role.pivot(16,24);// 图片32x48 th...

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

647. UI-Slider [ 91%]

...", "../../res/ui/vslider$bar.png"); Laya.loader.load(skins, Handler.create(this, onLoadComplete)); })(); function onLoadComplete() { placeHSlider(); placeVSlider(); } function placeHSlider() { var hs = new HSlider(); hs.skin = "../../res/ui/hslider.png"; hs.width = 300; hs.pos(50, 170); hs.min = 0; ...

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

648. 2D物理-桥 [ 91%]

...E让项目开发更高效。class Physics_Physics_Bridge { constructor() { this.ecount = 30; Laya.Config.isAntialias = true; Laya.Laya.init(1200, 700, Laya.WebGL); Laya.Stat.show(); Laya.Physics.enable(); Laya.PhysicsDebugDraw.enable(); Laya.Laya.stage.alignV = Laya.Stage.ALIGN_MIDDLE; Laya.Laya.sta...

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

649. DialogManager怎么添加遮罩层 [ 91%]

...大礼包通用素材/通用素材/背景黑色蒙版.png",0,0,1600,1080); this.scTipsPg= new ScTpisUI(); console.log(this.scTipsPg.manager); this.scTipsPg.manager=dialogManager; this.scTipsPg.manager.maskLayer=sprite1; this.scTipsPg.popupCenter=false; this.scTipsPg.top=60; this.scTipsPg.right=-510;...

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

650. TiledMap.moveViewPort(x,y) 为嘛要传入负数 [ 91%]

...0,-100 这是为啥? 我强行加入了 -  就可以了  let tmapsp=this.tMap.mapSprite();         tmapsp.zOrder=1;         this.tMap.changeViewPort(-((Laya.stage.width-this.tMap.width)/2),-((Laya.stage.height-this.tMap.height)/2),this.tMap.width,this.tMap.height);      ...

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