mirror of
https://github.com/motajs/template.git
synced 2026-11-02 15:04:30 +08:00
feat: list 文件的配置类型定义
This commit is contained in:
1 parent
d1ebca0b16
commit
7fde97ff1e
5 files changed
+110
-312
No files matched your search
@@ -1,3 +1,5 @@
|
||||
//#region 渲染端主对象
|
||||
|
||||
export interface IClientContentDefaultConfig {
|
||||
/** 贴图列表中每一项的默认值 */
|
||||
readonly textureDefault: string;
|
||||
@@ -40,3 +42,58 @@ export interface IClientConfig {
|
||||
/** 初始状态下勇士使用的默认贴图 */
|
||||
readonly heroImage: string;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region 列表对象
|
||||
|
||||
export const enum TextureReadType {
|
||||
/** 把整张图片直接读取,不进行切分 */
|
||||
Full,
|
||||
/** 把整张图片按照网格切分,每格都是独立的图片素材 */
|
||||
Grid,
|
||||
/** 把整张图片按照网格切分,横向网格组成动画,纵向的组成独立的图片素材 */
|
||||
RowAnimate,
|
||||
/** 把整张图片按照网格切分,纵向网格组成动画,横向的组成独立的图片素材 */
|
||||
ColumnAnimate,
|
||||
/** 把整张图片按照网格切分,按照先从左到右,再从上到下的顺序组成动画 */
|
||||
ScanAnimate
|
||||
}
|
||||
|
||||
export const enum TextureUsage {
|
||||
/** 常规图片,不作任何特殊处理,一般是自定义图片 */
|
||||
CommonImage,
|
||||
/** 常规图块素材 */
|
||||
Tile,
|
||||
/** 图块集素材 */
|
||||
Tileset
|
||||
}
|
||||
|
||||
export interface IClientTextureListConfig {
|
||||
/** 素材图片名称,任何时候都可以通过此值获取指定素材的完整图片 */
|
||||
readonly source: string;
|
||||
/** 素材的读取方式 */
|
||||
readonly read: TextureReadType;
|
||||
/** 素材的使用方式 */
|
||||
readonly usage: TextureUsage;
|
||||
/** 素材使用网格切分时,每格的尺寸,如果不能整除素材尺寸,那么会导致最右侧和最下侧尺寸不符参数 */
|
||||
readonly grid?: [width: number, height: number];
|
||||
/** 当素材的使用方式为 `Tile` 时,按照切分顺序排序的图块列表,切分顺序为从左到右,再从上到下 */
|
||||
readonly tiles?: number[];
|
||||
}
|
||||
|
||||
export const enum ClientAudioType {
|
||||
/** 背景音乐,背景音乐或懒加载并进行内存管理 */
|
||||
BGM,
|
||||
/** 音效,音效会在游戏开头加载,且不会进行内存管理 */
|
||||
Sound
|
||||
}
|
||||
|
||||
export interface IClientAudioListConfig {
|
||||
/** 音频类型 */
|
||||
readonly type: ClientAudioType;
|
||||
/** 音频文件名称 */
|
||||
readonly source: string;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
Reference in new issue
Block a user