LogoPixi’VN
inkFunctions

Function: createAiHandler()

> createAiHandler(options?): void

Defined in: src/ink/aiHandler.ts:112

Registers four Ink Hashtag-Commands that let Ink scripts drive @drincs/pixi-vn-ai directly: # ai background, # ai element (both generate an image and show it as an AIImageSprite, with an optional entrance transition), and two forms of # ai dialog (generates a line of dialogue and sets it as the current narration dialogue, with or without a speaking character). Mirrors @drincs/pixi-vn-spine's own createSpineHandler.

Call this once, near the start of your app (alongside e.g. addBaseHashtagCommands), before any Ink content is parsed.

Parameters

options?

CreateAiHandlerOptions = {}

Optional configuration for known character ids — see CreateAiHandlerOptions.

Returns

void

Example

# ai background bg "The throne room, lit by torches, a storm outside the windows." style "Oil painting" with dissolve duration 1
# ai element advisor "The advisor, an elderly man with a long grey beard." align { x: 0.75, y: 1 } with dissolve duration 1
# ai dialog as advisor "Greet the king with the bad news."

On this page