Engine

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

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 CaptureScriptBacktraces

func CaptureScriptBacktraces(include_variables bool) []ScriptBacktrace.Instance

func GetArchitectureName

func GetArchitectureName() string

func GetFramesDrawn

func GetFramesDrawn() int

func GetFramesPerSecond

func GetFramesPerSecond() Float.X

func GetLicenseInfo

func GetLicenseInfo() map[string]string

func GetLicenseText

func GetLicenseText() string

func GetMainLoop

func GetMainLoop() MainLoop.Instance

func GetPhysicsFrames

func GetPhysicsFrames() int

func GetPhysicsInterpolationFraction

func GetPhysicsInterpolationFraction() Float.X

func GetProcessFrames

func GetProcessFrames() int

func GetScriptLanguage

func GetScriptLanguage(index int) ScriptLanguage.Instance

func GetScriptLanguageCount

func GetScriptLanguageCount() int

func GetSingleton

func GetSingleton(name string) Object.Instance

func GetSingletonList

func GetSingletonList() []string

func GetWriteMoviePath

func GetWriteMoviePath() string

func HasSingleton

func HasSingleton(name string) bool

func IsEditorHint

func IsEditorHint() bool

func IsEmbeddedInEditor

func IsEmbeddedInEditor() bool

func IsInPhysicsFrame

func IsInPhysicsFrame() bool

func Log

func Log(v ...any)

Log prints one or more arguments to strings in the best way possible to standard error line

func Logv

func Logv(v ...any)

Logv prints if verbose mode is enabled (OS.is_stdout_verbose returning true), converts one or more arguments of any type to string in the best way possible and prints them to the console.

func MaxFps

func MaxFps() int

func MaxPhysicsStepsPerFrame

func MaxPhysicsStepsPerFrame() int

func PhysicsJitterFix

func PhysicsJitterFix() Float.X

func PhysicsTicksPerSecond

func PhysicsTicksPerSecond() int

func Print

func Print(v ...any)

Print prints one or more arguments to strings in the best way possible to the OS terminal. Unlike print, no newline is automatically added at the end.

func PrintErrorMessages

func PrintErrorMessages() bool

func PrintRich

func PrintRich(v ...any)

PrintRich converts one or more arguments of any type to string in the best way possible and prints them to the console.

The following BBCode tags are supported: b, i, u, s, indent, code, url, center, right, color, bgcolor, fgcolor.

Color tags only support the following named colors: black, red, green, yellow, blue, magenta, pink, purple, cyan, white, orange, gray. Hexadecimal color codes are not supported.

URL tags only support URLs wrapped by a URL tag, not URLs with a different title.

When printing to standard output, the supported subset of BBCode is converted to ANSI escape codes for the terminal emulator to display. Support for ANSI escape codes varies across terminal emulators, especially for italic and strikethrough. In standard output, code is represented with faint text but without any font change. Unsupported tags are left as-is in standard output.

func PrintToStdout

func PrintToStdout() bool

func Println

func Println(v ...any)

Println converts one or more arguments of any type to string in the best way possible and prints them to the console.

func Raise

func Raise(err error)

Raise pushes an error message to Godot's built-in debugger and to the OS terminal.

func RaiseWarning

func RaiseWarning(v ...any)

RaiseWarning pushes a warning message to Godot's built-in debugger and to the OS terminal.

func RegisterScriptLanguage

func RegisterScriptLanguage(language ScriptLanguage.Instance) error

func RegisterSingleton

func RegisterSingleton(name string, instance Object.Instance)

func SetMaxFps

func SetMaxFps(value int)

SetMaxFps sets the property returned by [GetMaxFps].

func SetMaxPhysicsStepsPerFrame

func SetMaxPhysicsStepsPerFrame(value int)

SetMaxPhysicsStepsPerFrame sets the property returned by [GetMaxPhysicsStepsPerFrame].

func SetPhysicsJitterFix

func SetPhysicsJitterFix(value Float.X)

SetPhysicsJitterFix sets the property returned by [GetPhysicsJitterFix].

func SetPhysicsTicksPerSecond

func SetPhysicsTicksPerSecond(value int)

SetPhysicsTicksPerSecond sets the property returned by [GetPhysicsTicksPerSecond].

func SetPrintErrorMessages

func SetPrintErrorMessages(value bool)

SetPrintErrorMessages sets the property returned by [IsPrintingErrorMessages].

func SetPrintToStdout

func SetPrintToStdout(value bool)

SetPrintToStdout sets the property returned by [IsPrintingToStdout].

func SetTimeScale

func SetTimeScale(value Float.X)

SetTimeScale sets the property returned by [GetTimeScale].

func TimeScale

func TimeScale() Float.X

func UnregisterScriptLanguage

func UnregisterScriptLanguage(language ScriptLanguage.Instance) error

func UnregisterSingleton

func UnregisterSingleton(name string)

func Version

func Version() string

Version returns the version of the Engine.

Types

type AuthorInfo

type AuthorInfo struct {
	LeadDevelopers  []string `gd:"lead_developers"`
	Founders        []string `gd:"founders"`
	ProjectManagers []string `gd:"project_managers"`
	Developers      []string `gd:"developers"`
}

func GetAuthorInfo

func GetAuthorInfo() AuthorInfo
type Copyright struct {
	Name  string `gd:"name"`
	Parts []Part `gd:"parts"`
}

func GetCopyrightInfo

func GetCopyrightInfo() []Copyright

type DonorInfo

type DonorInfo struct {
	PlatinumSponsors []string `gd:"platinum_sponsors"`
	GoldSponsors     []string `gd:"gold_sponsors"`
	SilverSponsors   []string `gd:"silver_sponsors"`
	BronzeSponsors   []string `gd:"bronze_sponsors"`
	MiniSponsors     []string `gd:"mini_sponsors"`
	GoldDonors       []string `gd:"gold_donors"`
	SilverDonors     []string `gd:"silver_donors"`
	BronzeDonors     []string `gd:"bronze_donors"`
}

func GetDonorInfo

func GetDonorInfo() DonorInfo

type Extension

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

Extension can be embedded in a new struct to create a Go extension of this class.

T must be a type that is embedding this Extension as the first field. It is unsafe and invalid to use this type directly, or embedded in any other way.

func (*Extension[T]) AsObject

func (o *Extension[T]) AsObject() [1]gdreference.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.Engine

Instance of the class with convieniently typed arguments and results.

func (Instance) AsObject

func (o Instance) AsObject() [1]gdreference.Object

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

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

func (Instance) Virtual

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

type Part

type Part struct {
	Files     []string `gd:"files"`
	Copyright []string `gd:"copyright"`
	License   string   `gd:"license"`
}

type Pointer

type Pointer[T any] = gdmemory.Pointer[T]

Pointer is a typed pointer to a value of type T in engine memory. The pointer is valid until the next barrier (typically end of frame).

func Allocate

func Allocate[T comparable](val T) Pointer[T]

Allocate a value of type T, must not contain pointers or channels.

Please be aware that the pointer returned from Allocate is not freed automatically. As such, be aware of possible memory leaks and/or cache and reuse Pointer[T] values.

type Singleton

type Singleton[T gdclass.Interface] = Extension[T]

Singleton can be embedded in a new struct to create a Go singleton extension of the class.

It will become available as a global inside scripts and any any other Go Extension types will have any *T typed fields filled in to point at this singleton once they have been instantiated.

T must be a type that is embedding this Singleton as the first field. It is unsafe and invalid to use this type directly, or embedded in any other way.

type VersionInfo

type VersionInfo struct {
	Major     int    `gd:"major"`
	Minor     int    `gd:"minor"`
	Patch     int    `gd:"patch"`
	Hex       int    `gd:"hex"`
	Status    string `gd:"status"`
	Build     string `gd:"build"`
	Hash      string `gd:"hash"`
	Timestamp int    `gd:"timestamp"`
	String    string `gd:"string"`
}

func GetVersionInfo

func GetVersionInfo() VersionInfo

Jump to

Keyboard shortcuts

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