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

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

1091. 两个构造函数怎么相互调用,使用对方的变量? [ 80%]

两个构造函数怎么相互调用,使用对方的变量? A.js:var A=(function(){ function A(){ this.a=0; } })(); var a=new A(); B.js: var B=(function(){ function B(){ this.b=1; } })(); 我想在B.js文件中用A.js的属性a,该怎么操作,请大神帮帮小...

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

1092. 给mesh添加物理组件就报错 [ 80%]

给mesh添加物理组件就报错 var mesh: Laya.MeshSprite3D = this.track._children[this.track.numChildren - 1]; var collider: Laya.PhysicsCollider = mesh.addComponent(Laya.PhysicsCollider);  var shape: Laya.MeshColliderShape = new Laya.MeshColliderShape(); shape.mesh = mesh.meshFilter.sharedMes...

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

1093. 最新版本IDE,如何获取http返回的json数据 [ 80%]

...rototype.onButtonLogin = function (){ console.log ('按了登录按钮')  var xhr = new Laya.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.once(Event.PROGRESS,this,processHandler);  var se...

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

1094. 老师,请问一下如何在js代码中,动态的创建一个按钮(或者图片、lable)并添加到一个box中? [ 80%]

...同来自: zhang92tong Box,label,image都可以通过代码来创建 var box=new Laya.Box(); var image=new Laya.Image(); image.skin='res/001.png'; var label=new  Laya.label(); label.text=' I am a  Label!' box.addChild(image); box.addChild(label); Laya.stage.addChild(box); 2017-04-21 1 3 分享...

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

1095. 动画添加了 滤镜,drawcall 次数暴增,这是为啥???? [ 80%]

动画添加了 滤镜,drawcall 次数暴增,这是为啥???? var url = App.animManager.getUrl(id); this.ani.loadAtlas(url,null,id); this.ani.alpha = 0.5; this.ani.play(0, true); var grayMat = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ]; //创建一个颜色滤镜对象...

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

1096. RenderTexture的像素读取(ActionScript-3D基础(AS3)-LayaAir3D之纹理) [ 80%]

...al as BlinnPhongMaterial).albedoTexture = renderTargetCamera.renderTarget; var boxMaterial:BlinnPhongMaterial = box.meshRenderer.material as BlinnPhongMaterial; //获取BlinnPhong材质的纹理 var tex:Texture2D = boxMaterial.albedoTexture as Texture2D; //获取相机渲染目标的像素数据,默...

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

1097. 为什么动态设置聚光灯朝向无效呢 [ 80%]

为什么动态设置聚光灯朝向无效呢 var tar = new Laya.Vector3(); var dir = new Laya.Vector3(); var src = model.transform.position; spotLight.transform.position = camera.transform.position; Laya.Vector3.subtract(src, camera.transform.position,tar); Laya.Vector3.normalize(tar, dir); spotLi...

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

1098. 为什么动态设置聚光灯朝向无效呢 [ 80%]

为什么动态设置聚光灯朝向无效呢 var tar = new Laya.Vector3(); var dir = new Laya.Vector3(); var src = model.transform.position; spotLight.transform.position = camera.transform.position; Laya.Vector3.subtract(src, camera.transform.position,tar); Laya.Vector3.normalize(tar, dir); spotLi...

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

1099. 直接new sprite 跟graphics.drawTexture 有什么区别 [ 80%]

直接new sprite 跟graphics.drawTexture 有什么区别 var downScoreTexture = Laya.loader.getRes("img/game/kc/score.png"); var _downScore = new Sprite(); _downScore.pos(150,130); _downScore.graphics.drawTexture(downScoreTexture); touPane.addChild(_downScore); 这个东西,跟 直接new sprite ...

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

1100. 关于微信小游戏关系链的问题 [ 80%]

...4000,this,function(){ console.log(Browser.window.sharedCanvas)       var rankTexture=new Texture(Browser.window.sharedCanvas);       rankTexture.bitmap.alwaysChange=true; console.log(rankTexture)       LayaUISample.scoreview.graphics.drawTexture(rankTexture,5,78,rankTexture.width,r...

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