LogoPixi’VN
indexFunctions

Function: showBackground()

> showBackground(alias, request, options?): Promise<AIImageSprite<AIImageSpriteMemory>>

Defined in: src/show.ts:23

Generate a background image and show it on the canvas, filling it edge-to-edge. This is the combination of ai.image.generateBackground and Pixi'VN's showImage, using AIImageSprite so the generated image itself is saved with the game and can be restored on load without generating it again.

Parameters

alias

string

The unique alias of the background. You can use this alias to refer to it later (e.g. to replace it with another generated background).

request

string

Natural language description of the background to generate.

options?

BackgroundImageGenerateOptions

Options controlling which context gets included in the prompt.

Returns

Promise<AIImageSprite<AIImageSpriteMemory>>

The AIImageSprite added to the canvas.

On this page