Skip to content

Commit

Permalink
added a texture.sourceFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodBoyDigital committed Mar 13, 2024
1 parent f1139aa commit 2adc4b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rendering/renderers/shared/texture/Texture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class Texture extends EventEmitter<{
* @returns The texture based on the Id provided
*/
public static from: (id: TextureSourceLike, skipCache?: boolean) => Texture;
public static sourceFrom: (id: TextureSourceLike, skipCache?: boolean) => TextureSource;

/** label used for debugging */
public label?: string;
Expand Down
2 changes: 2 additions & 0 deletions src/rendering/renderers/shared/texture/utils/textureFrom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@ export function textureFrom(id: TextureSourceLike, skipCache = false): Texture
}

Texture.from = textureFrom;
Texture.sourceFrom = (id: TextureSourceLike, skipCache = false) =>
textureFrom(id, skipCache)._source;

0 comments on commit 2adc4b7

Please sign in to comment.