You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
🆙 Fix Gifts
This commit is contained in:
@@ -15,12 +15,48 @@ export class TextureUtils
|
|||||||
|
|
||||||
public static async generateImage(options: ExtractImageOptions | Container | Texture): Promise<HTMLImageElement>
|
public static async generateImage(options: ExtractImageOptions | Container | Texture): Promise<HTMLImageElement>
|
||||||
{
|
{
|
||||||
return this.getExtractor().image(options);
|
if(!options) return null;
|
||||||
|
|
||||||
|
if(options instanceof Texture)
|
||||||
|
{
|
||||||
|
if(options.destroyed || !options.source || options.source.destroyed) return null;
|
||||||
|
}
|
||||||
|
else if(options instanceof Container)
|
||||||
|
{
|
||||||
|
if(options.destroyed) return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return await this.getExtractor().image(options);
|
||||||
|
}
|
||||||
|
catch(e)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async generateImageUrl(options: ExtractImageOptions | Container | Texture): Promise<string>
|
public static async generateImageUrl(options: ExtractImageOptions | Container | Texture): Promise<string>
|
||||||
{
|
{
|
||||||
return this.getExtractor().base64(options);
|
if(!options) return null;
|
||||||
|
|
||||||
|
if(options instanceof Texture)
|
||||||
|
{
|
||||||
|
if(options.destroyed || !options.source || options.source.destroyed) return null;
|
||||||
|
}
|
||||||
|
else if(options instanceof Container)
|
||||||
|
{
|
||||||
|
if(options.destroyed) return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return await this.getExtractor().base64(options);
|
||||||
|
}
|
||||||
|
catch(e)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static generateCanvas(options: ExtractOptions | Container | Texture): ICanvas
|
public static generateCanvas(options: ExtractOptions | Container | Texture): ICanvas
|
||||||
|
|||||||
Reference in New Issue
Block a user