Show Image

Show an image on screen

Description

'show image <resource> [at <position>] [with <animation> [classes] [properties]]'

The show image action allows you to display an image on screen. For character sprites, use the Show Character action instead.

Action ID: Show::Image

Reversible: Yes

Requires User Interaction: No

Parameters

Name
Type
Description

resource

string

Either an asset ID declared in monogatari.assets('images', {...}) or a filename in the images directory

position

string

Optional. CSS class for positioning (e.g., center, left, right)

animation

string

Optional. Animation name from Animate.css

classes

string

Optional. Additional CSS classes to apply

properties

string

Optional. Properties like duration

Properties

Property
Description

duration

Sets animation-duration CSS property. Format: duration <time> (e.g., duration 2s)

Asset Declaration

Declare image assets in your script.js or main.js:

Images are loaded from assets/images/ by default.

Examples

Using Declared Assets

Using Filename Directly

If you haven't declared an asset, use the filename:

Positioning

Animation Duration

Multiple Classes

Image Caching

The action checks if the image has been preloaded and cached. If cached, it clones the cached image for faster display.

Complete Example

Last updated

Was this helpful?