Crate gdnative[−][src]
Rust bindings for the Godot game engine
This crate contains high-level wrappers around the Godot game engine's gdnaive API. Some of the types were automatically generated from the engine's JSON API description, and some other types are hand made wrappers around the core C types.
Memory management
Reference counting
A lot of the types provided by the engine are internally reference counted and
allow mutable aliasing.
In rust parlance this means that a type such as gdnative::ConcavePolygonShape2D
is functionally equivalent to a Rc<Cell<Something>>
rather than Rc<Something>
.
Since it is easy to expect containers and other types to allocate a copy of their
content when using the Clone
trait, most of these types do not implement Clone
and instead provide a new_ref(&self) -> Self
method to create references to the
same collection or object.
Manually managed objects
Some types are manually managed. This means that ownership can be passed to the
engine or the object must be carfeully deallocated using the object's free
method.
Re-exports
pub extern crate gdnative_geom as geom; |
pub use geom::*; |
Modules
init |
Types and functionalities to declare and initialize gdnative classes. |
Macros
godot_class |
Convenience macro to declare a native class. |
godot_error |
Print an error using the engine's logging system (visible in the editor). |
godot_gdnative_init |
Declare the API endpoint to initialize the gdnative API on startup. |
godot_gdnative_terminate |
Declare the API endpoint invoked during shutdown. |
godot_nativescript_init |
Declare the API endpoint to initialize nativescript classes on startup. |
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_constructor |
Convenience macro to wrap an object's constructor into a function pointer that can be passed to the engine when registering a class. |
godot_wrap_destructor |
Convenience macro to wrap an object's destructor into a function pointer that can be passed to the engine when registering a class. |
godot_wrap_method |
Convenience macro to wrap an object's method into a function pointer that can be passed to the engine when registering a class. |
Structs
ARVRAnchor |
|
ARVRCamera |
|
ARVRController |
|
ARVRInterface |
|
ARVRInterfaceGDNative |
|
ARVROrigin |
|
ARVRPositionalTracker |
|
ARVRServer |
|
AStar |
|
AcceptDialog |
|
AnimatedSprite |
|
AnimatedSprite3D |
|
Animation |
|
AnimationPlayer |
|
AnimationTreePlayer |
|
Area |
|
Area2D |
|
ArrayMesh |
|
AtlasTexture |
|
AudioBusLayout |
|
AudioEffect |
|
AudioEffectAmplify |
|
AudioEffectBandLimitFilter |
|
AudioEffectBandPassFilter |
|
AudioEffectChorus |
|
AudioEffectCompressor |
|
AudioEffectDelay |
|
AudioEffectDistortion |
|
AudioEffectEQ |
|
AudioEffectEQ6 |
|
AudioEffectEQ10 |
|
AudioEffectEQ21 |
|
AudioEffectFilter |
|
AudioEffectHighPassFilter |
|
AudioEffectHighShelfFilter |
|
AudioEffectLimiter |
|
AudioEffectLowPassFilter |
|
AudioEffectLowShelfFilter |
|
AudioEffectNotchFilter |
|
AudioEffectPanner |
|
AudioEffectPhaser |
|
AudioEffectPitchShift |
|
AudioEffectReverb |
|
AudioEffectStereoEnhance |
|
AudioServer |
|
AudioStream |
|
AudioStreamOGGVorbis |
|
AudioStreamPlayback |
|
AudioStreamPlayer |
|
AudioStreamPlayer2D |
|
AudioStreamPlayer3D |
|
AudioStreamRandomPitch |
|
AudioStreamSample |
|
BackBufferCopy |
|
BakedLightmap |
|
BakedLightmapData |
|
BaseButton |
|
BitMap |
|
BitmapFont |
|
BoneAttachment |
|
BoxContainer |
|
BoxShape |
|
BulletPhysicsDirectBodyState |
|
BulletPhysicsServer |
|
Button |
|
ButtonGroup |
|
ByteArray |
A reference-counted vector of bytes that uses Godot's pool allocator. |
Camera |
|
Camera2D |
|
CanvasItem |
|
CanvasItemMaterial |
|
CanvasLayer |
|
CanvasModulate |
|
CapsuleMesh |
|
CapsuleShape |
|
CapsuleShape2D |
|
CenterContainer |
|
CheckBox |
|
CheckButton |
|
CircleShape2D |
|
CollisionObject |
|
CollisionObject2D |
|
CollisionPolygon |
|
CollisionPolygon2D |
|
CollisionShape |
|
CollisionShape2D |
|
Color |
RGBA color with 32 bits floating point components. |
ColorArray |
A reference-counted vector of |
ColorPicker |
|
ColorPickerButton |
|
ColorRect |
|
ConcavePolygonShape |
|
ConcavePolygonShape2D |
|
ConeTwistJoint |
|
ConfigFile |
|
ConfirmationDialog |
|
Container |
|
Control |
|
ConvexPolygonShape |
|
ConvexPolygonShape2D |
|
CubeMap |
|
CubeMesh |
|
Curve |
|
Curve2D |
|
Curve3D |
|
CurveTexture |
|
CylinderMesh |
|
DampedSpringJoint2D |
|
Dictionary |
A reference-counted |
DirectionalLight |
|
DynamicFont |
|
DynamicFontData |
|
EditorExportPlugin |
|
EditorFileDialog |
|
EditorFileSystem |
|
EditorFileSystemDirectory |
|
EditorImportPlugin |
|
EditorInterface |
|
EditorPlugin |
|
EditorResourceConversionPlugin |
|
EditorResourcePreview |
|
EditorResourcePreviewGenerator |
|
EditorSceneImporter |
|
EditorScenePostImport |
|
EditorScript |
|
EditorSelection |
|
EditorSettings |
|
EditorSpatialGizmo |
|
EncodedObjectAsID |
|
Environment |
|
FileDialog |
|
Float32Array |
A reference-counted vector of |
Font |
|
FuncRef |
|
GDNative |
|
GDNativeLibrary |
|
GDScript |
|
GDScriptFunctionState |
|
GIProbe |
|
GIProbeData |
|
Generic6DOFJoint |
|
GeometryInstance |
|
GlobalConstants |
|
GodotString |
Godot's reference-counted string type. |
Gradient |
|
GradientTexture |
|
GraphEdit |
|
GraphNode |
|
GridContainer |
|
GridMap |
|
GrooveJoint2D |
|
HBoxContainer |
|
HScrollBar |
|
HSeparator |
|
HSlider |
|
HSplitContainer |
|
HTTPClient |
|
HTTPRequest |
|
HingeJoint |
|
IP |
|
IP_Unix |
|
Image |
|
ImageTexture |
|
ImmediateGeometry |
|
Input |
|
InputDefault |
|
InputEvent |
|
InputEventAction |
|
InputEventGesture |
|
InputEventJoypadButton |
|
InputEventJoypadMotion |
|
InputEventKey |
|
InputEventMagnifyGesture |
|
InputEventMouse |
|
InputEventMouseButton |
|
InputEventMouseMotion |
|
InputEventPanGesture |
|
InputEventScreenDrag |
|
InputEventScreenTouch |
|
InputEventWithModifiers |
|
InputMap |
|
InstancePlaceholder |
|
Int32Array |
A reference-counted vector of |
InterpolatedCamera |
|
ItemList |
|
JSONParseResult |
|
JavaScript |
|
Joint |
|
Joint2D |
|
KinematicBody |
|
KinematicBody2D |
|
KinematicCollision |
|
KinematicCollision2D |
|
Label |
|
LargeTexture |
|
Light |
|
Light2D |
|
LightOccluder2D |
|
Line2D |
|
LineEdit |
|
LineShape2D |
|
LinkButton |
|
Listener |
|
MainLoop |
|
MarginContainer |
|
Material |
|
MenuButton |
|
Mesh |
|
MeshDataTool |
|
MeshInstance |
|
MeshLibrary |
|
MobileVRInterface |
|
MultiMesh |
|
MultiMeshInstance |
|
NativeInstanceHeader |
Godot native class implementation detail that must be stored in each instance. |
NativeRef |
A reference to a rust native script. |
NativeScript |
|
Navigation |
|
Navigation2D |
|
NavigationMesh |
|
NavigationMeshInstance |
|
NavigationPolygon |
|
NavigationPolygonInstance |
|
NetworkedMultiplayerENet |
|
NetworkedMultiplayerPeer |
|
NinePatchRect |
|
Node |
|
Node2D |
|
NodePath |
A reference-counted relative or absolute path in a scene tree, for use with |
Object |
|
OccluderPolygon2D |
|
OmniLight |
|
OptionButton |
|
PCKPacker |
|
PHashTranslation |
|
PackedDataContainer |
|
PackedDataContainerRef |
|
PackedScene |
|
PacketPeer |
|
PacketPeerStream |
|
PacketPeerUDP |
|
Panel |
|
PanelContainer |
|
PanoramaSky |
|
ParallaxBackground |
|
ParallaxLayer |
|
Particles |
|
Particles2D |
|
ParticlesMaterial |
|
Path |
|
Path2D |
|
PathFollow |
|
PathFollow2D |
|
Performance |
|
Physics2DDirectBodyState |
|
Physics2DDirectBodyStateSW |
|
Physics2DDirectSpaceState |
|
Physics2DServer |
|
Physics2DServerSW |
|
Physics2DShapeQueryParameters |
|
Physics2DShapeQueryResult |
|
Physics2DTestMotionResult |
|
PhysicsBody |
|
PhysicsBody2D |
|
PhysicsDirectBodyState |
|
PhysicsDirectSpaceState |
|
PhysicsServer |
|
PhysicsShapeQueryParameters |
|
PhysicsShapeQueryResult |
|
PinJoint |
|
PinJoint2D |
|
PlaneMesh |
|
PlaneShape |
|
PluginScript |
|
Polygon2D |
|
PolygonPathFinder |
|
Popup |
|
PopupDialog |
|
PopupMenu |
|
PopupPanel |
|
Position2D |
|
Position3D |
|
PrimitiveMesh |
|
PrismMesh |
|
ProceduralSky |
|
ProgressBar |
|
ProjectSettings |
|
ProximityGroup |
|
ProxyTexture |
|
QuadMesh |
|
RayCast |
|
RayCast2D |
|
RayShape |
|
RayShape2D |
|
RectangleShape2D |
|
Reference |
|
ReferenceRect |
|
ReflectionProbe |
|
RegEx |
|
RegExMatch |
|
RemoteTransform |
|
RemoteTransform2D |
|
Resource |
|
ResourceImporter |
|
ResourceImporterOGGVorbis |
|
ResourceImporterTheora |
|
ResourceImporterWebm |
|
ResourceInteractiveLoader |
|
ResourcePreloader |
|
RichTextLabel |
|
Rid |
The RID type is used to access the unique integer ID of a resource. They are opaque, so they do not grant access to the associated resource by themselves. |
RigidBody |
|
RigidBody2D |
|
SceneState |
|
SceneTree |
|
SceneTreeTimer |
|
Script |
|
ScriptEditor |
|
ScrollBar |
|
ScrollContainer |
|
SegmentShape2D |
|
Separator |
|
Shader |
|
ShaderMaterial |
|
Shape |
|
Shape2D |
|
ShortCut |
|
Skeleton |
|
Sky |
|
Slider |
|
SliderJoint |
|
Spatial |
|
SpatialGizmo |
|
SpatialMaterial |
|
SpatialVelocityTracker |
|
SphereMesh |
|
SphereShape |
|
SpinBox |
|
SplitContainer |
|
SpotLight |
|
Sprite |
|
Sprite3D |
|
SpriteBase3D |
|
SpriteFrames |
|
StaticBody |
|
StaticBody2D |
|
StreamPeer |
|
StreamPeerBuffer |
|
StreamPeerSSL |
|
StreamPeerTCP |
|
StreamTexture |
|
StringArray |
A vector of |
StringName | |
StyleBox |
|
StyleBoxEmpty |
|
StyleBoxFlat |
|
StyleBoxLine |
|
StyleBoxTexture |
|
SurfaceTool |
|
TCP_Server |
|
TabContainer |
|
Tabs |
|
TextEdit |
|
Texture |
|
TextureButton |
|
TextureProgress |
|
TextureRect |
|
Theme |
|
TileMap |
|
TileSet |
|
Timer |
|
ToolButton |
|
TouchScreenButton |
|
Translation |
|
TranslationServer |
|
Tree |
|
TreeItem |
|
TriangleMesh |
|
Tween |
|
UndoRedo |
|
Utf8String | |
VBoxContainer |
|
VScrollBar |
|
VSeparator |
|
VSlider |
|
VSplitContainer |
|
Variant |
A |
VariantArray |
A reference-counted |
Vector2Array |
A reference-counted vector of |
Vector3Array |
A reference-counted vector of |
VehicleBody |
|
VehicleWheel |
|
VideoPlayer |
|
VideoStream |
|
VideoStreamTheora |
|
VideoStreamWebm |
|
Viewport |
|
ViewportContainer |
|
ViewportTexture |
|
VisibilityEnabler |
|
VisibilityEnabler2D |
|
VisibilityNotifier |
|
VisibilityNotifier2D |
|
VisualInstance |
|
VisualScript |
|
VisualScriptBasicTypeConstant |
|
VisualScriptBuiltinFunc |
|
VisualScriptClassConstant |
|
VisualScriptComment |
|
VisualScriptCondition |
|
VisualScriptConstant |
|
VisualScriptConstructor |
|
VisualScriptCustomNode |
|
VisualScriptDeconstruct |
|
VisualScriptEmitSignal |
|
VisualScriptEngineSingleton |
|
VisualScriptExpression |
|
VisualScriptFunction |
|
VisualScriptFunctionCall |
|
VisualScriptFunctionState |
|
VisualScriptGlobalConstant |
|
VisualScriptIndexGet |
|
VisualScriptIndexSet |
|
VisualScriptInputAction |
|
VisualScriptIterator |
|
VisualScriptLocalVar |
|
VisualScriptLocalVarSet |
|
VisualScriptMathConstant |
|
VisualScriptNode |
|
VisualScriptOperator |
|
VisualScriptPreload |
|
VisualScriptPropertyGet |
|
VisualScriptPropertySet |
|
VisualScriptResourcePath |
|
VisualScriptReturn |
|
VisualScriptSceneNode |
|
VisualScriptSceneTree |
|
VisualScriptSelect |
|
VisualScriptSelf |
|
VisualScriptSequence |
|
VisualScriptSubCall |
|
VisualScriptSwitch |
|
VisualScriptTypeCast |
|
VisualScriptVariableGet |
|
VisualScriptVariableSet |
|
VisualScriptWhile |
|
VisualScriptYield |
|
VisualScriptYieldSignal |
|
VisualServer |
|
WeakRef |
|
WindowDialog |
|
World |
|
World2D |
|
WorldEnvironment |
|
XMLParser |
|
YSort |
|
_ClassDB |
|
_Directory |
|
_Engine |
|
_File |
|
_Geometry |
|
_JSON |
|
_Marshalls |
|
_Mutex |
|
_OS |
|
_ResourceLoader |
|
_ResourceSaver |
|
_Semaphore |
|
_Thread |
|
_VisualScriptEditor |
|
Enums
Traits
GodotObject |
Internal details. |
GodotType | |
NativeClass |
Functions
result_from_sys |
Type Definitions
GodotResult |