Copyright © 2025-2026 Candy ArtsBackground Scenes
A Background Scene displays backgrounds: layers stacked on top of each other, each displaying an image, animation or video, and playing effects. How backgrounds are used in Dialogues is explained in Backgrounds.
- Script: BG_UI.gd
- Templates: Scenes/Background_Scenes
- Updates: the script is 'unsafe', and so is every template except Default.tscn (see Customizing UI Elements, on the UI page)
- Engine path: backgrounds_path in ui_elements_paths
- Location: in Candy_UI.tscn, a child of
BG_Layer, a CanvasLayer drawn behind the 2D game world (see Drawing Order, on the UI page) - Files: see Media Files
BG_Layer in BG_Layer/Backgrounds), at the old scene's position in the scene tree, and receives the name of the path's last node. The parent node must exist even when no Background Scene is loaded yet.
Nodes
| Variable | Node |
| bg_container | Required. The node containing the layers. |
{"Layer Name": [height, width]}. Other node types retain the size set in the scene.
Effects
Effects play on AnimationPlayer children of their layer: one is created when none is free, so none has to be added. See Background Effects for when to add your own.
Settings
Files
Each of these replaces the Engine setting of the same name, unless left at its inherit value (empty for extensions, 0 for frame rates, -1 for the cache and stream):
| Setting | Purpose |
| default_image_extension | Extension added to files named without one, on TextureRect, NinePatchRect and TextureButton layers. |
| default_sprite_extension | Extension added to spritesheet files named without one, on Sprite2D and Sprite3D layers. |
| default_animated_sprite_extension | Extension added to SpriteFrames files named without one, on AnimatedSprite2D and AnimatedSprite3D layers. |
| default_video_extension | Extension added to video files named without one, on VideoStreamPlayer layers. |
| default_animated_image_fps | Frame rate of frame-folder animations. |
| default_sprite_fps | Frame rate of spritesheets. |
| default_animated_sprite_fps | Frame rate of SpriteFrames animations saved with no speed of their own. |
| default_video_fps | The frame rate used to count frames, for videos whose own frame rate can't be read. |
| default_effect_fps | The frame rate used to count frames, for effects whose animation has no frames of its own to count. |
| animation_folder_cache | Memory budget (MB) of one animation folder: one that fits stays loaded, one that doesn't is streamed. |
| animation_folder_stream | How many frames are loaded ahead while an animation folder is streamed. |
| Setting | Purpose |
| default_effect_extension | Extension added to AnimationLibrary files named without one (default .tres). |
| bg_sizes | The size of each Sprite2D or Sprite3D layer (see above). |
| default_z | The Background Scene's Z-order. |
| Hook | Called |
| x_playback_starting() | Right before a layer or an effect starts playback. |
| x_playback_started() | Right after a layer or an effect has started playback. |
- "caller": the Engine.
- "node": the Background Scene.
- "layer": the layer's name.
- "effect": the effect's animation name, or
""when the layer itself starts playback.
[[command values], [layer values]] for a layer, and [[command values], [layer values], [effect values]] for an effect. See UI Elements for how hook functions work.