Class: language_manage
index / language_manage
Class: language_manage
多语言管理器
Remarks
多语言资源单位为模块,防止无用多语言资源堆积
支持多语言(文本/图片/节点),三种方式满足任何需求
支持编辑器预览
Hierarchy
↳
language_manage
Table of contents
Properties
Accessors
Methods
Properties
event
• event: event_target
<event_protocol
>
事件
Defined in
assets/@framework/language/mk_language_manage.ts:38
label_data_tab
• label_data_tab: Record
<type_type
, data_struct
<any
>>
文本数据
Defined in
assets/@framework/language/mk_language_manage.ts:40
texture_data_tab
• texture_data_tab: Record
<type_type
, data_struct
<any
>>
纹理数据
Defined in
assets/@framework/language/mk_language_manage.ts:42
Accessors
type_s
• get
type_s(): "zh_cn"
| "en_us"
当前语言类型
Returns
"zh_cn"
| "en_us"
Defined in
assets/@framework/language/mk_language_manage.ts:45
• set
type_s(value_
): void
Parameters
Name | Type |
---|---|
value_ | "zh_cn" | "en_us" |
Returns
void
Defined in
assets/@framework/language/mk_language_manage.ts:49
data
• get
data(): type_data
获取语言数据
Returns
type_data
Defined in
assets/@framework/language/mk_language_manage.ts:54
Methods
get_label
▸ get_label(type_
, mark_s_
, config_?
): string
获取文本
Parameters
Name | Type | Description |
---|---|---|
type_ | type_type | 类型 |
mark_s_ | string | 标识 |
config_? | Partial <label_config > | 配置 |
Returns
string
Defined in
assets/@framework/language/mk_language_manage.ts:72
get_texture
▸ get_texture(type_
, mark_s_
, target_
, language_?
): Promise
<null
| SpriteFrame
>
获取纹理
Parameters
Name | Type | Description |
---|---|---|
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:101
add_label
▸ add_label(type_
, data_
): void
添加文本数据
Parameters
Name | Type | Description |
---|---|---|
type_ | type_type | 类型 |
data_ | data_struct <any > | 数据 |
Returns
void
Defined in
assets/@framework/language/mk_language_manage.ts:137
add_texture
▸ add_texture(type_
, data_
): void
添加纹理数据
Parameters
Name | Type | Description |
---|---|---|
type_ | type_type | 类型 |
data_ | data_struct <any > | 数据 |
Returns
void