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

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

761. 屏幕方向:自动横屏与自动竖屏的设置详解(TypeScript-LayaAir基础篇(TS)-屏幕适配) [ 61%]

...图片资源可以用任意png资源替代,存放于`项目根目录/bin/res`目录下,注意要确保资源路径与资源名称正确。 #### screenModeDemo.ts 示例代码如下: ```javascript function showScreen(): void { //图片 var img:Laya.Image = new Laya.Image(); img.centerX = 0; img...

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

762. socket大型项目回调 [ 61%]

...g = 'js-websocket'; private JS_WS_CLIENT_VERSION:string = '0.0.5'; private RES_OK:number = 200; private RES_FAIL:number = 500; private RES_OLD_CLIENT:number = 501; private socket:Laya.Socket = null; private callbacks:any = {}; private handlers:any = {}; // Map from request id to route private routeM...

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

763. 图集动画(ActionScript-LayaAir基础篇(AS3)-动画基础) [ 61%]

...ublic class HelloLayabox { private const AniConfPath:String = "../../../../res/role.atlas"; private var roleAni:Animation; public function HelloLayabox() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; L...

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

764. 二进制图片(TypeScript-2D进阶篇(TS)-游戏加载策略) [ 60%]

...如下: ```javascript var xhr = new XMLHttpRequest(); xhr.open("get", "res/atlas/comp.png", true); xhr.responseType = "arraybuffer"; xhr.onload = function () { if (this.status == 200) { var blob = new Blob([this.response], { type: "image/png" }); var img = document.createElement("img"); img.onload...

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

765. 自定义shader-简单shader [ 60%]

...ar layaMonkey = scene.addChild(new Laya.MeshSprite3D(Laya.Mesh.load("../../res/threeDimen/skinModel/LayaMonkey/Assets/LayaMonkey/LayaMonkey-LayaMonkey.lm"))); layaMonkey.transform.localScale = new Laya.Vector3(0.3, 0.3, 0.3); layaMonkey.transform.rotation = new Laya.Quaternion(0.7071068, 0, 0, -0.70...

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

766. 二进制图片(ActionScript-2D进阶篇(AS3)-游戏加载策略) [ 60%]

...如下: ```javascript var xhr = new XMLHttpRequest(); xhr.open("get", "res/atlas/comp.png", true); xhr.responseType = "arraybuffer"; xhr.onload = function () { if (this.status == 200) { var blob = new Blob([this.response], { type: "image/png" }); var img = document.createElement("img"); img.onload...

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

767. SCALE_FIXED_WIDTH适配屏幕的问题 [ 60%]

...Component("ScaleButton", ScaleButton);             Laya.loader.load("res/atlas/com/loading.atlas", Laya.Handler.create(this, this.loadGame));         }         private loadGame(): void {             var resArray = [                 { url: "res/atlas/lobby/create_room.atla...

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

768. 设置适配SCALE_FIXED_WIDTH,结果少部分andriod机型不能正确适配屏幕 [ 60%]

...Component("ScaleButton", ScaleButton);             Laya.loader.load("res/atlas/com/loading.atlas", Laya.Handler.create(this, this.loadGame));         }         private loadGame(): void {             var resArray = [                 { url: "res/atlas/lobby/create_room.atla...

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

769. 屏幕方向:自动横屏与自动竖屏的设置详解(ActionScript-LayaAir基础篇(AS3)-屏幕适配) [ 60%]

...片资源可以用任意png资源替代,存放于`项目根目录/bin/h5/res`目录下,注意要确保资源路径与资源名称正确。 #### screenMode.as 示例代码如下: ```javascript package { import laya.display.Stage; import laya.ui.Image; import laya.ui.Label; import laya.webgl.Web...

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

770. LayaAir下如何分包? [ 60%]

...会有这样的需求) 那么 module.def 要这样写:  module:"../res/js/maingame" path:"modules\class\src"编译完成后,maingame.js 就不会被单独放置到 js目录下,而是放置到了 res/js 目录。     2017-07-31 0 0 分享 微博 QZONE 微信 sevennqi 赞同来自: 。。...

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