Skip to content

options

purkkafi edited this page Apr 11, 2023 · 3 revisions

options.tef is the file located in res://assets/options.tef. If it exists, it is loaded on startup and used to set various engine options.

Structure

The file consists of a single options tag containing the option tags.

\options{
    Options here...
}

Available options

Background color

\background_color{<HTML color code>}

Sets the background color of various built-in screens, such as the language choice menu. Defaults to black.

Shadow color

\shadow_color{<HTML color code>}

Sets the color of a shadow that appears behind overlays. Defaults to transparent.

Title screen

\title_screen{<path to scene>}

Uses the given scene as the title screen. If not specified, a dummy scene that can be used to launch a script is used.

Overlay animations

\animate_overlay_in{<path to script>}{<method name>}
\animate_overlay_out{<path to script>}{<method name>}

Uses the given static method in the given .gd file to apply an animation whenever an overlay is spawned. The function takes a Control and returns the used Tween (for timing purposes).

Shadow animations

\animate_shadow_in{<path to script>}{<method name>}
\animate_shadow_out{<script path>}{<method name>}

The same for the shadows that appear behind overlays.

Version callback

\version_callback{<path to script>}{<method name>}

Uses the given static function in the given .gd file to get the version of the game, which is a String with no format specified. It is displayed in the game window's title and stored in save files to indicate that a save is from a previous version of the game.

Example

\options{
    
    \background_color{#000000}
    
    \shadow_color{#00000080}
    
    \title_screen{res://scenes/MyTitleScreen.tscn}
    
    \animate_overlay_in{res://scripts/MyAnimations.gd}{overlay_in}
    \animate_overlay_out{res://scripts/MyAnimations.gd}{overlay_out}
    
    \animate_shadow_in{res://scripts/MyAnimations.gd}{shadow_in}
    \animate_shadow_out{res://scripts/MyAnimations.gd}{shadow_out}
    
    \version_callback{res://scripts/Util.gd}{get_version_string}
}
Clone this wiki locally