Compare commits

...

2 Commits

Author SHA1 Message Date
AncTe
f8baf9cb25
Merge dc98244a08 into 820dc5bf4c 2025-10-24 11:21:05 +00:00
dc98244a08 feat: TextureStore 根据别名获取 id 2025-10-24 19:20:51 +08:00
3 changed files with 11 additions and 1 deletions

View File

@ -99,4 +99,8 @@ export class TextureStore implements ITextureStore {
aliasOf(identifier: number): string | undefined { aliasOf(identifier: number): string | undefined {
return this.aliasInvMap.get(identifier); return this.aliasInvMap.get(identifier);
} }
identifierOf(alias: string): number | undefined {
return this.aliasMap.get(alias);
}
} }

View File

@ -110,7 +110,7 @@ export class TextureMaxRectsStreamComposer
readonly maxWidth: number, readonly maxWidth: number,
readonly maxHeight: number, readonly maxHeight: number,
readonly padding: number, readonly padding: number,
options: IOption options?: IOption
) { ) {
this.packer = new MaxRectsPacker<MaxRectsRectangle>( this.packer = new MaxRectsPacker<MaxRectsRectangle>(
this.maxWidth, this.maxWidth,

View File

@ -219,6 +219,12 @@ export interface ITextureStore {
*/ */
fromAlias(alias: string): ITexture | null; fromAlias(alias: string): ITexture | null;
/**
* id
* @param alias
*/
identifierOf(alias: string): number | undefined;
/** /**
* id `undefined` * id `undefined`
* @param texture * @param texture