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

大约有 2,033 项符合查询结果, 库内数据总量为 31,624 项。 (搜索耗时: 0.0056 秒)

1031. Sprite的destroy [ 72%]

Sprite的destroy destroyChildren() { if (this._children) { for (var i = 0, n = this._children.length; i < n; i++) { this._children[0].destroy(true); } } 这几行代码来自laya.core.js的12544行开始的,for循环里的this._children[0]是不是应该是this._children[i]?还是我的使用...

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

1032. 是不BMFONT不支持多类型资源加载方式? [ 72%]

...", type: Laya.Loader.FONT }); Laya.loader.load(assets, Laya.Handler.create(this, onAssetsLoaded)); function onAssetsLoaded(){ var bitmapFont = new Laya.BitmapFont(); bitmapFont.loadFont("res/fontWord.fnt"); //必出错 }     只要使用 Laya.Loader.FONT 必出错  难道是要改成 Laya.Loade...

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

1033. LoginView.super(this);这样调用的父类的构造函数的方法,不能用吗 [ 72%]

LoginView.super(this);这样调用的父类的构造函数的方法,不能用吗 LoginView.super(this);这是在教学视频里用的方法,好像不能用了。 这些layaair中特别的语法规则在哪里统一可以找到 var LoginView = function () {     LoginView.super(this);     t...

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

1034. BlinnPhong材质详解(JavaScript-3D基础(JS)-模型材质详解) [ 72%]

...aya.Texture2D.load("res/threeDimen/texture/earth.png", Laya.Handler.create(this, function(texture) { //设置材质纹理 material.albedoTexture = texture; })); earth2.meshRenderer.material = material; ``` ![](img/4.png)(图4) ##### 法线贴图 **Normal maps(法线贴图)**是一个灰度图,可...

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

1035. 图集打包后使用Texture不显示啊 [ 72%]

...start.json", type: Loader.ATLAS}); Laya.loader.load(assets, Handler.create(this, this.onComplete)); } private onComplete(): void { } } new GameMain();   ================================================================================================ json文件和代码都贴上来了 2017-03-29 添...

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

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

...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

1037. Sprite loadImage 的时候出现多张图片同时显示 [ 72%]

Sprite loadImage 的时候出现多张图片同时显示 this.img.graphics.clear(); var imgUrl = (this.flag = !this.flag)? this.imgUrl1 :this.imgUrl2; this.img.loadImage(imgUrl,100,50); 简单的点击sprite切换图片,结果会出现两张图片同时显示的情况 附件 : --> 2018-04-04 添...

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

1038. htmlCanvas 像素级操作 [ 72%]

...owSprite() { Laya.loader.load("../src/img/testImg.png",Laya.Handler.create(this,graphicsImg)); } function graphicsImg() { //临时sprite var img = new Laya.Sprite(); //img.graphics.drawTexture(Laya.loader.getRes(("../src/img/testImg.png"),0,0)); //获取图片资源 var tex = Laya.loader.getRes("../...

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

1039. 在 tiledmap 插入一个精灵在上面 [ 72%]

...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

1040. 鼠标事件:为什么没有设置穿透,也会发生穿透现象? [ 72%]

... bg = CreateObj.createSprite(McUrlMgr.LOAD_BG_Path);             this.addChild(bg);             bg.x = 0;             bg.y = 0;                          var bg2:Sprite = CreateObj.createSprite(McUrlMgr.LOAD_BG_Path);             bg2.x = 0;    ...

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