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

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

111. 分享:如何用代码创建自定义Tab组件 [ 62%]

...aAirDemo { public function LayaAirDemo() { Laya.init(Browser.width,Browser.height); Laya.stage.bgColor="#EEFFCC"; //预加载button的资源,用于tab的项皮肤 Laya.loader.load("button-4.png",Handler.create(this,onLoaded)); } private function onLoaded():void { //添加tab容器 var tab:Tab=new ...

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

112. textinput(type=password)手机打开华为安全键盘后,无法关闭(官网的例子) [ 61%]

...;     var SPACING = 100;     var INPUT_WIDTH = 300;     var INPUT_HEIGHT = 50;     var Y_OFFSET = 50;     var skins;     (function()     {         // 不支持WebGL时自动切换至Canvas         Laya.init(800, 600, WebGL);         Laya.stage.alignV = Stage.AL...

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

113. 画了一个封闭的曲线,获取鼠标点击处的像素,为何坐标对不上导致拿不到正确位置的Texture? [ 61%]

....mouseY); var tex:Texture = new Texture(hc); trace(tex.width + "---" + tex.height + "---" + getPixel(tex)); /*获取所画曲线鼠标点击处的像素,为何坐标对不上? 导致无法拿到正确位置的Texture*/ /*var spr:Sprite = new Sprite(); spr.graphics.drawTexture(tex); this.addChild...

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

114. 同一个Graphics里面绘制超过20000个矢量rect的情况下,Uncaught Error: IBQuadrangle count(之前发起的问题不知道为什么找不到) [ 61%]

...+) { if(count == 10000) { var htmlCanvas:HTMLCanvas = a.drawToCanvas(width,height,0,0); var texture:Texture = new Texture(htmlCanvas); var b:Sprite = new Sprite(); b.graphics.drawTexture(texture); a.graphics.clear(true); a.destroy(); a = b; } a.graphics.drawRect(10*i, 10*j, 10, 10, "#ff0000"); count...

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

115. hBox使用问题 [ 60%]

...i*(stageWidth/4) },1500,Ease.sineOut); var bl:Number=texture.width/texture.height ape.graphics.drawTexture(texture,0,0,stageWidth/4,stageWidth/4/bl); apesCtn.addChild(ape); } } 这种方法HBox布局不管用,是不是不能用graphics.drawTexture方法,如果用addChild方法加载Loader.getRes...

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

116. Laya List给子元素添加事件后,滚动事件被劫持了 [ 60%]

... 0; i <20; ++i) { let list = new Laya.Sprite(); list.width = 600 ; list.height = 155; list.loadImage('xxx.png'); //此处无论是这样给 list.on(Laya.Event.CLICK, this, () => { console.log(413132131) }) //还是在handler中去渲染,都会滚动不了 txArray.push(list);} storeTxList.arr...

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

117. CommandBuffer_Outline 每次 addCommandBuffer都会永久增加10Gpu,removed掉相机事件也不会减少 [ 60%]

...enderTexture = Laya.RenderTexture.createFromPool(viewPort.width,viewPort.height,Laya.RenderTextureFormat.R8G8B8A8,Laya.RenderTextureDepthFormat.DEPTHSTENCIL_NONE);         //将RenderTexture设置为渲染目标         buf.setRenderTarget(renderTexture);         //清楚...

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

118. 同一个Graphics里面绘制超过20000个矢量rect的情况下,Uncaught Error: IBQuadrangle count(带悬赏的每次都创建订单失败,之后在社区里面看不到) [ 59%]

...+) { if(count == 10000) { var htmlCanvas:HTMLCanvas = a.drawToCanvas(width,height,0,0); var texture:Texture = new Texture(htmlCanvas); var b:Sprite = new Sprite(); b.graphics.drawTexture(texture); a.graphics.clear(true); a.destroy(); a = b; } a.graphics.drawRect(10*i, 10*j, 10, 10, "#ff0000"); count...

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

119. 这样的panel请问如何实现比较好? [ 59%]

...(var i = 0; i < 10; i++) { var item = new Item(); item.pos(0, i * (item.height + 1)); this.container.addChild(item); } } }   3,加载资源,完成后再加载界面 import WebGL = Laya.WebGL; // 程序入口 class GameMain { constructor() { Laya.init(500, 1000, WebGL); Laya.stage.scaleMode = L...

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

120. 树状列表组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 59%]

..., 300); tree.x = (Laya.stage.width - tree.width) / 2; tree.y = (Laya.stage.height - tree.height) / 2; tree.bgColor = "#d25454"; this.owner.addChild(tree); } } class Item extends Laya.Box { constructor() { super(); this.right = 0; this.left = 0; var selectBox: Laya.Clip = new Laya.Clip("resources/tre...

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