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

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

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

...TS项目,代码如下: ```typescript // 程序入口 class GameMain{ constructor() { //初始化引擎 Laya.init(1136,640); var sp = new Laya.Sprite(); var xhr = new Laya.HttpRequest(); xhr.once(Laya.Event.COMPLETE,this,this.completeHandler); xhr.once(Laya.Event.ERROR,this,this.errorHandler); xh...

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

862. 图集打包后使用Texture不显示,项目整个已经传上来了 [ 51%]

...ort Texture = Laya.Texture; import Handler = Laya.Handler; class GameMain{ constructor() { Laya.init(600,400); this.hahaha(); } private hahaha(): void { var assets: Array<any> = []; assets.push({ url: "res/start.json", type: Loader.ATLAS}); Laya.loader.load(assets, Handler.create(this, this.on...

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

863. [LayaAir 2.0] 如何用代码为Spirte添加2d物理特性 [ 51%]

...果class CollisionBoll extends Laya.Sprite { private _boll1:Laya.Sprite; constructor() { super(); //物理模块 this._boll1 = new Laya.Sprite(); this.addChild(this._boll1); this._boll1.x = 20; this._boll1.loadImage('comp/btn_close.png'); let box:laya.physics.BoxCollider = this._boll1.addComponent(l...

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

864. laya.resource.HTMLCanvas [ 51%]

...urce:*  [read-only] Implementation     public function get source():*Constructor DetailHTMLCanvas()Constructorpublic function HTMLCanvas(createCanvas:Boolean = false) 根据指定的类型,创建一个 HTMLCanvas 实例。 Parameters createCanvas:Boolean (default = false)Method Detail_getSou...

来源: Laya2.0_api 发布时间: 20190513

865. Laya2.7.1 射线提示rayCast未定义 [ 51%]

...提示rayCast未定义 export default class click3d extends Laya.Script3D{ constructor() { super(); //创建场景 this.scene = Laya.stage.addChild(new Laya.Scene3D()); //添加相机 this.camera = (this.scene.addChild(new Laya.Camera(0, 0.1, 100))); this.camera.transform.translate(new Laya.Vector3(...

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

866. 请问:Ts下如何实现打开照相机和系统图库的方法?IOS和Android [ 51%]

... // 程序入口 import UIButton = laya.ui.Button; class GameMain{     constructor()     {         Laya.init(600,400);         let body = laya.utils.Browser.document.body;         let input = laya.utils.Browser.createElement("input");         input.type = "file";  ...

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

867. Laya.timer.loop() 报错 Cannot read property 'loop' of null [ 51%]

...st 。 private n:number = 0; private x0:number = 0; private y0:number = 0; constructor(){super();} onEnable():void{ this.x = this.x0; this.y = this.y0; Laya.timer.loop(20, this, this.frameWork); // 每 20 ms 执行一次 } private frameWork():void{ this.y = this.y0 + 10 * (this.n % 3); alert("move "...

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

868. workerLoader问题 [ 51%]

workerLoader问题 版本:2.2.0beta1,ts_new 看代码 constructor(){ super();             this.worker = new Worker(WorkerLoader.workerPath); this.worker.onmessage = function(evt:any):void { //接收worker传过来的数据函数 (this as any as WorkerLoader).workerMessage(evt.data); } } 回...

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

869. 预设/场景的导出(TypeScript-3D基础(TS)-LayaAir3D之3D场景可视化编辑) [ 51%]

...弹脚本。 */ export default class GameUI extends ui.test.TestSceneUI { constructor(){ super(); //加载场景 Laya.Scene3D.load('LayaScene_test/Conventional/test.ls',Laya.Handler.create(this,this.onComplete)); } /** * 加载完成 */ private onComplete(scene:Laya.Scene3D):void{ // 将场景加到...

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

870. Image属性详解(TypeScript-IDE篇(TS)-IDE组件属性详解) [ 51%]

...ort Image = Laya.Image; import WebGL = Laya.WebGL; export class UI_Image { constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(550, 400, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgCo...

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