# Function: showElement() (/jsdoc/pixi-vn-ai/index/functions/showElement)



\> **showElement**(`alias`, `request`, `options?`): `Promise`\<[`AIImageSprite`](/jsdoc/pixi-vn-ai/index/classes/AIImageSprite)\<[`AIImageSpriteMemory`](/jsdoc/pixi-vn-ai/index/interfaces/AIImageSpriteMemory)>>

Defined in: [src/show.ts:46](https://github.com/DRincs-Productions/pixi-vn-ai/blob/f5205e28d51c043e8eeb27fcb2b61433f3751ac2/src/show.ts#L46)

Generate a single visual element and show it on the canvas, positioned with
[ElementImageGenerateOptions.align](/jsdoc/pixi-vn-ai/index/interfaces/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](/jsdoc/pixi-vn-ai/index/classes/AIImageSprite) so the generated image itself is saved with the game and can be restored
on load without generating it again.

## Parameters [#parameters]

### alias [#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 [#request]

`string`

Natural language description of the element to generate.

### options? [#options]

[`ElementImageGenerateOptions`](/jsdoc/pixi-vn-ai/index/interfaces/ElementImageGenerateOptions)

Options controlling which context gets included in the prompt, and where the
element is positioned on the canvas (`align`).

## Returns [#returns]

`Promise`\<[`AIImageSprite`](/jsdoc/pixi-vn-ai/index/classes/AIImageSprite)\<[`AIImageSpriteMemory`](/jsdoc/pixi-vn-ai/index/interfaces/AIImageSpriteMemory)>>

The [AIImageSprite](/jsdoc/pixi-vn-ai/index/classes/AIImageSprite) added to the canvas.
