HumanBreak/src/types/icon.d.ts

72 lines
1.4 KiB
TypeScript
Raw Normal View History

type IconIds =
| keyof MaterialIcon['animates']
| keyof MaterialIcon['autotile']
| keyof MaterialIcon['enemy48']
| keyof MaterialIcon['enemys']
| keyof MaterialIcon['hero']
| keyof MaterialIcon['items']
| keyof MaterialIcon['items']
| keyof MaterialIcon['npc48']
| keyof MaterialIcon['npcs']
| keyof MaterialIcon['terrains'];
2022-11-13 18:02:05 +08:00
interface IconOffsetInfo {
/**
* id
*/
image: string;
/**
*
*/
x: number;
/**
*
*/
y: number;
}
/**
*
*/
interface Icons {
/**
*
*/
readonly icons: MaterialIcon;
/**
*
*/
readonly tilesetStartOffset: 10000;
2022-11-13 18:02:05 +08:00
/**
* id
*/
readonly allIconIds: IconIds;
2022-11-13 18:02:05 +08:00
/**
*
*/
getIcons(): MaterialIcon;
2022-11-16 23:01:23 +08:00
/**
* ID获得图块类型
2022-11-16 23:01:23 +08:00
*/
getClsFromId<T extends AllIds>(id: T): ClsOf<T>;
/**
* ID
*/
getAllIconIds(): IconIds;
/**
* ID获得所在的tileset和坐标信息
* @param id id
*/
getTilesetOffset(id: string | number): IconOffsetInfo | null;
2022-11-13 18:02:05 +08:00
}
declare const icons: new () => Icons;