Skip to reading
Images, Carousels & Choice Controls

Carousel actions in scripts and nodes

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView illustrations
Code example
extends "res://scripts/runtime/script_base.gd"
Code example
func run(_context: Dictionary = {}) -> Variant:
    await CarouselAddImage({
        "guiId": "gallery_lab",
        "elementId": "reference_carousel",
        "assetId": "brass_key_art"
    })
    await CarouselNext({
        "guiId": "gallery_lab",
        "elementId": "reference_carousel"
    })
    return true

Create a GDScript record with this source, Apply Changes and assign it to an interaction. Add Image appends the key; Next advances one position. Next does not automatically jump to the last added picture.

Figure 22. A visual graph can use Carousel: Next Image with the same two target IDs.

For visual scripting, connect the intended entry node to the carousel action node. An action list uses the same fields. You can place another story action before or after the navigation step without changing the carousel’s source.

Change GUI Element Property can rebuild a normal carousel. Set its layout and style before adding temporary runtime entries, or reconstruct the entries deliberately after a rebuild.

Page 25 of 52Permalink
Go to page