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

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

161. 性能测试-虫子(慎入) [ 73%]

....stage.height + padding * 2); Laya.loader.load(texturePath, Handler.create(this, onTextureLoaded)); })(); function onTextureLoaded() { maggotTexture = Laya.loader.getRes(texturePath); initMaggots(); Laya.timer.frameLoop(1, this, animate); } function initMaggots() { var maggotContainer; for (var i = ...

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

162. 骨骼动画-换装 [ 73%]

...ineRes2/goblins.sk"; mFactory = new Templet(); mFactory.on(Event.COMPLETE, this, parseComplete); mFactory.on(Event.ERROR, this, onError); mFactory.loadAni(mAniPath); } function onError() { trace("error"); } function parseComplete() { //创建模式为1,可以启用换装 mArmature = mFactory.build...

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

163. 性能测试-虫子(慎入) [ 73%]

....stage.height + padding * 2); Laya.loader.load(texturePath, Handler.create(this, this.onTextureLoaded)); } onTextureLoaded() { maggotTexture = Laya.loader.getRes(texturePath); this.initMaggots(); Laya.timer.frameLoop(1, this, this.animate); } initMaggots() { let maggotContainer; for (let i = 0; i wb...

来源: Laya2.0_示例 发布时间: 20251130

164. 输入设备-摇一摇 [ 73%]

...ake() { Shake.instance.start(5, 500); Shake.instance.on(Laya.Event.CHANGE, this, onShake); console.text = '开始接收设备摇动\n'; } function onShake() { shakeCount++; console.text += "设备摇晃了" + shakeCount + "次\n"; if (shakeCount >= 3) { Shake.instance.stop(); console.text += "停止...

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

165. bitmap渲染问题 [ 73%]

..., 10); bmd2.copyPixels(bmd1, rect, pt); var bm1:Bitmap = new Bitmap(bmd1); this.addChild(bm1); var bm2:Bitmap = new Bitmap(bmd2); this.addChild(bm2); bm2.x = 50; trace(rect.width); trace(rect.height); 输出正常,不知道你那边是如何写的?

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

166. Sprite-轴心点 [ 73%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createApes(); } createApes() { const Sprite = Laya.Sprite; let monkey2Path = "res/apes/monkey2.png"; let gap = 150; this.ape1 = new Sprite(); Laya.stage.addChild(this.ape1); this.ape1.loadImage(monkey2Path); // 设置轴...

来源: Laya2.0_示例 发布时间: 20251130

167. 请问Tiledmap怎么取到指定格子的属性值 [ 73%]

...邀请: 与内容相关的链接 提交 3 个回复 dsk4120 赞同来自: this.pass_layer = this.tiledMap.getLayerByName("pass_layer");//获取通行层 var a = this.pass_layer.getTileData(x, y); var walkable = this.tiledMap.getTileProperties(0, a - 1, "walkable"); if (walkable === 1) { // 可行走...

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

168. 设置后box2d 的 worldRoot 后平移场景 物理世界原地不动 [ 73%]

... 是要模仿镜头移动功能吗,这样可以 onAwake() { const self = this; self.gameObj = self.owner as Laya.Sprite; Laya.Physics.I.worldRoot = self.gameObj; this.cameraRect = new Laya.Rectangle(0, 0, 2000, 1000); this.gameObj.scrollRect = this.cameraRect; } onUpdate() { this.cameraRect.x = th...

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

169. This image has just been released and needs to be restored now [ 73%]

This image has just been released and needs to be restored now 在native运行环境下,打开UI界面时加载的图片资源,在界面关闭时对其做clearTextureRes。 短时间内再次打开该界面就会出现这样的提示。请问这个提示是否有性能影响,该如何避免...

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

170. 加载-单一类型资源加载 [ 73%]

...类型资源 Laya.loader.load("../../res/apes/monkey0.png", Handler.create(this, onAssetLoaded1)); // 加载多张png类型资源 Laya.loader.load( ["../../res/apes/monkey0.png", "../../res/apes/monkey1.png", "../../res/apes/monkey2.png"], Handler.create(this, onAssetLoaded2)); })(); function onAsse...

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