跳至主要內容

Class: language_manage

muzzik大约 1 分钟

index / language_manage

Class: language_manage

多语言管理器

Remarks

  • 多语言资源单位为模块,防止无用多语言资源堆积

  • 支持多语言(文本/图片/节点),三种方式满足任何需求

  • 支持编辑器预览

Hierarchy

Table of contents

Properties

Accessors

Methods

Properties

event

event: event_target<event_protocol>

事件

Defined in

assets/@framework/language/mk_language_manage.ts:38open in new window


label_data_tab

label_data_tab: Record<type_type, data_struct<any>>

文本数据

Defined in

assets/@framework/language/mk_language_manage.ts:40open in new window


texture_data_tab

texture_data_tab: Record<type_type, data_struct<any>>

纹理数据

Defined in

assets/@framework/language/mk_language_manage.ts:42open in new window

Accessors

type_s

get type_s(): "zh_cn" | "en_us"

当前语言类型

Returns

"zh_cn" | "en_us"

Defined in

assets/@framework/language/mk_language_manage.ts:45open in new window

set type_s(value_): void

Parameters

NameType
value_"zh_cn" | "en_us"

Returns

void

Defined in

assets/@framework/language/mk_language_manage.ts:49open in new window


data

get data(): type_data

获取语言数据

Returns

type_data

Defined in

assets/@framework/language/mk_language_manage.ts:54open in new window

Methods

get_label

get_label(type_, mark_s_, config_?): string

获取文本

Parameters

NameTypeDescription
type_type_type类型
mark_s_string标识
config_?Partial<label_config>配置

Returns

string

Defined in

assets/@framework/language/mk_language_manage.ts:72open in new window


get_texture

get_texture(type_, mark_s_, target_, language_?): Promise<null | SpriteFrame>

获取纹理

Parameters

NameTypeDescription
type_type_type类型
mark_s_string标记
target_follow_release_object跟随释放对象
language_"zh_cn" | "en_us"语言

Returns

Promise<null | SpriteFrame>

Defined in

assets/@framework/language/mk_language_manage.ts:101open in new window


add_label

add_label(type_, data_): void

添加文本数据

Parameters

NameTypeDescription
type_type_type类型
data_data_struct<any>数据

Returns

void

Defined in

assets/@framework/language/mk_language_manage.ts:137open in new window


add_texture

add_texture(type_, data_): void

添加纹理数据

Parameters

NameTypeDescription
type_type_type类型
data_data_struct<any>数据

Returns

void

Defined in

assets/@framework/language/mk_language_manage.ts:149open in new window

📣 觉得很赞?分享给你的朋友吧!