Expand description
Curated re-exports of common items.
Modules§
- user_
data - User-data attributes from
export::user_datamodule.
Macros§
- godot_
dbg - Prints and returns the value of a given expression for quick and dirty debugging, using the engine’s logging system (visible in the editor).
- godot_
error - Print an error using the engine’s logging system (visible in the editor).
- godot_
init - Declare all the API endpoints necessary to initialize a NativeScript library.
- godot_
print - Print a message using the engine’s logging system (visible in the editor).
- godot_
warn - Print a warning using the engine’s logging system (visible in the editor).
- godot_
wrap_ method - Convenience macro to wrap an object’s method into a
Methodimplementor that can be passed to the engine when registering a class.
Structs§
- Aabb
- Axis-aligned bounding box.
- Basis
- A 3x3 matrix, typically used as an orthogonal basis for
Transform. - Button
core class ButtoninheritsBaseButton(manually managed).- Canvas
Item core class CanvasIteminheritsNode(manually managed).- Canvas
Layer core class CanvasLayerinheritsNode(manually managed).- Class
Builder - Allows registration of exported properties, methods and signals.
- Color
- RGBA color with 32-bit floating point components.
- Color
Rect core class ColorRectinheritsControl(manually managed).- Control
core class ControlinheritsCanvasItem(manually managed).- Dictionary
- A reference-counted
DictionaryofVariantkey-value pairs. - Export
Info - Metadata about the exported property.
- Godot
String - Godot’s reference-counted string type.
- Image
core class ImageinheritsResource(reference-counted).- Init
Handle - A handle that can register new classes to the engine during initialization.
- Input
core singleton class InputinheritsObject(manually managed).- Input
Event core class InputEventinheritsResource(reference-counted).- Input
Event Key core class InputEventKeyinheritsInputEventWithModifiers(reference-counted).- Instance
- A persistent reference to a GodotObject with a rust NativeClass attached.
- Kinematic
Body core class KinematicBodyinheritsPhysicsBody(manually managed).- Kinematic
Body2D core class KinematicBody2DinheritsPhysicsBody2D(manually managed).- Label
core class LabelinheritsControl(manually managed).- Method
Builder - Builder type used to register a method on a
NativeClass. - Node
core class NodeinheritsObject(manually managed).- Node2D
core class Node2DinheritsCanvasItem(manually managed).- Node
Path - A reference-counted relative or absolute path in a scene tree, for use with
Node.get_node()and similar functions. It can reference a node, a resource within a node, or a property of a node or resource. - Null
- Represents an explicit null reference in method arguments. This works around type inference
issues with
Option. You may createNulls withNull::nullorGodotObject::null. - Object
- The base class of all classes in the Godot hierarchy.
- Packed
Scene core class PackedSceneinheritsResource(reference-counted).- Plane
- 3D plane in Hessian form:
a*b + b*y + c*z + d = 0 - Pool
Array - A reference-counted CoW typed vector using Godot’s pool allocator, generic over possible element types.
- Property
- Placeholder type for exported properties with no backing field.
- Property
Usage - Quat
- Quaternion, used to represent 3D rotations.
- Rect2
- 2D axis-aligned bounding box.
- Ref
- A polymorphic smart pointer for Godot objects whose behavior changes depending on the memory management method of the underlying type and the thread access status.
- Reference
- Base class of all reference-counted types. Inherits
Object. - Resource
Loader core singleton class ResourceLoaderinheritsObject(manually managed).- Rid
- A RID (“resource ID”) is an opaque handle that refers to a Godot
Resource. - Scene
Tree core class SceneTreeinheritsMainLoop(manually managed).- Shader
core class ShaderinheritsResource(reference-counted).- Shared
- Marker that indicates that a value currently might be shared in the same or over multiple threads.
- Signal
Builder - Class to construct a signal. Make sure to call
Self::done()in the end. - Signal
Param - Parameter in a signal declaration.
- Spatial
core class SpatialinheritsNode(manually managed).- Sprite
core class SpriteinheritsNode2D(manually managed).- String
Name - Interned string.
- TInstance
- A reference to a GodotObject with a rust NativeClass attached that is assumed safe during a certain lifetime.
- TRef
- A temporary safe pointer to Godot objects that tracks thread access status.
TRefcan be coerced into bare references withDeref. - Texture
core class TextureinheritsResource(reference-counted).- Thread
Local - Marker that indicates that a value can currently only be shared in the same thread.
- Timer
core class TimerinheritsNode(manually managed).- Transform
- Affine 3D transform (3x4 matrix).
- Transform2D
- Affine 2D transform (2x3 matrix).
- Tween
core class TweeninheritsNode(manually managed).- Unique
- Marker that indicates that a value currently only has a single unique reference.
- Variant
- A
Variantcan represent all Godot values (core types orObjectclass instances). - Variant
Array - A reference-counted
Variantvector. Godot’s generic array data type. Negative indices can be used to count from the right. - Vector2
- 2D vector class.
- Vector3
- 3D vector class.
- Viewport
core class ViewportinheritsNode(manually managed).
Enums§
- From
Variant Error - Error type returned by
FromVariant::from_variant. - Godot
Error - Error codes used in various Godot APIs.
- Manually
Managed - Marker that indicates that a type is manually managed.
- RefCounted
- Marker that indicates that a type is reference-counted.
- Variant
Dispatch - Rust enum associating each primitive variant type to its value.
- Variant
Operator - Godot variant operator kind.
- Variant
Type
Traits§
- AsArg
- Trait for safe conversion from Godot object references into API method arguments. This is a sealed trait with no public interface.
- From
Variant - Types that can be converted from a
Variant. Conversions are performed in Rust, and can be implemented for custom types. - Godot
Object - Trait for Godot API objects. This trait is sealed, and implemented for generated wrapper types.
- Instanciable
- GodotObjects that have a zero argument constructor.
- Method
- Safe low-level trait for stateful, variadic methods that can be called on a native script type.
- Native
Class - Trait used for describing and initializing a Godot script class.
- Native
Class Methods - Trait used to provide information of Godot-exposed methods of a script class.
- NewRef
- A trait for incrementing the reference count to a Godot object.
- Node
Resolve Ext - Owned
ToVariant - Types that can only be safely converted to a
Variantas owned values. Such types cannot implementToVariantin general, but can still be passed to API methods as arguments, or used as return values. Notably, this includesUniquearrays, dictionaries, and references to Godot objects and instances. - Queue
Free - Manually managed Godot classes implementing
queue_free. This trait has no public interface. SeeRef::queue_free. - SubClass
- Marker trait for API types that are subclasses of another type. This trait is implemented by the bindings generator, and has no public interface. Users should not attempt to implement this trait.
- ToVariant
- Types that can be converted to a
Variant. - ToVariant
Eq - Trait for types whose
ToVariantimplementations preserve equivalence.
Functions§
- autoload⚠
- Convenience method to obtain a reference to an “auto-load” node, that is a child of the root node.
- load
- Loads a resource from the filesystem located at
path.
Type Aliases§
- Byte
Array Deprecated - A reference-counted vector of
u8that uses Godot’s pool allocator. - Color
Array Deprecated - A reference-counted vector of
Colorthat uses Godot’s pool allocator. - Float32
Array Deprecated - A reference-counted vector of
f32that uses Godot’s pool allocator. - Int32
Array Deprecated - A reference-counted vector of
i32that uses Godot’s pool allocator. - String
Array Deprecated - A reference-counted vector of
GodotStringthat uses Godot’s pool allocator. - Vector2
Array Deprecated - A reference-counted vector of
Vector2that uses Godot’s pool allocator. - Vector3
Array Deprecated - A reference-counted vector of
Vector3that uses Godot’s pool allocator.
Attribute Macros§
- methods
- Collects method signatures of all functions in a
NativeClassthat have the#[method]attribute and registers them with Godot. - monomorphize
- Wires up necessary internals for a concrete monomorphization of a generic
NativeClass, represented as a type alias, so it can be registered. - profiled
- Makes a function profiled in Godot’s built-in profiler. This macro automatically creates a tag using the name of the current module and the function by default.
Derive Macros§
- From
Varargs - Enable struct types to be parsed as argument lists.
- From
Variant - Native
Class - Makes it possible to use a type as a NativeScript. Automatically registers the type
if the
inventoryfeature is enabled on supported platforms. - Owned
ToVariant - ToVariant