Change an image from a script
Use Change GUI Element Property when a story event should replace a picture. This complete GDScript example changes the key to a notebook:
extends "res://scripts/runtime/script_base.gd"func run(_context: Dictionary = {}) -> Variant:
await ChangeGUIElementProperty({
"guiId": "image_lab",
"elementId": "inspect_image",
"property": "assetId",
"value": "notebook_art"
})
return trueFigure 11. The same Image element now displays the notebook as its normal foreground.
Create a script record, Apply Changes, then assign it to a Button or story interaction. The GUI owns the element; the new value is an image asset ID. Use backgroundImageAssetId instead of assetId when you intend to change only the background layer.
Keep the element ID stable. Replacing its picture does not require deleting the element and creating a new one in the designer. Existing event and layout references can continue to point to inspect_image.
