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

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

51. LayaBox加载TiledMap地图和注意事项 [ 49%]

...们把左侧的菜单切换到代码模式。并在src目录中新建一个script文件夹,右键新建一个“新建模板文件”-》“新建脚本文件”。并编写如下代码。 [list=none] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/...

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

52. 2D聚光灯 · LayaAir3.4 · 引擎文档 · LAYABOX [ 49%]

...gClass, property } = Laya; @regClass() export class SpotLight extends Laya.Script { @property({ type: Laya.Sprite }) private spotLight: Laya.Sprite; //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { this.setSpotLight(); } // 创建聚光灯 setSpotLight(): void { this...

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

53. Steam扩展实例 · LayaAir3.4 · 引擎文档 · LAYABOX [ 48%]

...lt; } 最后,在LayaExtInit函数中,导出初始化功能,使得JavaScript代码可以调用这些原生功能。 extern "C" { LAYAEXTAPI void LayaExtInit(jsvm_env env, jsvm_value exp) { ... // 注册Steam初始化函数 jsvm_value fnInitSteam; jsvm_create_function(env, "initializeSteam", SIZ...

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

54. 类似古文显示方式脚本,文字垂直显示,可以控制显示速度出现打字效果等 [ 47%]

...果等  /**古文脚本 */ export default class TextAncient extends Laya.Script { /** @prop {name:text, tips:"显示文本", type:String, default:"hello world"}*/ public text: string = "hello world"; /** @prop {name:color, tips:"字符串类型示例", type:String, default:"#0000ff"}*/ public color...

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

55. 组件装饰器说明 · LayaAir3.4 · 引擎文档 · LAYABOX [ 47%]

...代码如下所示: const { regClass } = Laya; @regClass() export class Script extends Laya.Script { } 1.2 IDE中如何找到被识别的组件脚本 只有使用了@regClass()装饰器标识,才会被LayaAir3-IDE识别为自定义组件脚本,可以被节点(实体)所添加, 添加组...

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

56. LayaAir的组件化开发(TypeScript-IDE篇(TS)-组件化开发相关) [ 45%]

....html?version=2.9.0beta&type=Core&category=Component&class=laya.components.Script ### 三、Runtime与脚本的使用区别 LayaAir的组件化开发,核心就是Runtime类与Script(脚本组件)类的合理运用,生命周期方法的使用。 有不少开发者对IDE中的Runtime类和脚...

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

57. [LayaAirIDE3]咋么实现鼠标点击角色移动 [ 45%]

...roperty } = Laya; @regClass() export default class iceMonster extends Laya.Script { declare owner: Laya.Sprite; /** 用于兜底的 Animator2D(可选) */ private _animator: Laya.Animator2D; /** 承载 .mc 的动画播放器 */ private iceMonsterAni: Laya.Animation; /** 资源前缀 */ private re...

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

58. UI运行时 · LayaAir3.4 · 引擎文档 · LAYABOX [ 44%]

...击操作,IDE会弹窗提示创建UI组件脚本文件,默认是RuntimeScript.ts,开发者可以对其进行重命名,最后点击保存即可创建脚本。 (动图2-1) 可以看到,创建以后,除了生成RuntimeScript.ts之外,在项目工程中看到还多了一个 RuntimeScri...

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

59. 2D精灵光 · LayaAir3.4 · 引擎文档 · LAYABOX [ 44%]

...lass, property } = Laya; @regClass() export class SpriteLight extends Laya.Script { @property({type: Laya.Sprite}) private spriteLight: Laya.Sprite; @property({type: Laya.Sprite}) private directLight: Laya.Sprite; @property({type: Laya.Sprite}) private background: Laya.Sprite; //组件被启用后...

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

60. Spine渲染器 · LayaAir3.4 · 引擎文档 · LAYABOX [ 44%]

... { regClass, property } = Laya; @regClass() export class Demo extends Laya.Script { spine: Laya.Spine2DRenderNode; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { // 加载Spine动画数据资源(json文件),注意一定...

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