GodotScriptClass

gdext.internal.register.GodotScriptClass
See theGodotScriptClass companion object
abstract class GodotScriptClass

Root base for everything in the engine class hierarchy.

Generated engine classes extend this (transitively via Object), and user classes extend an engine class (class Player extends Node2D). It carries the engine-object handle every instance is backed by, the lifetime operations (free/unref/reference/cast), the overridable engine virtuals, and the small plumbing the generated wrappers and registration use.

Since every wrapper IS a handle-carrying object, there is no separate smart pointer: you hold an engine object as its plain wrapper type (Node2D, PlayerStats) and call these methods directly on it. A null reference is the absent / failed-cast sentinel.

Two ways an instance gets its handle:

  • a user class is constructed by Godot via the create callback, which calls setHostObject;
  • a wrapper around a fetched object (e.g. from a ClassMeta.fromHandle or a singleton) is built then handed a handle via withHost.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Object
class AudioServer
class CameraServer
class ClassDB
class EditorPaths
class Engine
class Geometry2D
class Geometry3D
class IP
class Input
class InputMap
class JNISingleton
class JSONRPC
class MainLoop
class SceneTree
class Marshalls
class MovieWriter
class NativeMenu
class Node
class CanvasItem
class Control
class BaseButton
class Button
class CheckBox
class CheckButton
class MenuButton
class OptionButton
class LinkButton
class ColorRect
class Container
class BoxContainer
class ColorPicker
class GraphElement
class GraphFrame
class GraphNode
class EditorDock
class ScriptEditor
class TabContainer
class GraphEdit
class ItemList
class Label
class LineEdit
class MenuBar
class Panel
class Range
class ProgressBar
class ScrollBar
class HScrollBar
class VScrollBar
class Slider
class HSlider
class VSlider
class SpinBox
class Separator
class HSeparator
class VSeparator
class TabBar
class TextEdit
class CodeEdit
class TextureRect
class Tree
class Node2D
class Bone2D
class Camera2D
class CanvasGroup
class Area2D
class RigidBody2D
class StaticBody2D
class Joint2D
class PinJoint2D
class Light2D
class PointLight2D
class Line2D
class Marker2D
class Parallax2D
class Path2D
class PathFollow2D
class Polygon2D
class RayCast2D
class ShapeCast2D
class Skeleton2D
class Sprite2D
class TileMap
class TileMapLayer
class CanvasLayer
class EditorPlugin
class HTTPRequest
class MissingNode
class Node3D
class Camera3D
class XRCamera3D
class Area3D
class RigidBody3D
class StaticBody3D
class GridMap
class Joint3D
class HingeJoint3D
class PinJoint3D
class Marker3D
class OpenXRHand
class Path3D
class PathFollow3D
class RayCast3D
class ShapeCast3D
class Skeleton3D
class IKModifier3D
class ChainIK3D
class IterateIK3D
class CCDIK3D
class FABRIK3D
class JacobianIK3D
class SplineIK3D
class TwoBoneIK3D
class SkeletonIK3D
class SpringArm3D
class Decal
class FogVolume
class CSGShape3D
class CSGBox3D
class CSGMesh3D
class CSGPolygon3D
class CSGSphere3D
class CSGTorus3D
class Label3D
class SoftBody3D
class SpriteBase3D
class Sprite3D
class Light3D
class OmniLight3D
class SpotLight3D
class LightmapGI
class VoxelGI
class XRNode3D
class XRAnchor3D
class XROrigin3D
class Timer
class Viewport
class SubViewport
class Window
class AcceptDialog
class FileDialog
class Popup
class PopupMenu
class PopupPanel
class OS
class Performance
class RefCounted
class AESContext
class AStar2D
class AStar3D
class AStarGrid2D
class AudioSample
class CameraFeed
class ConfigFile
class Crypto
class DTLSServer
class DirAccess
class EditorScript
class Expression
class FileAccess
class HMACContext
class HTTPClient
class JavaClass
class JavaObject
class Lightmapper
class Logger
class MeshDataTool
class Mutex
class Node3DGizmo
class PCKPacker
class PacketPeer
class RDUniform
class RegEx
class RegExMatch
class Resource
class Animation
class AudioEffect
class AudioStream
class BitMap
class BoneMap
class ButtonGroup
class ColorPalette
class Compositor
class CryptoKey
class Curve
class Curve2D
class Curve3D
class Environment
class Font
class FontFile
class SystemFont
class GDExtension
class GLTFAccessor
class GLTFCamera
class GLTFDocument
class FBXDocument
class GLTFLight
class GLTFMesh
class GLTFNode
class GLTFSkeleton
class GLTFSkin
class GLTFState
class FBXState
class GLTFTexture
class Gradient
class Image
class ImporterMesh
class InputEvent
class JSON
class Material
class FogMaterial
class Mesh
class ArrayMesh
class BoxMesh
class CapsuleMesh
class CylinderMesh
class PlaneMesh
class QuadMesh
class PointMesh
class PrismMesh
class SphereMesh
class TextMesh
class TorusMesh
class MeshLibrary
class MultiMesh
class Noise
class Occluder3D
class OpenXRAction
class PackedScene
class RDShaderFile
class Script
class GDScript
class Shader
class VisualShader
class Shape2D
class Shape3D
class BoxShape3D
class Shortcut
class Skin
class Sky
class SpriteFrames
class StyleBox
class StyleBoxFlat
class StyleBoxLine
class Texture
class Texture2D
class AtlasTexture
class CurveTexture
class DPITexture
class ImageTexture
class MeshTexture
class Texture2DRD
class Texture3D
class Texture3DRD
class Cubemap
class CubemapArray
class Theme
class TileSet
class Translation
class VideoStream
class VoxelGIData
class World2D
class World3D
class SceneState
class Semaphore
class SocketServer
class TCPServer
class UDSServer
class StreamPeer
class SurfaceTool
class TLSOptions
class TextLine
class TextServer
class Thread
class TriangleMesh
class Tween
class Tweener
class UDPServer
class UPNP
class UPNPDevice
class WeakRef
class XMLParser
class XRInterface
class XRPose
class XRTracker
class ZIPPacker
class ZIPReader
class RenderData
class RenderDataRD
class ResourceUID
class ThemeDB
class TileData
class Time
class TreeItem
class UndoRedo
class XRServer
class XRVRS
Show all

Members list

Value members

Concrete methods

def _can_handle(obj: GodotObject): Boolean

EditorInspectorPlugin: can this plugin handle obj's inspector?

EditorInspectorPlugin: can this plugin handle obj's inspector?

Attributes

def _enter_tree(): Unit

EditorPlugin/Node: entered the (editor) tree.

EditorPlugin/Node: entered the (editor) tree.

Attributes

def _exit_tree(): Unit

EditorPlugin/Node: leaving the (editor) tree.

EditorPlugin/Node: leaving the (editor) tree.

Attributes

def _input(event: InputEvent): Unit

Called for every unhandled-or-not input event (Node._input).

Called for every unhandled-or-not input event (Node._input).

Attributes

def _parse_property(obj: GodotObject, varType: Long, name: String, hintType: Long, hintString: String, usage: Long, wide: Boolean): Boolean

EditorInspectorPlugin: inspect one property. Return true to take it over (after calling addPropertyEditor), false to let the default editor render.

EditorInspectorPlugin: inspect one property. Return true to take it over (after calling addPropertyEditor), false to let the default editor render.

Attributes

def _physics_process(delta: Double): Unit

Called every physics frame; delta is the fixed physics step.

Called every physics frame; delta is the fixed physics step.

Attributes

def _process(delta: Double): Unit

Called every rendered frame; delta is seconds since the last frame.

Called every rendered frame; delta is seconds since the last frame.

Attributes

def _ready(): Unit

Called when the node enters the scene tree and is ready.

Called when the node enters the scene tree and is ready.

Attributes

def _shortcut_input(event: InputEvent): Unit

Called for shortcut input before _unhandled_input (Node._shortcut_input).

Called for shortcut input before _unhandled_input (Node._shortcut_input).

Attributes

def _unhandled_input(event: InputEvent): Unit

Called for input not consumed by the UI (Node._unhandled_input).

Called for input not consumed by the UI (Node._unhandled_input).

Attributes

def _unhandled_key_input(event: InputEvent): Unit

Called for unhandled key input (Node._unhandled_key_input).

Called for unhandled key input (Node._unhandled_key_input).

Attributes

def _update_property(): Unit

EditorProperty: refresh the widget from the edited property's value.

EditorProperty: refresh the widget from the edited property's value.

Attributes

def cast[U <: GodotScriptClass](using meta: ClassMeta[U]): U

Cast to a (super- or sub-) class U. Returns null if the object is not actually a U. Uses object_cast_to with U's class tag — a real engine type check, not a Scala cast.

Cast to a (super- or sub-) class U. Returns null if the object is not actually a U. Uses object_cast_to with U's class tag — a real engine type check, not a Scala cast.

Attributes

def free(): Unit

Free a manually-managed object via object_destroy. No-op for reference-counted objects — use unref for those. The wrapper is dead afterwards: calling an engine method on it throws.

Free a manually-managed object via object_destroy. No-op for reference-counted objects — use unref for those. The wrapper is dead afterwards: calling an engine method on it throws.

Attributes

def godotClassName: String

The Godot class name for this instance. Engine wrappers override with the baked literal; user classes fall back to their Scala simple name (which is how registration names them).

The Godot class name for this instance. Engine wrappers override with the baked literal; user classes fall back to their Scala simple name (which is how registration names them).

Attributes

final def hostObject: GodotObject

The engine-side object handle for this instance.

The engine-side object handle for this instance.

Attributes

final def instanceId: InstanceId

This object's stable Godot InstanceId (the null sentinel if unbound). Mirrors Object.get_instance_id, but typed — pass it to APIs that key off a node's identity.

This object's stable Godot InstanceId (the null sentinel if unbound). Mirrors Object.get_instance_id, but typed — pass it to APIs that key off a node's identity.

Attributes

final def isRefCounted: Boolean

True if this object is reference-counted (RefCounted subtree, e.g. a Resource) vs manually-managed (Object/Node subtree). Drives the lifetime methods below.

True if this object is reference-counted (RefCounted subtree, e.g. a Resource) vs manually-managed (Object/Node subtree). Drives the lifetime methods below.

Attributes

def keep(): this.type

Keep a reference adopted inside Gd.scoped past the end of the block: the caller now owns it and releases it with unref. Returns this.

Keep a reference adopted inside Gd.scoped past the end of the block: the caller now owns it and releases it with unref. Returns this.

Attributes

def refInc(): this.type

Take one more reference on a reference-counted object, owned by this wrapper until a matching unref. No-op for manually-managed objects (nodes). Returns this. (Named refInc rather than reference to avoid clashing with the generated RefCounted.reference(): Boolean method.)

Take one more reference on a reference-counted object, owned by this wrapper until a matching unref. No-op for manually-managed objects (nodes). Returns this. (Named refInc rather than reference to avoid clashing with the generated RefCounted.reference(): Boolean method.)

Attributes

def unref(): Unit

Release one reference this wrapper owns (an engine Ref<T> return, Gd.create, or refInc), destroying the object if it was the last reference. Does nothing when the wrapper owns no reference, so a borrowed object can never be freed from under the engine.

Release one reference this wrapper owns (an engine Ref<T> return, Gd.create, or refInc), destroying the object if it was the last reference. Does nothing when the wrapper owns no reference, so a borrowed object can never be freed from under the engine.

Attributes

final def withHost(o: GDExtensionObjectPtr): this.type

Set the handle and return this (fluent, for wrapping fetched objects).

Set the handle and return this (fluent, for wrapping fetched objects).

Attributes