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

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

1. 基础文本 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...1.4 脚本控制Text2. 代码创建Text基础文本(Text) Text继承于Sprite,是静态文本的基础组件。这里我们介绍一下Text专属的组件属性。 1. LayaAir IDE中使用Text 1.1 创建Text 如图1-1所示,可以在层级窗口中右键进行创建,也可以从小部件窗...

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

2. 显示文本组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 96%]

...s() export class LabelControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.Label } ) public lab: Laya.Label; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { th...

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

3. 输入文本组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 95%]

...export class TextInputControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.TextInput } ) public txtin: Laya.TextInput; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake():...

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

4. 多行输入文本组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 69%]

... export class TextAreaControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.TextArea } ) public txtarea: Laya.TextArea; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake():...

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

5. HTML文本 · LayaAir3.0文档 · LAYABOX [ 59%]

...src='res/boy.png'></img>"; */ export class HTMLDivElement extends Sprite { 下面我们通过一些示例代码来看看运行效果: 3.1 同一个文本中设置Bold、Font、FontSize、Color、下划线 【注意:目前不支持斜体、描边、span标签内嵌的方式】 示例如...

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

6. 文本进阶使用 · LayaAir3.3 · 引擎文档 · LAYABOX [ 55%]

...么选择呢。 其中Text是最基础的文本组件,他直接继承于Sprite,而Label继承于UIComponent再往上才是Sprite,从原理上,路径越短,性能自然越好。所以,比较简单的文本,当Text可以满足时,原则上优先使用Text,而Label由于属性非常...

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

7. 组件脚本的内置方法 · LayaAir3.3 · 引擎文档 · LAYABOX [ 46%]

...时执行 onUpdate(): void { //让持续盒子旋转 (this.owner as Laya.Sprite).rotation++; } //开始碰撞时执行 onTriggerEnter(other: any): void { var owner: Laya.Sprite = this.owner as Laya.Sprite; if (other.label === "buttle") { //碰撞到子弹后,增加积分,播放声音特效 if (t...

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