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

大约有 12 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0025 秒)

1. 加载-单一类型资源加载 [ 100%]

...exture) { // 使用texture } function onAssetLoaded2() { var pic1 = Loader.getRes("../../res/apes/monkey0.png"); var pic2 = Loader.getRes("../../res/apes/monkey1.png"); var pic3 = Loader.getRes("../../res/apes/monkey2.png"); // 使用资源 } })();module laya { import Loader = Laya.Loader; import Te...

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

2. 加载-多种类型资源加载 [ 95%]

...onAssetsLoaded)); })(); function onAssetsLoaded() { var robotData = Loader.getRes(ROBOT_DATA_PATH); var robotTexture = Loader.getRes(ROBOT_TEXTURE_PATH); // 使用资源 } })();module laya { import Loader = Laya.Loader; import Handler = Laya.Handler; export class Loader_MultipleType { private ROBOT_...

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

3. 性能测试-骨骼 [ 89%]

...ssetsLoaded)); } init(); function onAssetsLoaded() { var tTexture = Loader.getRes(mTexturePath); var arraybuffer = Loader.getRes(mAniPath); mFactory = new Templet(); mFactory.on(Event.COMPLETE, this, parseComplete); mFactory.parseData(tTexture, arraybuffer, 10); } function parseComplete() { for (var...

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

4. Sprite-显示图片 [ 80%]

...s/apes/monkey2.png", Handler.create(this, function() { var t = Laya.loader.getRes("../../res/apes/monkey2.png"); var ape = new Sprite(); ape.graphics.drawTexture(t, 0, 0); Laya.stage.addChild(ape); ape.pos(200, 0); })); } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; imp...

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

5. 滤镜-发光滤镜 [ 78%]

...() { ape = new Sprite(); ape.loadImage(apePath); var texture = Laya.loader.getRes(apePath); ape.x = (Laya.stage.width - texture.width) / 2; ape.y = (Laya.stage.height - texture.height) / 2; Laya.stage.addChild(ape); } function applayFilter() { //创建一个发光滤镜 var glowFilter = new GlowFilt...

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

6. 性能测试-虫子(慎入) [ 78%]

...reLoaded)); })(); function onTextureLoaded() { maggotTexture = Laya.loader.getRes(texturePath); initMaggots(); Laya.timer.frameLoop(1, this, animate); } function initMaggots() { var maggotContainer; for (var i = 0; i wb.x + wb.width) x -= wb.width; if (y wb.y + wb.height) y -= wb.height; maggot.pos(...

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

7. Sprite-切换纹理 [ 77%]

... texture2; // 更换纹理 ape.graphics.clear(); var texture = Laya.loader.getRes(textureUrl); ape.graphics.drawTexture(texture, 0, 0); // 设置交互区域 ape.size(texture.width, texture.height); } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Texture = Laya.Te...

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

8. 鼠标交互-拖动 [ 74%]

...pe.loadImage(ApePath); Laya.stage.addChild(ape); var texture = Laya.loader.getRes(ApePath); ape.pivot(texture.width / 2, texture.height / 2); ape.x = Laya.stage.width / 2; ape.y = Laya.stage.height / 2; ape.on(Event.MOUSE_DOWN, this, onStartDrag); } function showDragRegion() { //拖动限制区域 v...

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

9. 高级应用-寻路导航 [ 72%]

...域模型隐藏 meshSprite3D.active = false; var heightMap = Laya.Loader.getRes("../../res/threeDimen/scene/TerrainScene/Assets/HeightMap.png"); //初始化MeshTerrainSprite3D this.terrainSprite = Laya.MeshTerrainSprite3D.createFromMeshAndHeightMap(meshSprite3D.meshFilter.sharedMesh, heightMap, 6.57...

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

10. 鼠标交互-Hold [ 70%]

...猩 ape = new Sprite(); ape.loadImage(apePath); var texture = Laya.loader.getRes(apePath); ape.pivot(texture.width / 2, texture.height / 2); ape.pos(Laya.stage.width / 2, Laya.stage.height / 2); ape.scale(0.8, 0.8); Laya.stage.addChild(ape); // 鼠标交互 ape.on(Event.MOUSE_DOWN, this, onApePress)...

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