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

大约有 1,873 项符合查询结果, 库内数据总量为 31,580 项。 (搜索耗时: 0.0060 秒)

881. 请问一下,怎么将下面这段AS3代码翻译成LayaAir的API [ 68%]

...te_:Sprite = new Sprite(); var bitmap_:BitmapData = new BitmapData(_loader.width, _loader.height); bitmap_.draw(_loader, new Matrix()); var matrix:Matrix = new Matrix(); matrix.rotate(Math.PI/4); sprite_.graphics.beginBitmapFill(bitmap_, matrix, true); sprite_.graphics.drawRect(100, 50, 200, 90); sp...

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

882. laya.ui.Image [ 68%]

...read-only] 对象的显示高度(以像素为单位)。 Sprite displayWidth : Number[read-only] 对象的显示宽度(以像素为单位)。 Sprite drawCallOptimize : BooleanSprite filters : Array滤镜集合。可以设置多个滤镜组合。Sprite globalRotation : Number[read-only] ...

来源: Laya2.0_api 发布时间: 20190513

883. Sprite.drawToCanvas方法有bug,同一个sprite对象子节点发生变化重新画的时候生成的数据出错 [ 68%]

...候生成的数据出错 var htmlCanvas1:HTMLCanvas = bg.drawToCanvas(bg.width, bg.height,0,0); var canvas:* = htmlCanvas1.getCanvas(); var imgData:String = canvas.toDataURL("image/jpeg"); 代码是这样的,情况是我这个bg内的子节点发生变化后重新生成图片的base64数据的时...

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

884. [LayaAir3]3D场景里面鼠标感应区域 3.2.1跟3.3不同 [ 68%]

...高为舞台大小,这样才不会拉伸变形 this.spRole.texture.sourceWidth = Laya.stage.width; this.spRole.texture.sourceHeight = Laya.stage.height; //添加2D精灵, this.owner.addChild(this.spRole); this.spRole.pos(0, 0); this.spRole.size(Laya.stage.width, Laya.stage.height); }); 2025-01-0...

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

885. List anchor问题 [ 68%]

...-02 23:14 好的 zjw917329684 • 2017-06-02 23:16 是不是因为我没写width和height啊? cuixueying • 2017-06-03 13:40 你试下,应该不是,list的width和height是自动生成的,我没有手动去改! zjw917329684 • 2017-06-02 17:03 看楼下 zjw917329684 • 2017-06-01 21:43 ...

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

886. 我想问下如果要调用手机本地相册,能不能用HTMLDivElement?该怎么用 [ 68%]

...ile" /> <span>上传文件</span> </label> <canvas width="300" height="300" id="canvas"></canvas> </body> <script> $("#file").change(function (){ var file = new FileReader();//读取文件2进制 file.onload = function(e){ var base64 = e.target.result; va...

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

887. CPU优化方式(ActionScript-2D进阶篇(AS3)-性能优化) [ 68%]

...0, 0, 0, 0, Handler.create(this, function() {     console.log(sp.width, sp.height); })); Laya.stage.addChild(sp); ``` ​ loadImage在加载完成的回调函数触发之后才可以正确获取宽高。 3. **直接调用size设置:** ```javascript Laya.loader.load("res/apes/monkey2.png"...

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

888. 2D网格渲染器 · LayaAir3.3 · 引擎文档 · LAYABOX [ 68%]

...一个矩形网格的写法, /** * 生成一个矩形2D网格 * @param width 矩形的宽度 * @param height 矩形的高度 */ private generateRectVerticesAndUV(width: number, height: number): Laya.Mesh2D { const vertices = new Float32Array(4 * 5); const indices = new Uint16Array(2 * 3); let inde...

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

889. 文本对齐与自动换行(ActionScript-LayaAir基础篇(AS3)-文本) [ 68%]

...设置文本区背景 txt.bgColor = "#c30c30"; //设置文本的宽高 txt.width = 400; txt.height = 400; //设置文本水平居中 txt.align = "center"; //设置文本垂直居中 txt.valign = "middle"; Laya.stage.addChild(txt); } } } ``` ![5](img/5.png) 在实际编码中如果需要其他的对...

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

890. laya.ui.FontClip [ 68%]

...的高度,与 clipY 同时设置时优先级高于 clipY 。 Clip clipWidth : Number 横向分割时每个切片的宽度,与 clipX 同时设置时优先级高于 clipX 。 Clip clipX : intX轴(横向)切片数量。Clip clipY : intY轴(竖向)切片数量。Clip customRenderEnable : Boo...

来源: Laya2.0_api 发布时间: 20190513