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

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

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

...图片的,而是通过Laya.Sprite绘制。 开发者也可以使用Laya.Texture的方式,通过Laya.Sprite的drawTexture方式渲染,代码如下: //创建一个url对象; var url:string = Laya.Browser.window.URL.createObjectURL(imgBlob); //加载URL获得HTMLImageElement Laya.loader.fetch...

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

92. CPU优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 81%]

...ader.load("res/apes/monkey2.png",Laya.Handler.create(this,function() { var texture=Laya.loader.getRes("res/apes/monkey2.png"); var sp=new Laya.Sprite(); sp.graphics.drawTexture(texture,0,0); sp.size(texture.width,texture.height); Laya.stage.addChild(sp); })); ``` 使用Graphics.drawTexture并不会...

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

93. 如何实现类似AS3下的BitmapData.draw去截取区域图片? [ 81%]

... 个回复 cuixueying 赞同来自: 1、譬如我有一张图片 2、通过TextureCreate创建package {     import laya.display.Sprite;     import laya.resource.Texture;     import laya.utils.Handler;     public class CupPhone     {         public function CupPhone()       ...

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

94. 图片显示好奇怪 [ 80%]

...',Handler.create(this,onLoaded)); } private function onLoaded():void { var texture:Texture=Loader.getRes('logo.png'); var sp:Sprite=new Sprite(); sp.graphics.clear();//把上次的绘制清除 sp.graphics.drawTexture(texture); Laya.stage.addChild(sp); } 2017-05-05 0 0 分享 微博 QZONE 微信 为...

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

95. 有关Laya3D碰撞检测疑问 [ 80%]

...eMat: Laya.StandardMaterial = new Laya.StandardMaterial(); planeMat.diffuseTexture = Laya.Texture2D.load("../../res/threeDimen/texture/layabox.png"); planeMat.albedo = new Laya.Vector4(0.9, 0.9, 0.9, 1); plane.meshRender.material = planeMat; var boxCollider = plane.addComponent(Laya.BoxCollider) as ...

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

96. 鼠标交互-Hold [ 80%]

... Sprite = Laya.Sprite; var Stage = Laya.Stage; var Event = Laya.Event; var Texture = Laya.Texture; var Browser = Laya.Browser; var Ease = Laya.Ease; var Handler = Laya.Handler; var Tween = Laya.Tween; var WebGL = Laya.WebGL; const HOLD_TRIGGER_TIME = 1000; const apePath = "../../res/apes/monkey2.png...

来源: Laya_示例 发布时间: 20251130

97. png使用base64显示异常 [ 80%]

...n () { // image.onload = null; // image.onerror = null; // var data = Laya.Texture2D._parse(image); // data._url = "sdfasf" // _this.onLoaded(data); img=HTMLImage.create(image.width,image.height,1); img.loadImageSource(image,true); img._setCreateURL(url); _this.onLoaded(img); }; var url = _this.arra...

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

98. 射线检测-放置物体 [ 80%]

... 6, 10, 10))); var planeMat = new Laya.StandardMaterial(); planeMat.diffuseTexture = Laya.Texture2D.load("../../res/threeDimen/texture/layabox.png"); planeMat.albedo = new Laya.Vector4(0.9, 0.9, 0.9, 1); plane.meshRender.material = planeMat; var meshCollider = plane.addComponent(Laya.MeshCollider); ...

来源: Laya_示例 发布时间: 20251130

99. 资源加载(ActionScript-3D基础(AS3)-LayaAir3D之资源加载) [ 80%]

...。 ![](img/2.png)(图2) #### 3. 纹理加载 ​ 加载单个纹理使用Texture2D.load方法。这里我们创建了一个正方体,并且将加载的纹理设置为他的纹理。这个操作实际上和3D简单示例的操作是相同的。 ```typescript //加载纹理 Texture2D.load("res/thre...

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

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

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