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

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

1. 学会编写d.ts声明文件(TypeScript-IDE篇(TS)-代码模式基础) [ 100%]

... ```typescript //单模块 declare module '*.glsl' { const value: string; export default value; } declare module CANNON { //在声名的模块里定义类型 export class Demo { constructor( options: Object ); addScene( title: string, initfunc: Function ): void; restartCurrentScene(): void; } } //...

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

2. 插件开发说明 · LayaAir3.0文档 · LAYABOX [ 99%]

...代码 //注意:IEditorEnv.regClass是必须的 @IEditorEnv.regClass() export class TestSceneScript { //注意:this是当前的IEditorEnv.IGameScene对象,如果不需要,也可以省略这个声明 static test(this: IEditorEnv.IGameScene, msg: string) { console.log(msg); //hello return "ok"...

来源: Laya3.0_文档 发布时间: 20240918

3. 扩展脚本问题,麻烦帮看下 [ 97%]

扩展脚本问题,麻烦帮看下  module game { export class testbox extends Laya.Box { constructor(){ super(); console.log(this.getChildByName('btnName')) } } export class testImg extends Laya.Image { constructor(){ super(); console.log(this.getChildByName('name')) console.log(this) } } } 我...

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

4. 如何使用TS的命名空间(namespace)? [ 97%]

...ts文件,在文件内创建namespace,如下: namespace MyNamespace { export class MyClass { // TODO. } }在main.ts的构造函数中,总是报错,提示 MyNamespace is not defined, 但是,如果我不用新文件,把这段定义放在main.ts内,就不会报错,请问如何引用...

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

5. 新手入坑请教下各位大神关于LayaMaxUI问题 [ 96%]

...og; import Scene=Laya.Scene; var REG: Function = Laya.ClassUtils.regClass; export module ui.test { export class TestSceneUI extends Laya.Scene {         public scoreLbl:Laya.Label;         public tipLbll:Laya.Label; constructor(){ super()} createChildren():void { super.createChildren...

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

6. 定时器 · LayaAir3.0文档 · LAYABOX [ 93%]

...import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { //60帧后,图片的透明度变为0.5 Laya.timer.frameOnce(60, this, () => { this.Image.alpha = 0.5; }) } } 1.2 定时重复执行 (基于帧率) ...

来源: Laya3.0_文档 发布时间: 20230724

7. layaMaxUI.js export ui bug (影响编译) [ 92%]

layaMaxUI.js export ui bug (影响编译) [20:22:28] Error: Export 'ui' is not defined at error (D:\LayaAirIDE\resources\app\node_modules\rollup\dist\rollup.js:9402:30) at Module.error (D:\LayaAirIDE\resources\app\node_modules\rollup\dist\rollup.js:13340:9) at tryParse (D:\LayaAirIDE\resources\app\...

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

8. 2.0 Beta3版本中,runtime脚本的的问题 [ 92%]

...import View=Laya.View; import Dialog=Laya.Dialog; import Scene=Laya.Scene; export module ui { export class BGPageUI extends View { constructor(){ super()} createChildren():void { super.createChildren(); this.loadScene("BGPage"); } } export class MonkeyPageUI extends View { constructor(){ super()} cr...

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

9. Laya_API3.0 [ 92%]

...e layaair Options All Public Public/Protected All Inherited Externals Only exported Menu Globals "Laya" Laya Class Laya Laya 是全局对象的引用入口集。 Laya类引用了一些常用的全局对象,比如Laya.stage:舞台,Laya.timer:时间管理器,Laya.loader:加载管理器,...

来源: Laya3.0_api 发布时间: 20231115

10. ts项目 模块问题 [ 92%]

...s项目 模块问题 b文件写了个class ,怎么在a文件new classexport 显示未定义,require也用不了   //b文件 export default class player extends Laya.Sprite { constructor() { super(); this.pivot(this.width / 2, this.height / 2); this.graphics.drawRect(0, 0, this._size, this._...

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