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

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

21. 使用命名空间遇到的问题 [ 85%]

... QZONE 微信 nevercai 赞同来自: 你需要把命名空间也导出。 export namespace global2 { ......   在使用的地方import {global2} from "......"   BTW:这样的命名空间不好用,你多个文件同一个命名空间,你import的时候就会有问题。   你可以单独创...

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

22. 2.0 beta UI Button无法获取 [ 84%]

...import View=Laya.View; import Dialog=Laya.Dialog; import Scene=Laya.Scene; export module ui { export class AttackUI extends View { public btn_attack:Laya.Button; constructor(){ super()} createChildren():void { super.createChildren(); this.loadScene("Attack"); } } } 扩展UI代码:   import { ui }...

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

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

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

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

24. 请问下,分离模式里面扩展一个场景类,老是提示 Error: 'ui' is not exported [ 84%]

...分离模式里面扩展一个场景类,老是提示 Error: 'ui' is not exported 刚刚学laya不久,比较初级问题。最新的版本2.7创建一个2D的js的demo.然后选择分离模式。自动生成了一个TestSceneUI。 我现在想继承这个类,创建了TestSceneExtend,把自动...

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

25. layaMaxUI.ts的自动生成代码bug [ 84%]

...; import Dialog=Laya.Dialog; var REG: Function = Laya.ClassUtils.regClass; export module ui { export class MainSceneUI extends Laya.SceneBase { constructor(){ super()} createChildren():void { super.createChildren(); this.loadScene("MainScene"); } } REG("ui.MainSceneUI",MainSceneUI); } 期待生成Sc...

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

26. 使用typescript开发项目,解决文件引用顺序问题 [ 84%]

...文件引用顺序不正确,我今天试了下,可以使用ts的import/export处理这个问题 一、调试 修改tsconfig.json,把module和target都改为ES6,因为es6的语法和ts很像,调试的时候看es6就可以了,索性把sourceMap也关掉{ "compilerOptions": { "module": "ES6...

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

27. 用ts写代码 能用npm包吗 还有es6语法 [ 83%]

...语法,但是ES6请谨慎使用,目前的浏览器基本上都不支持export import的使用! 2017-09-23 0 4 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 zhishaofei3 相关问题 预设怎么在代码中使用 这样写的代码,T...

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

28. 设置滤镜(TypeScript-LayaAir基础篇(TS)-位图) [ 83%]

... = Laya.Browser; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class Main { private ApePath: string = "../../res/apes/monkey2.png"; private apeTexture: Texture; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); L...

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

29. 2.0 Beta3版本中,runtime脚本的的问题 [ 83%]

...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

30. 今天升级到2.0,有个问题搞懵逼了。求解 [ 83%]

...道这里我还的Import 20+次? 而且被导入文档 首行必须有 export default class******* 这升级后 怎么写起来更麻烦了?还是说我没找到简便方式?? 求解 图1: 图2   问题二: 例如1.9我可以这样使用带命名空间的文档,,但是由于2.0需...

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