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

大约有 1,155 项符合查询结果, 库内数据总量为 30,903 项。 (搜索耗时: 0.0048 秒)

701. Laya.loader.load 教程代码出错 [ 64%]

...      }             Laya.loader.load(arr,Handler.create(this,LoadComplated));         }         private function LoadComplated(e:*=null):void         {             Laya.stage.addChild(img);             img.on("click",this,OnImgClick);...

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

702. texture2D的setPixel纹理rgba数据之后会随着窗口的缩放,渐变成黑色 [ 64%]

...Laya.Vector3(-1.0, -1.0, -1.0)); directionLight.transform.worldMatrix=mat; this.sprite3D = scene.addChild(new Laya.Sprite3D()) as Laya.Sprite3D; //正方体 var box = this.sprite3D.addChild(new Laya.MeshSprite3D(Laya.PrimitiveMesh.createPlane())) as Laya.MeshSprite3D; this.box = box; box.transform.p...

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

703. 无法触发浏览器文件上传框 [ 64%]

...'images/button.png'; constructor() { Laya.init(200, 300); Laya.loader.load(this.skin, Laya.Handler.create(this, () => { this.btn = this.createBtn(this.skin); this.btn.on(Laya.Event.CLICK, this, this.onClick); })); } /** * 创建btn */ private createBtn(skin: string): Laya.Button { let button = ne...

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

704. 使用loadImage加载一个图片后的点击事件 [ 64%]

...age.addChild(ape); ape.loadImage(img,360, 300, 60, 60, Laya.Handler.create(this, function(){         ape.on(Laya.Event.CLICK, this, function(){         console.log(111)     }) }));使用这段代码加载了一个60x60大小的图片(下图中骑马的那个人物),并且在加载完...

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

705. 我给加载进来的UI界面中一个图片,添加点击更换图片的事件,需要点击两次才能更换图片 [ 64%]

...样的。你这样调整下就行了: function showui() { showui.super(this); var arr2 = new Array(); arr2.push(this.dimg); this.dimg.on(Laya.Event.CLICK, this,apeclick2, arr2); } function apeclick2(that) { console.log("apeclick sucess"); that.skin = "../img/5.jpg"; console.log(that); that.zOrder ...

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

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

...,使用对方的变量? 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

707. 官方文档里的位图字体的制作与使用JS 跑不通 以及 文档的几个问题 [ 64%]

...个位图字体教程的代码应该放在哪里,怎么引用,其中的this是指? 我自建了单独的文件,并在Main里import了它,输出看是undefined。   5.几处的路径不一致,它们的关系是?  a.如图:把test_0.png名字改为test.png,保证跟fnt文件同名。...

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

708. 自己画的view不支持鼠标点击吗? [ 64%]

...1=new View(); btn_1.graphics.drawPath(0, 0, path, {fillStyle: "#123456"}); this.addChild(btn_1); btn_1.mouseEnabled=true; btn_1.on(Event.MOUSE_DOWN, this, onClickBt1);     不管怎么点,在这个点击方法里面是不会执行的  2018-07-09 添加评论 免费帖 --> 分享 微博 QZONE ...

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

709. 刮刮卡效果实现 [ 64%]

... var interactionArea; var ape; var mouseX = 0; _proto.onInit = function(){ this.guaSpr.cacheAs = "bitmap"; ape = new Sprite(); this.guaSpr.addChild(ape); ape.loadImage("WBSign/img_guakaituceng.png"); ape.on(Event.MOUSE_MOVE, this, onMouseMove); interactionArea = new Sprite(); interactionArea.blendMo...

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

710. Pool 使用 Laya.Prefab [ 64%]

...aya.Prefab; let box: Laya.Sprite = Laya.Pool.getItemByCreateFun("ItemBox", this._control.targetBox.create, this._control.targetBox); 运行报错: Cannot read property 'create' of undefined targetBox又在 control里面引用一个Prefab 2019-08-26 添加评论 免费帖 --> 分享 微博 QZONE 微...

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