GDExtensionManager

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

The GDExtensionManager loads, initializes, and keeps track of all available GDExtension libraries in the project.

Note: Do not worry about GDExtension unless you know what you are doing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Advanced

func Advanced() class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

func GetExtension

func GetExtension(path string) GDExtension.Instance

Returns the GDExtension at the given file 'path', or null if it has not been loaded or does not exist.

func GetLoadedExtensions

func GetLoadedExtensions() []string

Returns the file paths of all currently loaded extensions.

func IsExtensionLoaded

func IsExtensionLoaded(path string) bool

Returns true if the extension at the given file 'path' has already been loaded successfully. See also GetLoadedExtensions.

func OnExtensionLoaded

func OnExtensionLoaded(cb func(extension GDExtension.Instance), flags ...Signal.Flags)

Emitted after the editor has finished loading a new extension.

Note: This signal is only emitted in editor builds.

func OnExtensionUnloading

func OnExtensionUnloading(cb func(extension GDExtension.Instance), flags ...Signal.Flags)

Emitted before the editor starts unloading an extension.

Note: This signal is only emitted in editor builds.

func OnExtensionsReloaded

func OnExtensionsReloaded(cb func(), flags ...Signal.Flags)

Emitted after the editor has finished reloading one or more extensions.

Types

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.GDExtensionManager

Instance of the class with convieniently typed arguments and results.

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type LoadStatus

type LoadStatus int //gd:GDExtensionManager.LoadStatus
const (
	// The extension has loaded successfully.
	LoadStatusOk LoadStatus = 0
	// The extension has failed to load, possibly because it does not exist or has missing dependencies.
	LoadStatusFailed LoadStatus = 1
	// The extension has already been loaded.
	LoadStatusAlreadyLoaded LoadStatus = 2
	// The extension has not been loaded.
	LoadStatusNotLoaded LoadStatus = 3
	// The extension requires the application to restart to fully load.
	LoadStatusNeedsRestart LoadStatus = 4
)

func LoadExtension

func LoadExtension(path string) LoadStatus

Loads an extension by absolute file path. The 'path' needs to point to a valid GDExtension. Returns LoadStatusOk if successful.

func ReloadExtension

func ReloadExtension(path string) LoadStatus

Reloads the extension at the given file path. The 'path' needs to point to a valid GDExtension, otherwise this method may return either LoadStatusNotLoaded or LoadStatusFailed.

Note: You can only reload extensions in the editor. In release builds, this method always fails and returns LoadStatusFailed.

func UnloadExtension

func UnloadExtension(path string) LoadStatus

Unloads an extension by file path. The 'path' needs to point to an already loaded GDExtension, otherwise this method returns LoadStatusNotLoaded.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL