Function: showElement()
> showElement(alias, request, options?): Promise<AIImageSprite<AIImageSpriteMemory>>
Defined in: src/show.ts:46
Generate a single visual element and show it on the canvas, positioned with
ElementImageGenerateOptions.align (the only supported way to position it: there is no
raw x/y here, since the position is already the one the image itself was composed for). This is
the combination of ai.image.generateElement 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 element. You can use this alias to refer to it later (e.g. to replace it with another generated element).
request
string
Natural language description of the element to generate.
options?
Options controlling which context gets included in the prompt, and where the
element is positioned on the canvas (align).
Returns
Promise<AIImageSprite<AIImageSpriteMemory>>
The AIImageSprite added to the canvas.