大约有 1,584 项符合查询结果, 库内数据总量为 31,580 项。 (搜索耗时: 0.0052 秒)
Laya_社区(1113) Laya2.0_文档(231) Laya_示例(108) Laya2.0_示例(69) Laya3.0_文档(50) Laya3.0_api(11) Laya2.0_api(2)
...log("播放音乐"); SoundManager.playMusic("../../res/sounds/bgm.mp3", 1, new Handler(this, this.onComplete)); } private onPlaySound(e: Event): void { console.log("播放音效"); Sound...
来源: Laya_社区 发布时间: 20201203
...度图 高度图的预加载: {url: "res/heightMap.png", clas:Texture2D, priority:1, params:[true]} 场景中初始化MeshTerrainSprite3D: //通过场景中子父级节点寻找可行走区域网格模型 var ...
来源: Laya_社区 发布时间: 20170505
...stener('message', function (e) { var xmlreq = new XMLHttpRequest(); xmlreq.responseType = "text"; xmlreq.onload = function (e) { var data = e.currentTarget.response; self.postMessage(data); } xmlreq.open("get","res/atlas/comp.json"); xmlreq.send() }, false); ``` 这个例子是在worker中进行加...
来源: Laya2.0_文档 发布时间: 20210715
...载预制体之前先加载动画需要的图片资源,资源一般再 res/atlas里面 代码如下 Laya.loader.load(["res/atlas/zombie/z2.atlas"],Laya.Handler.create(this,function(){ Laya.loader.load("prefab/gk2v1.json",Laya.Handler.create(this,function(pref:Laya.Prefab){ var gkpref:Laya.Prefa...
来源: Laya_社区 发布时间: 20201022
...7-848524d9beb6/timg.jpg') // console.log(123120, ape) // Laya.loader.load('res/mao.jpg', Laya.Handler.create(this, function (){ // var t = Laya.loader.getRes('res/mao.jpg') // console.log(t) // var a = new Laya.Sprite() // a.graphics.drawTexture(t, 0,0) // a.scaleX = 0.3 // a.scaleY = 0.4 // a.pos(0...
来源: Laya_社区 发布时间: 20180104
...动画图集,加载成功后执行回调方法 this.roleAni.loadAtlas("res/atlas/role.atlas",Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //添加到舞台 Laya.stage.addChild(this.roleAni); } } new AtlasAniDemo(); ``` 运行代码,如图5所示。动画已加载到舞台...
来源: Laya2.0_文档 发布时间: 20210715
...建背景1 bg1 = new Sprite(); //加载并显示背景图1 bg1.loadImage("res/background.png"); //把背景1添加到容器 box box.addChild(bg1); //创建背景2 bg2 = new Sprite(); //加载并显示背景图2 bg2.loadImage("res/background.png"); //设置背景图2的坐标 bg2.pos(0, -852); //把...
来源: Laya_社区 发布时间: 20160810
...de = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; assets = ["../../res/ui/dialog (1).png", "../../res/ui/close.png"]; Laya.loader.load(assets, Handler.create(this, onSkinLoadComplete)); })(); function onSkinLoadComplete() { var dialog = new Dialog(); var bg = new Image(assets[0]); dialog.add...
来源: Laya_社区 发布时间: 20170303
... Android: 工程目录下的assets/scripts/config.js IOS:工程目录下的resources/scripts/config.js config.js中的内容如下所示,开发者可以根据自己的需求进行修改: window.loadingView = new loadingView(); if(window.loadingView) { window.loadingView.loadingAutoClose=true;//t...
来源: Laya3.0_文档 发布时间: 20251010
...ght.shadow = true; directionLight.shadowDistance = 3; directionLight.shadowResolution = 2048; directionLight.shadowPSSMCount = 1; directionLight.shawowPCFType = 3; box.meshRender.receiveShadow = true; sphere.meshRender.castShadow = true; box 和 sphere 都是 Sprite3D 的,贴了2D贴图,为啥...
来源: Laya_社区 发布时间: 20170809