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

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

251. 怎么裁剪一张图片 [ 87%]

...请: 与内容相关的链接 提交 1 个回复 Laya_Aaron 赞同来自: texture类里有 create 方法    /**          * 根据指定资源和坐标、宽高、偏移量等创建 <code>Texture</code> 对象。          * @param   source 绘图资源 img 或者 Text...

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

252. layaAir如何实现for循环加载多张图片,并且通过事件按比例缩小 [ 87%]

...       }         }         private function onAssetLoaded(texture:Texture):void         {             var ape:Sprite = new Sprite;             ape.x=(apesCtn._childs.length)*(stageWidth/4)             var bl:Number=texture.width/texture.height     ...

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

253. 舞台上有个label,我能通过截图保存成图片么 [ 87%]

...is,function():void{ var htmlC:HTMLCanvas=sp.drawToCanvas(200,200,0,0); var texture:Texture=new Texture(htmlC); var sp2:Sprite=new Sprite(); sp2.graphics.drawTexture(texture,100,100,100,100); sp2.pos(300,0); Laya.stage.addChild(sp2); })注意加个延迟,1-2帧左右即可! 2018-04-03 0 0 分享 ...

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

254. 一个关于getPixels的问题 [ 87%]

...下: Main.js: const Sprite = Laya.Sprite; const Text = Laya.Text; const Texture = Laya.TextureLaya.init(800, 600);  var txt = new Text(); txt.pos(200, 200); txt.color = "#FFFFFF"; txt.text = "000000"; Laya.stage.addChild(txt);  var spr = new Sprite(); spr.size(50, 50); Laya.stage.addChild(sp...

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

255. 分享:Dragonbones/Spine的换肤操作 [ 87%]

...准备好的图片放置项目资源目录下,并预加载资源,获取texture 准备好的图片head3.png 放置资源目录下 获取texture Laya.loader.load('head3.png',Handler.create(this,onTextureLoaded)); } private var texture:Texture; private function onTextureLoaded():void { texture=Load...

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

256. webgl 模式下 用graphics.drawTexture 平铺图片 图片不显示是什么原因 [ 87%]

webgl 模式下 用graphics.drawTexture 平铺图片 图片不显示是什么原因 this.texture1 = Laya.loader.getRes('res/images/bg1.png'); this.texture2 = Laya.loader.getRes('res/images/bg2.png'); var repeatX = 8 ; var repeatCount = Math.ceil(stageW / repeatX); for(let i = 0; i < repeatCount ...

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

257. laya.ani.bone.canvasmesh.MeshData_API3.0 [ 87%]

...erarchy MeshData SkinMeshForGraphic Index Properties canvasPadding indexes texture useUvTransform uvTransform uvs vertices Methods getBounds Properties canvasPadding canvasPadding: number = 1 Defined in laya/ani/bone/canvasmesh/MeshData.ts:43 扩展像素,用来去除黑边 indexes indexes: Uint16Ar...

来源: Laya3.0_api 发布时间: 20231115

258. drawToCanvas无法截取到有子元素。 [ 87%]

...nvas = htmlCanvas.getCanvas(); trace(canvas.toDataURL('image/png')); const texture = new Laya.Texture(htmlCanvas); const sp = new Sprite(); sp.graphics.drawTexture(texture); this.shot.addChild(sp);对,是可以的。当时drawToCanvas的第一个参数设置小了,没看到后面的元素。 这...

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

259. laya.particle.ParticleTemplateBase [ 87%]

...置数据 ParticleTemplateBaseProtected Properties PropertyDefined By  texture : Texture 粒子贴图 ParticleTemplateBasePublic Methods  MethodDefined By  ParticleTemplateBase() 创建一个新的 ParticleTemplateBase 类实例。 ParticleTemplateBase  addParticleArray(position:Float32Array...

来源: laya_api 发布时间: 20170929

260. laya.display.cmd.DrawImageCmd [ 87%]

...ropertyDefined By  height : Number (可选)高度。 DrawImageCmd  texture : Texture 纹理。 DrawImageCmd  width : Number (可选)宽度。 DrawImageCmd  x : Number (可选)X轴偏移量。 DrawImageCmd  y : Number (可选)Y轴偏移量。 DrawImageCmdPublic Methods  Met...

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