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

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

181. Texture内存回收(ActionScript-2D进阶篇(AS3)-性能优化) [ 84%]

... import laya.utils.Stat; import laya.webgl.WebGL; public class ClearTextureResTest { private var sp:Sprite; public function ClearTextureResTest() { WebGL.enable(); Laya.init(1000, 800); //显示一个图片 sp = Sprite.fromImage("res/bg.jpg"); Laya.stage.addChild(sp); //显示一个动画 var ani:An...

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

182. 加载配置json文件不成功!json文件放在bin目录下的 [ 84%]

...son文件不成功!json文件放在bin目录下的   Laya.loader.load(["res/atlas/comp.atlas","res/atlas/popup.atlas","res/atlas/cartoon.atlas","res/atlas/miner.atlas","gameConf.json"],Laya.Handler.create(this,onloaded),null,null); 2018-07-23 添加评论 免费帖 --> 分享 微博 QZONE 微信 ...

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

183. 射线检测-选取物体 [ 84%]

...a.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); boxCollider.setFromBoundBox(plane.meshF...

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

184. Sprite-节点控制 [ 84%]

...只猩猩 ape1 = new Sprite(); ape2 = new Sprite(); ape1.loadImage("../../res/apes/monkey2.png"); ape2.loadImage("../../res/apes/monkey2.png"); ape1.pivot(55, 72); ape2.pivot(55, 72); ape1.pos(Laya.stage.width / 2, Laya.stage.height / 2); ape2.pos(200, 0); //一只猩猩在舞台上,另一只被...

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

185. 材质-BlinnPhong-反射贴图 [ 84%]

... new Laya.Vector3(1, 1, 1); var textureCube = Laya.TextureCube.load("../../res/threeDimen/skyBox/skyBox1/skyCube.ltc"); var skyBox = new Laya.SkyBox(); skyBox.textureCube = textureCube; camera.sky = skyBox; var teapot1 = scene.addChild(new Laya.MeshSprite3D(Laya.Mesh.load("../../res/threeDimen/stati...

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

186. 怎么加载网络上的图片 [ 84%]

...png",Laya.Handler.create(this,this.loadOver)); } loadOver():void{ let res = Laya.loader.getRes("game/texture.png"); console.log("res 加载成功?",res!=null) } 这样写,始终加载不出来,获取的res 始终为空,Layaair2.0

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

187. Sprite-轴心点 [ 83%]

...ion createApes() { var gap = 300; sp1 = new Sprite(); sp1.loadImage("../../res/apes/monkey2.png", 0, 0); sp1.pos((Laya.stage.width - gap) / 2, Laya.stage.height / 2); //设置轴心点为中心 sp1.pivot(55, 72); Laya.stage.addChild(sp1); //不设置轴心点默认为左上角 sp2 = new Sprite(); sp...

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

188. Sprite用graphics绘制图形后,mouse_over触发scale显示有问题 [ 83%]

...ate _initView():void { let sprite:Sprite = new Sprite(); sprite.loadImage("res/scene/1001/layer1/qiang.jpg", 100, 100, 100, 100); this.addChild(sprite); sprite = new Sprite(); sprite.graphics.drawCircle(100, 500, 50, "#0000ff"); //sprite.graphics.scale(2, 2); this.addChild(sprite); sprite = new Spri...

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

189. LayaIDE2.1资源发布目录更改后,版本生成的version.json有误! [ 83%]

...个文件夹A里比如,在项目设置里把资源发布目录改成bin/A/res/atlas,把index.html目录改成bin/A, 发布微信小游戏生成的version.json文件有问题,内容是"A/res/atlas/xxx.png":"A/res/atlas/xxx-xxxxxx.png" 正确的应该是 "res/atlas/xxx.png":"res/atlas/xxx-xxxxx...

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

190. Sprite-切换纹理 [ 83%]

... var Handler = Laya.Handler; var WebGL = Laya.WebGL; var texture1 = "../../res/apes/monkey2.png"; var texture2 = "../../res/apes/monkey3.png"; var flag = false; var ape; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.al...

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