GoostEngine

Inherits: Object

Goost singleton.

Description

A general-purpose engine singleton. Provides methods which may be global in nature (both in terms of availability and the frequency of use throughout projects), or relating to global scope of other classes. May contain methods closely related to the Engine.

Methods

void defer_call ( Object object, String method, … ) vararg
void defer_call_unique ( Object object, String method, … ) vararg
Dictionary get_author_info ( ) const
Dictionary get_color_constants ( ) const
Array get_copyright_info ( ) const
Array get_invokes ( ) const
Dictionary get_license_info ( ) const
String get_license_text ( ) const
Dictionary get_version_info ( ) const
InvokeState invoke ( Object object, String method, float delay, float repeat_rate=-1.0, bool pause_mode_process=true )
InvokeState invoke_deferred ( Object object, String method, float delay, float repeat_rate=-1.0, bool pause_mode_process=true )

Method Descriptions

  • void defer_call ( Object object, String method, … ) vararg

Calls the method on the object during idle time. Mostly equivalent to Object.call_deferred, so prefer to use Object.call_deferred unless you need the same behavior along with defer_call_unique which uses the same deferring mechanism.


  • void defer_call_unique ( Object object, String method, … ) vararg

Calls the method on the object during idle time. Whether a call is unique is determined by the number and type of arguments passed, and any consecutive calls are not scheduled, unlike Object.call_deferred.


Returns Goost author information in a Dictionary.

lead_developers - Array of String, lead developer names

founders - Array of String, founder names

project_managers - Array of String, project manager names

developers - Array of String, developer names


Returns a Dictionary of color constants listed in Color, with keys as names and values as actual colors.

# Pick a random color constant.
static func rand_color_constant():
    var colors = GoostEngine.get_color_constants()
    var name = Random.pick(colors.keys())
    var color = colors[name]
    return color

Returns an Array of Dictionary including copyright information.

name - String, component name

parts - Array of Dictionary {files, copyright, license} describing subsections of the component


  • Array get_invokes ( ) const

Returns an Array of active InvokeState objects which can be used to track pending method invocations. If any reference to repeating InvokeState is lost, then all such invocations can be cancelled the following way:

for state in GoostEngine.get_invokes():
    if state.is_repeating():
        state.cancel()

Returns Dictionary of licenses used by Goost and included third-party components.


  • String get_license_text ( ) const

Returns Goost license text.


Returns the current Goost version information in a Dictionary.

major - Holds the major version number as an int

minor - Holds the minor version number as an int

patch - Holds the patch version number as an int

hex - Holds the full version number encoded as a hexadecimal int with one byte (2 places) per number (see example below)

status - Holds the status (e.g. “beta”, “rc1”, “rc2”, … “stable”) as a String

hash - Holds the full Git commit hash as a String

year - Holds the year the version was released in as an int

string - major + minor + patch + status + build in a single String

**Note: ** This method does not contain the build name as in Engine.get_version_info, since the build name is related to the engine, not the extension. In Goost, the build name is usually overridden to "goost" value.


Schedules a method on the object to be called delay seconds later.

If repeat_rate >= 0.0, then the method is invoked repeatedly every repeat_rate seconds until it’s cancelled manually using InvokeState.cancel. If the object is freed during the wait period, the invocation is cancelled automatically.

If pause_mode_process is set to false, pausing the SceneTree will also postpone the function from being called until the SceneTree pause state is resumed.


Same as invoke, but calls the method on idle time when the time arrives. This means that the method may not always be invoked exactly after delay seconds.