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

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

261. 关于要自定shader的同学 [ 71%]

...戏中截屏当前sprite 的绘制 let new_texture = sprite.drawToCanvas(width, height, 0, 0) 这里的 width 和height 指的是当前的sprite在游戏中设置的大小 new_texture = ls.Texture.create(new_texture, 0, 0)   重新获取纹理然后将textureHost设置为new_texture sprite.shaderVa...

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

262. 不带格式后缀的图片无法成功加载 [ 71%]

...his, () => { let picTemp = Laya.Loader.getRes(url); console.log(picTemp.width) // undefined let nodee = new Laya.Sprite() nodee.texture = picTemp nodee.width = 500 nodee.height = 250 nodee.x = 100 nodee.y = 350 Laya.stage.addChild(nodee) }));上面这个图片无法正常显示,打印 texture ...

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

263. 图片不能按轴心旋转 [ 71%]

...",0,0,0,0,Handler.create(this,aa)); function aa(texture){ bg.pivot(texture.width,texture.height); bg.alpha = 1; bg.rotation = 10; } 2018-05-19 1 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 该问题目前已经被锁定, 无法添加新回复 发起人 智力猫 相关问...

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

264. 更新到1.7.6beta之后,HBox有bug [ 71%]

...laya.display.Sprite(); var img: laya.ui.Image = new laya.ui.Image(skin); s.width = img.width; s.height = img.height; s.addChild(img); hbox.addChild(s); } Laya.stage.addChild(hbox); } 2017-06-08 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 该问题目前已经被锁定, ...

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

265. 使用二进制图片 · LayaAir3.0文档 · LAYABOX [ 71%]

....then((res)=>{ //创建Texture2D var t2d: Texture2D = new Texture2D(res.width, res.height, TextureFormat.R8G8B8A8, false, false, true); t2d.setImageData(res, true, false); //创建Texture var texture: Texture = new Texture(t2d); let sp2:Sprite = new Sprite(); //使用Sprite对象的绘制纹理...

来源: Laya3.0_文档 发布时间: 20230303

266. 关于2d内的坐标转换问题 [ 70%]

...true); }globalPoint: 绿色框的坐标 -- 舞台中央坐标(Laya.stage.width*.5,Laya.stage.height*.5) localSp:黑框容器对象 直接带入上面方法即可,中央的坐标你只知道相对于绿色框的坐标,则需要转换一下,很简单: globalPoint = greenBox.localToGlobal(n...

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

267. LayaAir和原生DOM交互(TypeScript-2D进阶篇(TS)-扩展模块) [ 70%]

...t.createElement("div"); this.qrcode = new Laya.Browser.window.QRCode(div,{ width:100, height:100 }); var url:string = "http://layabox.com/"; this.qrcode.makeCode(url); Laya.stage.once("click",this,this.clickHandler); this.qrcodeSp = new Laya.Sprite(); Laya.stage.addChild(this.qrcodeSp); } private cl...

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

268. 用LayaAir引擎解析Tiled Map地图(TypeScript-2D进阶篇(TS)-扩展模块) [ 70%]

...ap:Laya.TiledMap; constructor() { //初始化舞台 Laya.init(Laya.Browser.width,Laya.Browser.height,Laya.WebGL); //创建TiledMap实例 this.tMap = new Laya.TiledMap(); //创建Rectangle实例,视口区域 var viewRect:Laya.Rectangle = new Laya.Rectangle(); //创建TiledMap地图 this.tMap.create...

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

269. 分享个用美术资源做位图文本的方法。。。 [ 70%]

...ER: string = "center"; constructor(jsonData: any,textureData: Laya.Texture,width: number,posType:string = "left"){ super(); this.width = width; this._posType = posType; this._jsonData = jsonData; this._imageData = textureData; } public set padding(v: number){ this._padding = v; this.setCharsPos(); }...

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

270. 九宫格问题sizeGrid [ 70%]

...置Image宽度怎么没效果呀  bgImg.sizeGrid = "20,20,20,20"; bgImg.width = 300; bgImg.height = 25; 2018-01-04 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 3 个回复 Laya_Aaron 赞同来自: 动态,这就是效果 ...

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