├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── feature-request.md │ ├── quality-of-life.md │ └── question.md ├── composite │ ├── godot │ │ └── action.yml │ ├── llvm │ │ └── action.yml │ └── rust │ │ └── action.yml ├── dependabot.yml ├── external-config │ └── public-docs-token.txt └── workflows │ ├── full-ci.yml │ ├── minimal-ci.yml │ ├── release-version.yml │ └── update-docs.yml ├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Cargo.toml ├── LICENSE.md ├── README.md ├── assets ├── godot-ferris-license.md └── godot-ferris.svg ├── bindings-generator ├── Cargo.toml └── src │ ├── api.rs │ ├── class_docs.rs │ ├── classes.rs │ ├── dependency.rs │ ├── documentation.rs │ ├── godot_api_json.rs │ ├── godot_version.rs │ ├── lib.rs │ ├── methods.rs │ └── special_methods.rs ├── check.sh ├── example.sh ├── examples ├── builder-export │ ├── Cargo.toml │ ├── ExportsArrays.gdns │ ├── ExportsArrays.tscn │ ├── builder_export_library.gdnlib │ ├── default_env.tres │ ├── icon.png │ ├── icon.png.import │ ├── project.godot │ └── src │ │ └── lib.rs ├── dodge-the-creeps │ ├── Cargo.toml │ ├── Hud.gdns │ ├── Hud.tscn │ ├── Main.gdns │ ├── Main.tscn │ ├── Mob.gdns │ ├── Mob.tscn │ ├── Player.gdns │ ├── Player.tscn │ ├── README.md │ ├── art │ │ ├── House In a Forest Loop.ogg │ │ ├── House In a Forest Loop.ogg.import │ │ ├── enemyFlyingAlt_1.png │ │ ├── enemyFlyingAlt_1.png.import │ │ ├── enemyFlyingAlt_2.png │ │ ├── enemyFlyingAlt_2.png.import │ │ ├── enemySwimming_1.png │ │ ├── enemySwimming_1.png.import │ │ ├── enemySwimming_2.png │ │ ├── enemySwimming_2.png.import │ │ ├── enemyWalking_1.png │ │ ├── enemyWalking_1.png.import │ │ ├── enemyWalking_2.png │ │ ├── enemyWalking_2.png.import │ │ ├── gameover.wav │ │ ├── gameover.wav.import │ │ ├── playerGrey_up1.png │ │ ├── playerGrey_up1.png.import │ │ ├── playerGrey_up2.png │ │ ├── playerGrey_up2.png.import │ │ ├── playerGrey_walk1.png │ │ ├── playerGrey_walk1.png.import │ │ ├── playerGrey_walk2.png │ │ └── playerGrey_walk2.png.import │ ├── default_env.tres │ ├── dodge_the_creeps_library.gdnlib │ ├── fonts │ │ ├── FONTLOG.txt │ │ ├── LICENSE.txt │ │ └── Xolonium-Regular.ttf │ ├── icon.png │ ├── icon.png.import │ ├── project.godot │ └── src │ │ ├── hud.rs │ │ ├── lib.rs │ │ ├── main_scene.rs │ │ ├── mob.rs │ │ └── player.rs ├── godot_tps_controller_port │ ├── .gitignore │ ├── Cargo.toml │ ├── LICENSE │ ├── Levels │ │ └── Main │ │ │ ├── Environment.tres │ │ │ ├── Geometry │ │ │ ├── Cube.tscn │ │ │ ├── Floor.tscn │ │ │ └── Wall.tscn │ │ │ ├── L_Main.gd │ │ │ ├── L_Main.tscn │ │ │ └── Materials │ │ │ ├── M_Dark.tres │ │ │ ├── T_Grid.png │ │ │ └── T_Grid.png.import │ ├── Player.gdns │ ├── README.md │ ├── default_env.tres │ ├── effects_shared │ │ ├── BlastMesh.glb │ │ ├── BlastMesh.glb.import │ │ ├── BlastMesh_Sphere.mesh │ │ ├── BlastTexture.png │ │ └── BlastTexture.png.import │ ├── godot_rust_tps_port.gdnlib │ ├── icon.png │ ├── icon.png.import │ ├── project.godot │ └── src │ │ ├── lib.rs │ │ └── player.rs ├── hello-world │ ├── Cargo.toml │ ├── Main.tscn │ ├── default_env.tres │ ├── hello_world_library.gdnlib │ ├── icon.png │ ├── icon.png.import │ ├── project.godot │ └── src │ │ └── lib.rs ├── native-plugin │ ├── Cargo.toml │ ├── Main.tscn │ ├── addons │ │ └── my_custom_node │ │ │ ├── custom_node.gdns │ │ │ └── plugin.cfg │ ├── default_env.tres │ ├── icon.png │ ├── icon.png.import │ ├── making_plugins-custom_node_icon.png │ ├── making_plugins-custom_node_icon.png.import │ ├── my_button.gdns │ ├── native_plugin.gdnlib │ ├── project.godot │ └── src │ │ └── lib.rs ├── property-export │ ├── Cargo.toml │ ├── GDScriptPrinter.gd │ ├── Main.tscn │ ├── default_env.tres │ ├── project.godot │ ├── property_export_library.gdnlib │ └── src │ │ └── lib.rs ├── resource │ ├── Cargo.toml │ ├── Greet.tres │ ├── GreetRust.tres │ ├── GreetWorld.tres │ ├── Main.tscn │ ├── default_env.tres │ ├── icon.png │ ├── icon.png.import │ ├── project.godot │ ├── resource_library.gdnlib │ └── src │ │ └── lib.rs ├── rpc │ ├── Cargo.toml │ ├── Client.tscn │ ├── README.md │ ├── Server.gdns │ ├── Server.tscn │ ├── ServerPuppet.gdns │ ├── client_server_library.gdnlib │ ├── default_env.tres │ ├── icon.png │ ├── icon.png.import │ ├── project.godot │ └── src │ │ ├── client.rs │ │ ├── lib.rs │ │ └── server.rs ├── scene-create │ ├── Cargo.toml │ ├── Child_scene.tscn │ ├── Main.tscn │ ├── Panel.gd │ ├── Parent.gdns │ ├── default_env.tres │ ├── icon.png │ ├── icon.png.import │ ├── project.godot │ ├── scene_create_library.gdnlib │ └── src │ │ └── lib.rs ├── signals │ ├── Cargo.toml │ ├── Signals.tscn │ ├── default_env.tres │ ├── icon.png │ ├── icon.png.import │ ├── project.godot │ ├── signals_library.gdnlib │ └── src │ │ └── lib.rs └── spinning-cube │ ├── Cargo.toml │ ├── Main.tscn │ ├── default_env.tres │ ├── icon.png │ ├── icon.png.import │ ├── project.godot │ ├── spinning_cube_library.gdnlib │ └── src │ └── lib.rs ├── gdnative-async ├── Cargo.toml └── src │ ├── executor.rs │ ├── future.rs │ ├── lib.rs │ ├── method.rs │ ├── rt.rs │ └── rt │ ├── bridge.rs │ └── func_state.rs ├── gdnative-bindings ├── Cargo.toml ├── api.json ├── build.rs ├── docs │ ├── @GlobalScope.xml │ ├── AABB.xml │ ├── AESContext.xml │ ├── ARVRAnchor.xml │ ├── ARVRCamera.xml │ ├── ARVRController.xml │ ├── ARVRInterface.xml │ ├── ARVROrigin.xml │ ├── ARVRPositionalTracker.xml │ ├── ARVRServer.xml │ ├── AStar.xml │ ├── AStar2D.xml │ ├── AcceptDialog.xml │ ├── AnimatedSprite.xml │ ├── AnimatedSprite3D.xml │ ├── AnimatedTexture.xml │ ├── Animation.xml │ ├── AnimationNode.xml │ ├── AnimationNodeAdd2.xml │ ├── AnimationNodeAdd3.xml │ ├── AnimationNodeAnimation.xml │ ├── AnimationNodeBlend2.xml │ ├── AnimationNodeBlend3.xml │ ├── AnimationNodeBlendSpace1D.xml │ ├── AnimationNodeBlendSpace2D.xml │ ├── AnimationNodeBlendTree.xml │ ├── AnimationNodeOneShot.xml │ ├── AnimationNodeOutput.xml │ ├── AnimationNodeStateMachine.xml │ ├── AnimationNodeStateMachinePlayback.xml │ ├── AnimationNodeStateMachineTransition.xml │ ├── AnimationNodeTimeScale.xml │ ├── AnimationNodeTimeSeek.xml │ ├── AnimationNodeTransition.xml │ ├── AnimationPlayer.xml │ ├── AnimationRootNode.xml │ ├── AnimationTrackEditPlugin.xml │ ├── AnimationTree.xml │ ├── AnimationTreePlayer.xml │ ├── Area.xml │ ├── Area2D.xml │ ├── Array.xml │ ├── ArrayMesh.xml │ ├── AspectRatioContainer.xml │ ├── AtlasTexture.xml │ ├── AudioBusLayout.xml │ ├── AudioEffect.xml │ ├── AudioEffectAmplify.xml │ ├── AudioEffectBandLimitFilter.xml │ ├── AudioEffectBandPassFilter.xml │ ├── AudioEffectCapture.xml │ ├── AudioEffectChorus.xml │ ├── AudioEffectCompressor.xml │ ├── AudioEffectDelay.xml │ ├── AudioEffectDistortion.xml │ ├── AudioEffectEQ.xml │ ├── AudioEffectEQ10.xml │ ├── AudioEffectEQ21.xml │ ├── AudioEffectEQ6.xml │ ├── AudioEffectFilter.xml │ ├── AudioEffectHighPassFilter.xml │ ├── AudioEffectHighShelfFilter.xml │ ├── AudioEffectInstance.xml │ ├── AudioEffectLimiter.xml │ ├── AudioEffectLowPassFilter.xml │ ├── AudioEffectLowShelfFilter.xml │ ├── AudioEffectNotchFilter.xml │ ├── AudioEffectPanner.xml │ ├── AudioEffectPhaser.xml │ ├── AudioEffectPitchShift.xml │ ├── AudioEffectRecord.xml │ ├── AudioEffectReverb.xml │ ├── AudioEffectSpectrumAnalyzer.xml │ ├── AudioEffectSpectrumAnalyzerInstance.xml │ ├── AudioEffectStereoEnhance.xml │ ├── AudioServer.xml │ ├── AudioStream.xml │ ├── AudioStreamGenerator.xml │ ├── AudioStreamGeneratorPlayback.xml │ ├── AudioStreamMicrophone.xml │ ├── AudioStreamPlayback.xml │ ├── AudioStreamPlaybackResampled.xml │ ├── AudioStreamPlayer.xml │ ├── AudioStreamPlayer2D.xml │ ├── AudioStreamPlayer3D.xml │ ├── AudioStreamRandomPitch.xml │ ├── AudioStreamSample.xml │ ├── BackBufferCopy.xml │ ├── BakedLightmap.xml │ ├── BakedLightmapData.xml │ ├── BaseButton.xml │ ├── Basis.xml │ ├── BitMap.xml │ ├── BitmapFont.xml │ ├── Bone2D.xml │ ├── BoneAttachment.xml │ ├── BoxContainer.xml │ ├── BoxShape.xml │ ├── Button.xml │ ├── ButtonGroup.xml │ ├── CPUParticles.xml │ ├── CPUParticles2D.xml │ ├── CallbackTweener.xml │ ├── Camera.xml │ ├── Camera2D.xml │ ├── CameraFeed.xml │ ├── CameraServer.xml │ ├── CameraTexture.xml │ ├── CanvasItem.xml │ ├── CanvasItemMaterial.xml │ ├── CanvasLayer.xml │ ├── CanvasModulate.xml │ ├── CapsuleMesh.xml │ ├── CapsuleShape.xml │ ├── CapsuleShape2D.xml │ ├── CenterContainer.xml │ ├── CharFXTransform.xml │ ├── CheckBox.xml │ ├── CheckButton.xml │ ├── CircleShape2D.xml │ ├── ClassDB.xml │ ├── ClippedCamera.xml │ ├── CollisionObject.xml │ ├── CollisionObject2D.xml │ ├── CollisionPolygon.xml │ ├── CollisionPolygon2D.xml │ ├── CollisionShape.xml │ ├── CollisionShape2D.xml │ ├── Color.xml │ ├── ColorPicker.xml │ ├── ColorPickerButton.xml │ ├── ColorRect.xml │ ├── ConcavePolygonShape.xml │ ├── ConcavePolygonShape2D.xml │ ├── ConeTwistJoint.xml │ ├── ConfigFile.xml │ ├── ConfirmationDialog.xml │ ├── Container.xml │ ├── Control.xml │ ├── ConvexPolygonShape.xml │ ├── ConvexPolygonShape2D.xml │ ├── Crypto.xml │ ├── CryptoKey.xml │ ├── CubeMap.xml │ ├── CubeMesh.xml │ ├── CullInstance.xml │ ├── Curve.xml │ ├── Curve2D.xml │ ├── Curve3D.xml │ ├── CurveTexture.xml │ ├── CylinderMesh.xml │ ├── CylinderShape.xml │ ├── DTLSServer.xml │ ├── DampedSpringJoint2D.xml │ ├── Dictionary.xml │ ├── DirectionalLight.xml │ ├── Directory.xml │ ├── DynamicFont.xml │ ├── DynamicFontData.xml │ ├── EditorExportPlugin.xml │ ├── EditorFeatureProfile.xml │ ├── EditorFileDialog.xml │ ├── EditorFileSystem.xml │ ├── EditorFileSystemDirectory.xml │ ├── EditorImportPlugin.xml │ ├── EditorInspector.xml │ ├── EditorInspectorPlugin.xml │ ├── EditorInterface.xml │ ├── EditorPlugin.xml │ ├── EditorProperty.xml │ ├── EditorResourceConversionPlugin.xml │ ├── EditorResourcePicker.xml │ ├── EditorResourcePreview.xml │ ├── EditorResourcePreviewGenerator.xml │ ├── EditorSceneImporter.xml │ ├── EditorScenePostImport.xml │ ├── EditorScript.xml │ ├── EditorScriptPicker.xml │ ├── EditorSelection.xml │ ├── EditorSettings.xml │ ├── EditorSpatialGizmo.xml │ ├── EditorSpatialGizmoPlugin.xml │ ├── EditorSpinSlider.xml │ ├── EditorVCSInterface.xml │ ├── EncodedObjectAsID.xml │ ├── Engine.xml │ ├── Environment.xml │ ├── Expression.xml │ ├── ExternalTexture.xml │ ├── File.xml │ ├── FileDialog.xml │ ├── FileSystemDock.xml │ ├── FlowContainer.xml │ ├── Font.xml │ ├── FuncRef.xml │ ├── GIProbe.xml │ ├── GIProbeData.xml │ ├── Generic6DOFJoint.xml │ ├── Geometry.xml │ ├── GeometryInstance.xml │ ├── Gradient.xml │ ├── GradientTexture.xml │ ├── GradientTexture2D.xml │ ├── GraphEdit.xml │ ├── GraphNode.xml │ ├── GridContainer.xml │ ├── GrooveJoint2D.xml │ ├── HBoxContainer.xml │ ├── HFlowContainer.xml │ ├── HMACContext.xml │ ├── HScrollBar.xml │ ├── HSeparator.xml │ ├── HSlider.xml │ ├── HSplitContainer.xml │ ├── HTTPClient.xml │ ├── HTTPRequest.xml │ ├── HashingContext.xml │ ├── HeightMapShape.xml │ ├── HingeJoint.xml │ ├── IP.xml │ ├── Image.xml │ ├── ImageTexture.xml │ ├── ImmediateGeometry.xml │ ├── Input.xml │ ├── InputEvent.xml │ ├── InputEventAction.xml │ ├── InputEventGesture.xml │ ├── InputEventJoypadButton.xml │ ├── InputEventJoypadMotion.xml │ ├── InputEventKey.xml │ ├── InputEventMIDI.xml │ ├── InputEventMagnifyGesture.xml │ ├── InputEventMouse.xml │ ├── InputEventMouseButton.xml │ ├── InputEventMouseMotion.xml │ ├── InputEventPanGesture.xml │ ├── InputEventScreenDrag.xml │ ├── InputEventScreenTouch.xml │ ├── InputEventWithModifiers.xml │ ├── InputMap.xml │ ├── InstancePlaceholder.xml │ ├── InterpolatedCamera.xml │ ├── IntervalTweener.xml │ ├── ItemList.xml │ ├── JNISingleton.xml │ ├── JSON.xml │ ├── JSONParseResult.xml │ ├── JSONRPC.xml │ ├── JavaClass.xml │ ├── JavaClassWrapper.xml │ ├── JavaScript.xml │ ├── JavaScriptObject.xml │ ├── Joint.xml │ ├── Joint2D.xml │ ├── KinematicBody.xml │ ├── KinematicBody2D.xml │ ├── KinematicCollision.xml │ ├── KinematicCollision2D.xml │ ├── Label.xml │ ├── Label3D.xml │ ├── LargeTexture.xml │ ├── Light.xml │ ├── Light2D.xml │ ├── LightOccluder2D.xml │ ├── Line2D.xml │ ├── LineEdit.xml │ ├── LineShape2D.xml │ ├── LinkButton.xml │ ├── Listener.xml │ ├── Listener2D.xml │ ├── MainLoop.xml │ ├── MarginContainer.xml │ ├── Marshalls.xml │ ├── Material.xml │ ├── MenuButton.xml │ ├── Mesh.xml │ ├── MeshDataTool.xml │ ├── MeshInstance.xml │ ├── MeshInstance2D.xml │ ├── MeshLibrary.xml │ ├── MeshTexture.xml │ ├── MethodTweener.xml │ ├── MultiMesh.xml │ ├── MultiMeshInstance.xml │ ├── MultiMeshInstance2D.xml │ ├── MultiplayerAPI.xml │ ├── Mutex.xml │ ├── Navigation.xml │ ├── Navigation2D.xml │ ├── Navigation2DServer.xml │ ├── NavigationAgent.xml │ ├── NavigationAgent2D.xml │ ├── NavigationMesh.xml │ ├── NavigationMeshGenerator.xml │ ├── NavigationMeshInstance.xml │ ├── NavigationObstacle.xml │ ├── NavigationObstacle2D.xml │ ├── NavigationPolygon.xml │ ├── NavigationPolygonInstance.xml │ ├── NavigationServer.xml │ ├── NetworkedMultiplayerCustom.xml │ ├── NetworkedMultiplayerPeer.xml │ ├── NinePatchRect.xml │ ├── Node.xml │ ├── Node2D.xml │ ├── NodePath.xml │ ├── OS.xml │ ├── Object.xml │ ├── Occluder.xml │ ├── OccluderPolygon2D.xml │ ├── OccluderShape.xml │ ├── OccluderShapePolygon.xml │ ├── OccluderShapeSphere.xml │ ├── OmniLight.xml │ ├── OptionButton.xml │ ├── PCKPacker.xml │ ├── PHashTranslation.xml │ ├── PackedDataContainer.xml │ ├── PackedDataContainerRef.xml │ ├── PackedScene.xml │ ├── PacketPeer.xml │ ├── PacketPeerDTLS.xml │ ├── PacketPeerStream.xml │ ├── PacketPeerUDP.xml │ ├── Panel.xml │ ├── PanelContainer.xml │ ├── PanoramaSky.xml │ ├── ParallaxBackground.xml │ ├── ParallaxLayer.xml │ ├── Particles.xml │ ├── Particles2D.xml │ ├── ParticlesMaterial.xml │ ├── Path.xml │ ├── Path2D.xml │ ├── PathFollow.xml │ ├── PathFollow2D.xml │ ├── Performance.xml │ ├── PhysicalBone.xml │ ├── Physics2DDirectBodyState.xml │ ├── Physics2DDirectSpaceState.xml │ ├── Physics2DServer.xml │ ├── Physics2DShapeQueryParameters.xml │ ├── Physics2DTestMotionResult.xml │ ├── PhysicsBody.xml │ ├── PhysicsBody2D.xml │ ├── PhysicsDirectBodyState.xml │ ├── PhysicsDirectSpaceState.xml │ ├── PhysicsMaterial.xml │ ├── PhysicsServer.xml │ ├── PhysicsShapeQueryParameters.xml │ ├── PhysicsTestMotionResult.xml │ ├── PinJoint.xml │ ├── PinJoint2D.xml │ ├── Plane.xml │ ├── PlaneMesh.xml │ ├── PlaneShape.xml │ ├── PointMesh.xml │ ├── Polygon2D.xml │ ├── PolygonPathFinder.xml │ ├── PoolByteArray.xml │ ├── PoolColorArray.xml │ ├── PoolIntArray.xml │ ├── PoolRealArray.xml │ ├── PoolStringArray.xml │ ├── PoolVector2Array.xml │ ├── PoolVector3Array.xml │ ├── Popup.xml │ ├── PopupDialog.xml │ ├── PopupMenu.xml │ ├── PopupPanel.xml │ ├── Portal.xml │ ├── Position2D.xml │ ├── Position3D.xml │ ├── PrimitiveMesh.xml │ ├── PrismMesh.xml │ ├── ProceduralSky.xml │ ├── ProgressBar.xml │ ├── ProjectSettings.xml │ ├── PropertyTweener.xml │ ├── ProximityGroup.xml │ ├── ProxyTexture.xml │ ├── QuadMesh.xml │ ├── Quat.xml │ ├── RID.xml │ ├── RandomNumberGenerator.xml │ ├── Range.xml │ ├── RayCast.xml │ ├── RayCast2D.xml │ ├── RayShape.xml │ ├── RayShape2D.xml │ ├── Rect2.xml │ ├── RectangleShape2D.xml │ ├── Reference.xml │ ├── ReferenceRect.xml │ ├── ReflectionProbe.xml │ ├── RemoteTransform.xml │ ├── RemoteTransform2D.xml │ ├── Resource.xml │ ├── ResourceFormatLoader.xml │ ├── ResourceFormatSaver.xml │ ├── ResourceImporter.xml │ ├── ResourceInteractiveLoader.xml │ ├── ResourceLoader.xml │ ├── ResourcePreloader.xml │ ├── ResourceSaver.xml │ ├── RichTextEffect.xml │ ├── RichTextLabel.xml │ ├── RigidBody.xml │ ├── RigidBody2D.xml │ ├── Room.xml │ ├── RoomGroup.xml │ ├── RoomManager.xml │ ├── RootMotionView.xml │ ├── SceneState.xml │ ├── SceneTree.xml │ ├── SceneTreeTimer.xml │ ├── SceneTreeTween.xml │ ├── Script.xml │ ├── ScriptCreateDialog.xml │ ├── ScriptEditor.xml │ ├── ScrollBar.xml │ ├── ScrollContainer.xml │ ├── SegmentShape2D.xml │ ├── Semaphore.xml │ ├── Separator.xml │ ├── Shader.xml │ ├── ShaderMaterial.xml │ ├── Shape.xml │ ├── Shape2D.xml │ ├── ShortCut.xml │ ├── Skeleton.xml │ ├── Skeleton2D.xml │ ├── SkeletonIK.xml │ ├── Skin.xml │ ├── SkinReference.xml │ ├── Sky.xml │ ├── Slider.xml │ ├── SliderJoint.xml │ ├── SoftBody.xml │ ├── Spatial.xml │ ├── SpatialGizmo.xml │ ├── SpatialMaterial.xml │ ├── SpatialVelocityTracker.xml │ ├── SphereMesh.xml │ ├── SphereShape.xml │ ├── SpinBox.xml │ ├── SplitContainer.xml │ ├── SpotLight.xml │ ├── SpringArm.xml │ ├── Sprite.xml │ ├── Sprite3D.xml │ ├── SpriteBase3D.xml │ ├── SpriteFrames.xml │ ├── StaticBody.xml │ ├── StaticBody2D.xml │ ├── StreamPeer.xml │ ├── StreamPeerBuffer.xml │ ├── StreamPeerSSL.xml │ ├── StreamPeerTCP.xml │ ├── StreamTexture.xml │ ├── String.xml │ ├── StyleBox.xml │ ├── StyleBoxEmpty.xml │ ├── StyleBoxFlat.xml │ ├── StyleBoxLine.xml │ ├── StyleBoxTexture.xml │ ├── SurfaceTool.xml │ ├── TCP_Server.xml │ ├── TabContainer.xml │ ├── Tabs.xml │ ├── TextEdit.xml │ ├── TextFile.xml │ ├── TextMesh.xml │ ├── Texture.xml │ ├── Texture3D.xml │ ├── TextureArray.xml │ ├── TextureButton.xml │ ├── TextureLayered.xml │ ├── TextureProgress.xml │ ├── TextureRect.xml │ ├── Theme.xml │ ├── Thread.xml │ ├── TileMap.xml │ ├── TileSet.xml │ ├── Time.xml │ ├── Timer.xml │ ├── ToolButton.xml │ ├── TouchScreenButton.xml │ ├── Transform.xml │ ├── Transform2D.xml │ ├── Translation.xml │ ├── TranslationServer.xml │ ├── Tree.xml │ ├── TreeItem.xml │ ├── TriangleMesh.xml │ ├── Tween.xml │ ├── Tweener.xml │ ├── UDPServer.xml │ ├── UndoRedo.xml │ ├── VBoxContainer.xml │ ├── VFlowContainer.xml │ ├── VScrollBar.xml │ ├── VSeparator.xml │ ├── VSlider.xml │ ├── VSplitContainer.xml │ ├── Variant.xml │ ├── Vector2.xml │ ├── Vector3.xml │ ├── VehicleBody.xml │ ├── VehicleWheel.xml │ ├── VideoPlayer.xml │ ├── VideoStream.xml │ ├── Viewport.xml │ ├── ViewportContainer.xml │ ├── ViewportTexture.xml │ ├── VisibilityEnabler.xml │ ├── VisibilityEnabler2D.xml │ ├── VisibilityNotifier.xml │ ├── VisibilityNotifier2D.xml │ ├── VisualInstance.xml │ ├── VisualServer.xml │ ├── VisualShader.xml │ ├── VisualShaderNode.xml │ ├── VisualShaderNodeBooleanConstant.xml │ ├── VisualShaderNodeBooleanUniform.xml │ ├── VisualShaderNodeColorConstant.xml │ ├── VisualShaderNodeColorFunc.xml │ ├── VisualShaderNodeColorOp.xml │ ├── VisualShaderNodeColorUniform.xml │ ├── VisualShaderNodeCompare.xml │ ├── VisualShaderNodeCubeMap.xml │ ├── VisualShaderNodeCubeMapUniform.xml │ ├── VisualShaderNodeCustom.xml │ ├── VisualShaderNodeDeterminant.xml │ ├── VisualShaderNodeDotProduct.xml │ ├── VisualShaderNodeExpression.xml │ ├── VisualShaderNodeFaceForward.xml │ ├── VisualShaderNodeFresnel.xml │ ├── VisualShaderNodeGlobalExpression.xml │ ├── VisualShaderNodeGroupBase.xml │ ├── VisualShaderNodeIf.xml │ ├── VisualShaderNodeInput.xml │ ├── VisualShaderNodeIs.xml │ ├── VisualShaderNodeOuterProduct.xml │ ├── VisualShaderNodeOutput.xml │ ├── VisualShaderNodeScalarClamp.xml │ ├── VisualShaderNodeScalarConstant.xml │ ├── VisualShaderNodeScalarDerivativeFunc.xml │ ├── VisualShaderNodeScalarFunc.xml │ ├── VisualShaderNodeScalarInterp.xml │ ├── VisualShaderNodeScalarOp.xml │ ├── VisualShaderNodeScalarSmoothStep.xml │ ├── VisualShaderNodeScalarSwitch.xml │ ├── VisualShaderNodeScalarUniform.xml │ ├── VisualShaderNodeSwitch.xml │ ├── VisualShaderNodeTexture.xml │ ├── VisualShaderNodeTextureUniform.xml │ ├── VisualShaderNodeTextureUniformTriplanar.xml │ ├── VisualShaderNodeTransformCompose.xml │ ├── VisualShaderNodeTransformConstant.xml │ ├── VisualShaderNodeTransformDecompose.xml │ ├── VisualShaderNodeTransformFunc.xml │ ├── VisualShaderNodeTransformMult.xml │ ├── VisualShaderNodeTransformUniform.xml │ ├── VisualShaderNodeTransformVecMult.xml │ ├── VisualShaderNodeUniform.xml │ ├── VisualShaderNodeUniformRef.xml │ ├── VisualShaderNodeVec3Constant.xml │ ├── VisualShaderNodeVec3Uniform.xml │ ├── VisualShaderNodeVectorClamp.xml │ ├── VisualShaderNodeVectorCompose.xml │ ├── VisualShaderNodeVectorDecompose.xml │ ├── VisualShaderNodeVectorDerivativeFunc.xml │ ├── VisualShaderNodeVectorDistance.xml │ ├── VisualShaderNodeVectorFunc.xml │ ├── VisualShaderNodeVectorInterp.xml │ ├── VisualShaderNodeVectorLen.xml │ ├── VisualShaderNodeVectorOp.xml │ ├── VisualShaderNodeVectorRefract.xml │ ├── VisualShaderNodeVectorScalarMix.xml │ ├── VisualShaderNodeVectorScalarSmoothStep.xml │ ├── VisualShaderNodeVectorScalarStep.xml │ ├── VisualShaderNodeVectorSmoothStep.xml │ ├── WeakRef.xml │ ├── WindowDialog.xml │ ├── World.xml │ ├── World2D.xml │ ├── WorldEnvironment.xml │ ├── X509Certificate.xml │ ├── XMLParser.xml │ ├── YSort.xml │ ├── bool.xml │ ├── float.xml │ └── int.xml └── src │ ├── generated.rs │ ├── icalls.rs │ ├── lib.rs │ └── utils.rs ├── gdnative-core ├── Cargo.toml └── src │ ├── core_types │ ├── access.rs │ ├── array.rs │ ├── color.rs │ ├── dictionary.rs │ ├── error.rs │ ├── geom │ │ ├── aabb.rs │ │ ├── basis.rs │ │ ├── mod.rs │ │ ├── plane.rs │ │ ├── quat.rs │ │ ├── rect2.rs │ │ ├── transform.rs │ │ └── transform2d.rs │ ├── mod.rs │ ├── node_path.rs │ ├── pool_array.rs │ ├── pool_array │ │ └── godot_tests.rs │ ├── rid.rs │ ├── string.rs │ ├── variant.rs │ ├── variant │ │ └── serialize.rs │ ├── vector2.rs │ └── vector3.rs │ ├── export │ ├── class.rs │ ├── class_builder.rs │ ├── class_registry.rs │ ├── emplace.rs │ ├── method.rs │ ├── mod.rs │ ├── property.rs │ ├── property │ │ ├── accessor.rs │ │ ├── hint.rs │ │ └── invalid_accessor.rs │ ├── signal.rs │ ├── type_tag.rs │ └── user_data.rs │ ├── globalscope.rs │ ├── init │ ├── diagnostics.rs │ ├── diagnostics │ │ ├── godot_version_mismatch.rs │ │ ├── missing_manual_registration.rs │ │ └── missing_suggested_diagnostics.rs │ ├── info.rs │ ├── init_handle.rs │ ├── macros.rs │ ├── mod.rs │ ├── private.rs │ └── terminate_handle.rs │ ├── lib.rs │ ├── log.rs │ ├── macros.rs │ ├── object │ ├── as_arg.rs │ ├── bounds.rs │ ├── instance.rs │ ├── instance │ │ └── receiver.rs │ ├── memory.rs │ ├── mod.rs │ ├── new_ref.rs │ ├── ownership.rs │ └── raw.rs │ ├── private.rs │ └── profiler.rs ├── gdnative-derive ├── Cargo.toml └── src │ ├── init.rs │ ├── lib.rs │ ├── methods.rs │ ├── methods │ └── mixin_args.rs │ ├── native_script │ ├── mod.rs │ └── property_args.rs │ ├── profiled.rs │ ├── syntax.rs │ ├── syntax │ └── rpc_mode.rs │ ├── utils.rs │ ├── utils │ ├── extend_bounds.rs │ └── find_non_concrete.rs │ ├── varargs.rs │ └── variant │ ├── attr.rs │ ├── attr │ ├── field.rs │ └── item.rs │ ├── bounds.rs │ ├── from.rs │ ├── mod.rs │ ├── repr.rs │ └── to.rs ├── gdnative-sys ├── Cargo.toml ├── build.rs ├── godot_headers │ ├── LICENSE.md │ ├── README.md │ ├── android │ │ └── godot_android.h │ ├── arvr │ │ └── godot_arvr.h │ ├── gdnative │ │ ├── aabb.h │ │ ├── array.h │ │ ├── basis.h │ │ ├── color.h │ │ ├── dictionary.h │ │ ├── gdnative.h │ │ ├── node_path.h │ │ ├── plane.h │ │ ├── pool_arrays.h │ │ ├── quat.h │ │ ├── rect2.h │ │ ├── rid.h │ │ ├── string.h │ │ ├── string_name.h │ │ ├── transform.h │ │ ├── transform2d.h │ │ ├── variant.h │ │ ├── vector2.h │ │ └── vector3.h │ ├── gdnative_api.json │ ├── gdnative_api_struct.gen.h │ ├── images │ │ └── faq │ │ │ ├── create_dlscript.png │ │ │ ├── dllibrary_create_new_dllibrary.png │ │ │ ├── dllibrary_create_new_resource.png │ │ │ ├── dllibrary_save_as_resource.png │ │ │ ├── set_project_dllibrary.png │ │ │ └── set_script_dllibrary.png │ ├── nativescript │ │ └── godot_nativescript.h │ ├── net │ │ ├── godot_net.h │ │ └── godot_webrtc.h │ ├── pluginscript │ │ └── godot_pluginscript.h │ └── videodecoder │ │ └── godot_videodecoder.h └── src │ └── lib.rs ├── gdnative ├── Cargo.toml ├── src │ ├── globalscope.rs │ ├── lib.rs │ └── prelude.rs └── tests │ ├── ui.rs │ └── ui │ ├── derive_fail_inherit_param.rs │ ├── derive_fail_inherit_param.stderr │ ├── derive_fail_lifetime.rs │ ├── derive_fail_lifetime.stderr │ ├── derive_fail_methods.rs │ ├── derive_fail_methods.stderr │ ├── derive_fail_methods_list.rs │ ├── derive_fail_methods_list.stderr │ ├── derive_fail_methods_missing_new.rs │ ├── derive_fail_methods_missing_new.stderr │ ├── derive_fail_methods_param.rs │ ├── derive_fail_methods_param.stderr │ ├── derive_fail_methods_special_args.rs │ ├── derive_fail_methods_special_args.stderr │ ├── derive_fail_property_empty_hint.rs │ ├── derive_fail_property_empty_hint.stderr │ ├── derive_fail_property_hint.rs │ ├── derive_fail_property_hint.stderr │ ├── derive_fail_userdata.rs │ ├── derive_fail_userdata.stderr │ ├── derive_flexible_self_types.rs │ ├── derive_no_inherit.rs │ ├── derive_pass.rs │ ├── derive_property_basic.rs │ ├── derive_property_fail_inherit.rs │ ├── from_variant_fail_01.rs │ ├── from_variant_fail_01.stderr │ ├── from_variant_fail_02.rs │ ├── from_variant_fail_02.stderr │ ├── from_variant_fail_03.rs │ ├── from_variant_fail_03.stderr │ ├── from_variant_fail_04.rs │ ├── from_variant_fail_04.stderr │ ├── from_variant_fail_05.rs │ ├── from_variant_fail_05.stderr │ ├── from_variant_fail_06.rs │ ├── from_variant_fail_06.stderr │ ├── from_variant_fail_07.rs │ ├── from_variant_fail_07.stderr │ ├── from_variant_fail_08.rs │ ├── from_variant_fail_08.stderr │ ├── from_variant_fail_09.rs │ ├── from_variant_fail_09.stderr │ ├── to_variant_fail_01.rs │ ├── to_variant_fail_01.stderr │ ├── to_variant_fail_02.rs │ ├── to_variant_fail_02.stderr │ ├── to_variant_fail_03.rs │ ├── to_variant_fail_03.stderr │ ├── to_variant_fail_04.rs │ ├── to_variant_fail_04.stderr │ ├── to_variant_fail_05.rs │ ├── to_variant_fail_05.stderr │ ├── to_variant_fail_06.rs │ ├── to_variant_fail_06.stderr │ ├── to_variant_fail_07.rs │ ├── to_variant_fail_07.stderr │ ├── to_variant_fail_08.rs │ ├── to_variant_fail_08.stderr │ ├── to_variant_fail_09.rs │ ├── to_variant_fail_09.stderr │ └── variant_pass.rs ├── impl └── proc-macros │ ├── Cargo.toml │ └── src │ ├── cfg_ex.rs │ ├── lib.rs │ └── pool_array_element.rs ├── rustfmt.toml ├── test ├── Cargo.toml ├── project │ ├── Scene.tscn │ ├── addons │ │ └── editor_test_runner │ │ │ ├── plugin.cfg │ │ │ └── plugin.gd │ ├── gdnative.gdnlib │ ├── lib │ │ └── .gitkeep │ ├── main.gd │ ├── project.godot │ └── tests.gd └── src │ ├── lib.rs │ ├── test_as_arg.rs │ ├── test_async.rs │ ├── test_constructor.rs │ ├── test_derive.rs │ ├── test_free_ub.rs │ ├── test_generic_class.rs │ ├── test_indexed_props.rs │ ├── test_map_owned.rs │ ├── test_register.rs │ ├── test_return_leak.rs │ ├── test_serde.rs │ ├── test_vararray_return.rs │ ├── test_variant_call_args.rs │ └── test_variant_ops.rs └── tools ├── check-test-output.sh ├── deny.toml ├── detect-todo.sh ├── required-errors.txt └── update-version.sh /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: 'Behavior which is broken or not conforming to documentation' 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | 19 | 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: 'Suggest new functionality to be added' 4 | title: '' 5 | labels: feature 6 | assignees: '' 7 | 8 | --- 9 | 10 | 17 | 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/quality-of-life.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Quality of life 3 | about: 'Improve existing parts: API design, documentation, refactoring' 4 | title: '' 5 | labels: quality-of-life 6 | assignees: '' 7 | 8 | --- 9 | 10 | 18 | 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: 'Ask a question about the library. Or, join our Discord: https://discord.gg/FNudpBD' 4 | title: '' 5 | labels: question 6 | assignees: jacobsky 7 | 8 | --- 9 | 10 | 17 | 18 | -------------------------------------------------------------------------------- /.github/composite/llvm/action.yml: -------------------------------------------------------------------------------- 1 | name: llvm 2 | description: "Install LLVM + Clang, with caching" 3 | 4 | #inputs: 5 | # llvm: 6 | # required: false 7 | # default: 'true' 8 | # description: "Whether LLVM should be installed ('true' by default)" 9 | 10 | runs: 11 | using: "composite" 12 | steps: 13 | - name: Cache LLVM and Clang 14 | id: cache-llvm 15 | # Note: conditionals not yet supported; see https://github.com/actions/runner/issues/834 16 | # if: ${{ inputs.llvm == 'true' }} 17 | uses: actions/cache@v4 18 | with: 19 | path: ${{ runner.temp }}/llvm 20 | key: llvm-10.0 21 | - uses: KyleMayes/install-llvm-action@v1 22 | # if: ${{ inputs.llvm == 'true' }} 23 | with: 24 | version: "10.0" 25 | directory: ${{ runner.temp }}/llvm 26 | cached: ${{ steps.cache-llvm.outputs.cache-hit }} 27 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "cargo" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /.github/external-config/public-docs-token.txt: -------------------------------------------------------------------------------- 1 | MTFBQUZNN0NBMGZzSGFaOVJFSmRtdV9IYnJXVEFZVEoxNDJ3N3VPTG1UY3UyTnlQM1h2RXNoMjZTMmNtdEhLa2hOQlFOVllWTVlhSTE1bk1JUwo= -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDEs 2 | .vscode 3 | .idea 4 | 5 | # Build and package artifacts 6 | target 7 | */target 8 | *.rlib 9 | **/Cargo.lock 10 | 11 | # Godot 12 | # ignore all files in test/project/lib/, except the .gitkeep as the directory should still be there 13 | test/project/lib/* 14 | !test/project/lib/.gitkeep 15 | **/.import/* 16 | /logs 17 | 18 | # OS-specific 19 | .DS_Store 20 | 21 | # User stuff 22 | /ignore 23 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "gdnative-sys-tmp/godot_headers"] 2 | path = gdnative-sys-bindgen/godot_headers 3 | url = https://github.com/GodotNativeTools/godot_headers 4 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = [ 4 | "gdnative", 5 | "gdnative-async", 6 | "gdnative-bindings", 7 | "gdnative-core", 8 | "gdnative-derive", 9 | "gdnative-sys", 10 | "test", 11 | "bindings-generator", 12 | "examples/hello-world", 13 | "examples/spinning-cube", 14 | "examples/scene-create", 15 | "examples/signals", 16 | "examples/dodge-the-creeps", 17 | "examples/resource", 18 | "examples/native-plugin", 19 | "examples/rpc", 20 | "examples/builder-export", 21 | "examples/property-export", 22 | "examples/godot_tps_controller_port", 23 | "impl/proc-macros" 24 | ] 25 | 26 | [profile.dev.package.miniserde] 27 | opt-level = 0 28 | -------------------------------------------------------------------------------- /bindings-generator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gdnative_bindings_generator" 3 | authors = ["The godot-rust developers"] 4 | description = "Generates bindings for the Godot engine's gdnative classes from a json api description file." 5 | documentation = "https://docs.rs/crate/gdnative_bindings_generator" 6 | repository = "https://github.com/godot-rust/godot-rust" 7 | homepage = "https://godot-rust.github.io/" 8 | license = "MIT" 9 | version = "0.11.3" 10 | workspace = ".." 11 | edition = "2021" 12 | rust-version = "1.70" 13 | 14 | [features] 15 | debug = [] 16 | ptrcall = [] 17 | custom-godot = ["which"] 18 | 19 | [dependencies] 20 | heck = "0.5" 21 | miniserde = "0.1.16" 22 | proc-macro2 = "1" 23 | quote = "1" 24 | regex = { version = "1.5.5", default-features = false, features = ["std", "unicode-perl"] } # for security: https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html 25 | roxmltree = "0.19" 26 | syn = { version = "1.0.84", features = ["full", "extra-traits", "visit"] } 27 | unindent = "0.2.0" 28 | which = { optional = true, version = "5" } 29 | -------------------------------------------------------------------------------- /examples/builder-export/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "builder-export" 3 | version = "0.1.0" 4 | authors = ["The godot-rust developers"] 5 | edition = "2021" 6 | rust-version = "1.70" 7 | license = "MIT" 8 | publish = false 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | gdnative = { path = "../../gdnative" } 15 | -------------------------------------------------------------------------------- /examples/builder-export/ExportsArrays.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://builder_export_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "ExportsArrays" 7 | class_name = "ExportsArrays" 8 | library = ExtResource( 1 ) 9 | script_class_name = "ExportsArrays" 10 | -------------------------------------------------------------------------------- /examples/builder-export/ExportsArrays.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://ExportsArrays.gdns" type="Script" id=1] 4 | 5 | [node name="ExportsArrays" type="Node"] 6 | script = ExtResource( 1 ) 7 | single_array = [ 133.7, 1337, "Third Element" ] 8 | single_array_range = [ -5, 1, 3, -3, 0 ] 9 | double_array = [ [ 6, "(0, 1)" ], [ "Element 1, 0", 1375.5 ] ] 10 | double_array_range = [ [ -2, 3 ], [ 4, -5 ] ] 11 | -------------------------------------------------------------------------------- /examples/builder-export/builder_export_library.gdnlib: -------------------------------------------------------------------------------- 1 | [entry] 2 | 3 | X11.64="res://../../target/debug/libbuilder_export.so" 4 | OSX.64="res://../../target/debug/libbuilder_export.dylib" 5 | Windows.64="res://../../target/debug/builder_export.dll" 6 | 7 | [dependencies] 8 | 9 | X11.64=[ ] 10 | OSX.64=[ ] 11 | 12 | [general] 13 | 14 | singleton=false 15 | load_once=true 16 | symbol_prefix="godot_" 17 | reloadable=true 18 | -------------------------------------------------------------------------------- /examples/builder-export/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /examples/builder-export/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/builder-export/icon.png -------------------------------------------------------------------------------- /examples/builder-export/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/builder-export/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ { 12 | "base": "", 13 | "class": "ExportsArrays", 14 | "language": "NativeScript", 15 | "path": "res://ExportsArrays.gdns" 16 | } ] 17 | _global_script_class_icons={ 18 | "ExportsArrays": "" 19 | } 20 | 21 | [application] 22 | 23 | config/name="builder_export" 24 | run/main_scene="res://ExportsArrays.tscn" 25 | config/icon="res://icon.png" 26 | 27 | [rendering] 28 | 29 | quality/driver/driver_name="GLES2" 30 | vram_compression/import_etc=true 31 | vram_compression/import_etc2=false 32 | environment/default_environment="res://default_env.tres" 33 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dodge-the-creeps" 3 | version = "0.1.0" 4 | authors = ["The godot-rust developers"] 5 | publish = false 6 | edition = "2021" 7 | rust-version = "1.70" 8 | license = "MIT" 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | gdnative = { path = "../../gdnative" } 15 | rand = "0.8" 16 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/Hud.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://dodge_the_creeps_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Hud" 7 | class_name = "Hud" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/Main.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://dodge_the_creeps_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Main" 7 | class_name = "Main" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/Mob.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://dodge_the_creeps_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Mob" 7 | class_name = "Mob" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/Player.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://dodge_the_creeps_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Player" 7 | class_name = "Player" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/README.md: -------------------------------------------------------------------------------- 1 | Dodge-the-creeps example assets by Juan Linietsky, Ariel Manzur and the Godot community, licensed under CC BY 3.0 2 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/House In a Forest Loop.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/House In a Forest Loop.ogg -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/House In a Forest Loop.ogg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="ogg_vorbis" 4 | type="AudioStreamOGGVorbis" 5 | path="res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggstr" 6 | 7 | [deps] 8 | 9 | source_file="res://art/House In a Forest Loop.ogg" 10 | dest_files=[ "res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggstr" ] 11 | 12 | [params] 13 | 14 | loop=true 15 | loop_offset=0 16 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemyFlyingAlt_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/enemyFlyingAlt_1.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemyFlyingAlt_1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://art/enemyFlyingAlt_1.png" 13 | dest_files=[ "res://.import/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemyFlyingAlt_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/enemyFlyingAlt_2.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemyFlyingAlt_2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://art/enemyFlyingAlt_2.png" 13 | dest_files=[ "res://.import/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemySwimming_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/enemySwimming_1.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemySwimming_1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://art/enemySwimming_1.png" 13 | dest_files=[ "res://.import/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemySwimming_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/enemySwimming_2.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemySwimming_2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://art/enemySwimming_2.png" 13 | dest_files=[ "res://.import/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemyWalking_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/enemyWalking_1.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemyWalking_1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://art/enemyWalking_1.png" 13 | dest_files=[ "res://.import/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemyWalking_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/enemyWalking_2.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/enemyWalking_2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://art/enemyWalking_2.png" 13 | dest_files=[ "res://.import/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/gameover.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/gameover.wav -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/gameover.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://art/gameover.wav" 10 | dest_files=[ "res://.import/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=true 19 | edit/normalize=true 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/playerGrey_up1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/playerGrey_up1.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/playerGrey_up1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://art/playerGrey_up1.png" 13 | dest_files=[ "res://.import/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/playerGrey_up2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/playerGrey_up2.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/playerGrey_up2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://art/playerGrey_up2.png" 13 | dest_files=[ "res://.import/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/playerGrey_walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/playerGrey_walk1.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/playerGrey_walk1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://art/playerGrey_walk1.png" 13 | dest_files=[ "res://.import/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/playerGrey_walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/art/playerGrey_walk2.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/art/playerGrey_walk2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/playerGrey_walk2.png-34d2d916366100182d08037c51884043.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://art/playerGrey_walk2.png" 13 | dest_files=[ "res://.import/playerGrey_walk2.png-34d2d916366100182d08037c51884043.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/dodge_the_creeps_library.gdnlib: -------------------------------------------------------------------------------- 1 | [entry] 2 | 3 | X11.64="res://../../target/debug/libdodge_the_creeps.so" 4 | OSX.64="res://../../target/debug/libdodge_the_creeps.dylib" 5 | Windows.64="res://../../target/debug/dodge_the_creeps.dll" 6 | 7 | [dependencies] 8 | 9 | X11.64=[ ] 10 | OSX.64=[ ] 11 | 12 | [general] 13 | 14 | singleton=false 15 | load_once=true 16 | symbol_prefix="godot_" 17 | reloadable=true 18 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/fonts/Xolonium-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/fonts/Xolonium-Regular.ttf -------------------------------------------------------------------------------- /examples/dodge-the-creeps/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/dodge-the-creeps/icon.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="dodge_the_creeps" 19 | run/main_scene="res://Main.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [display] 23 | 24 | window/size/width=480 25 | window/size/height=720 26 | 27 | [rendering] 28 | 29 | environment/default_environment="res://default_env.tres" 30 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/src/lib.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | mod hud; 4 | mod main_scene; 5 | mod mob; 6 | mod player; 7 | 8 | struct DtcLibrary; 9 | 10 | #[gdnative::init::callbacks] 11 | impl GDNativeCallbacks for DtcLibrary { 12 | fn nativescript_init(handle: InitHandle) { 13 | handle.add_class::(); 14 | handle.add_class::(); 15 | handle.add_class::(); 16 | handle.add_class::(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/.gitignore: -------------------------------------------------------------------------------- 1 | # Player assets are acquired manually 2 | /player 3 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tps_controller_port" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["The godot-rust developers"] 6 | publish = false 7 | rust-version = "1.70" 8 | license = "MIT" 9 | 10 | [dependencies] 11 | gdnative = { path = "../../gdnative", features = ["formatted"] } 12 | 13 | [lib] 14 | crate-type = ["cdylib"] 15 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/Levels/Main/Environment.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=5] 4 | sky_top_color = Color( 0.568627, 0.698039, 0.807843, 1 ) 5 | sky_horizon_color = Color( 0.67451, 0.705882, 0.733333, 1 ) 6 | ground_bottom_color = Color( 0.121569, 0.121569, 0.129412, 1 ) 7 | ground_horizon_color = Color( 0.67451, 0.705882, 0.733333, 1 ) 8 | sun_latitude = 60.0 9 | sun_longitude = 30.0 10 | 11 | [resource] 12 | background_mode = 2 13 | background_sky = SubResource( 5 ) 14 | tonemap_mode = 2 15 | ssao_quality = 0 16 | ssao_blur = 2 17 | glow_enabled = true 18 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/Levels/Main/Geometry/Cube.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://Levels/Main/Materials/M_Dark.tres" type="Material" id=1] 4 | 5 | [sub_resource type="CubeMesh" id=1] 6 | 7 | [sub_resource type="BoxShape" id=2] 8 | 9 | [node name="Cube" type="MeshInstance"] 10 | mesh = SubResource( 1 ) 11 | material/0 = ExtResource( 1 ) 12 | 13 | [node name="StaticBody" type="StaticBody" parent="."] 14 | 15 | [node name="CollisionShape" type="CollisionShape" parent="StaticBody"] 16 | shape = SubResource( 2 ) 17 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/Levels/Main/Geometry/Floor.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://Levels/Main/Materials/M_Dark.tres" type="Material" id=1] 4 | 5 | [sub_resource type="CubeMesh" id=1] 6 | material = ExtResource( 1 ) 7 | size = Vector3( 40, 0.5, 40 ) 8 | 9 | [sub_resource type="BoxShape" id=3] 10 | extents = Vector3( 20, 0.25, 20 ) 11 | 12 | [node name="Floor" type="MeshInstance"] 13 | mesh = SubResource( 1 ) 14 | material/0 = null 15 | 16 | [node name="StaticBody" type="StaticBody" parent="."] 17 | 18 | [node name="CollisionShape" type="CollisionShape" parent="StaticBody"] 19 | shape = SubResource( 3 ) 20 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/Levels/Main/Geometry/Wall.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://Levels/Main/Materials/M_Dark.tres" type="Material" id=1] 4 | 5 | [sub_resource type="CubeMesh" id=2] 6 | material = ExtResource( 1 ) 7 | size = Vector3( 40, 12, 1 ) 8 | 9 | [sub_resource type="BoxShape" id=4] 10 | extents = Vector3( 20, 6, 0.5 ) 11 | 12 | [node name="Wall" type="MeshInstance"] 13 | mesh = SubResource( 2 ) 14 | material/0 = null 15 | 16 | [node name="StaticBody" type="StaticBody" parent="."] 17 | 18 | [node name="CollisionShape" type="CollisionShape" parent="StaticBody"] 19 | shape = SubResource( 4 ) 20 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/Levels/Main/L_Main.gd: -------------------------------------------------------------------------------- 1 | extends Spatial 2 | 3 | #-----------------SCENE--SCRIPT------------------# 4 | # Close your game faster by clicking 'Esc' # 5 | # Change mouse mode by clicking 'Shift + F1' # 6 | #------------------------------------------------# 7 | 8 | export var fast_close := true 9 | 10 | 11 | # Called when the node enters the scene tree for the first time. 12 | func _ready() -> void: 13 | Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) 14 | 15 | if !OS.is_debug_build(): 16 | fast_close = false 17 | 18 | if fast_close: 19 | print("** Fast Close enabled in the 'L_Main.gd' script **") 20 | print("** 'Esc' to close 'Shift + F1' to release mouse **") 21 | 22 | set_process_input(fast_close) 23 | 24 | 25 | func _input(event: InputEvent) -> void: 26 | if event.is_action_pressed("ui_cancel"): 27 | get_tree().quit() # Quits the game 28 | 29 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/Levels/Main/Materials/M_Dark.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="SpatialMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Levels/Main/Materials/T_Grid.png" type="Texture" id=1] 4 | 5 | [resource] 6 | params_diffuse_mode = 1 7 | albedo_texture = ExtResource( 1 ) 8 | metallic_specular = 0.0 9 | uv1_scale = Vector3( 0.5, 0.5, 0.5 ) 10 | uv1_offset = Vector3( 0.5, 0.5, 0.5 ) 11 | uv1_triplanar = true 12 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/Levels/Main/Materials/T_Grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/godot_tps_controller_port/Levels/Main/Materials/T_Grid.png -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/Player.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://godot_rust_tps_port.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Player" 7 | class_name = "Player" 8 | library = ExtResource( 1 ) 9 | script_class_name = "PlayerScript" 10 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/effects_shared/BlastMesh.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/godot_tps_controller_port/effects_shared/BlastMesh.glb -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/effects_shared/BlastMesh_Sphere.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/godot_tps_controller_port/effects_shared/BlastMesh_Sphere.mesh -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/effects_shared/BlastTexture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/godot_tps_controller_port/effects_shared/BlastTexture.png -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/godot_rust_tps_port.gdnlib: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | singleton=false 4 | load_once=true 5 | symbol_prefix="godot_" 6 | reloadable=true 7 | 8 | [entry] 9 | 10 | Windows.64="res://../../target/debug/tps_controller_port.dll" 11 | X11.64="res://../../target/debug/libtps_controller_port.so" 12 | OSX.64="res://../../target/debug/libtps_controller_port.dylib" 13 | 14 | [dependencies] 15 | 16 | X11.64=[ ] 17 | OSX.64=[ ] 18 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/godot_tps_controller_port/icon.png -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /examples/godot_tps_controller_port/src/lib.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | mod player; 4 | 5 | struct TpsLibrary; 6 | 7 | #[gdnative::init::callbacks] 8 | impl GDNativeCallbacks for TpsLibrary { 9 | fn nativescript_init(handle: InitHandle) { 10 | handle.add_class::(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/hello-world/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hello-world" 3 | version = "0.1.0" 4 | authors = ["The godot-rust developers"] 5 | publish = false 6 | edition = "2021" 7 | rust-version = "1.70" 8 | license = "MIT" 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | gdnative = { path = "../../gdnative" } 15 | -------------------------------------------------------------------------------- /examples/hello-world/Main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://hello_world_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [sub_resource type="NativeScript" id=1] 6 | resource_name = "HelloWorld" 7 | class_name = "HelloWorld" 8 | library = ExtResource( 1 ) 9 | 10 | [node name="Node" type="Node"] 11 | script = SubResource( 1 ) 12 | -------------------------------------------------------------------------------- /examples/hello-world/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) 5 | sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) 6 | sky_curve = 0.25 7 | ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) 8 | ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) 9 | ground_curve = 0.01 10 | sun_energy = 16.0 11 | 12 | [resource] 13 | background_mode = 2 14 | background_sky = SubResource( 1 ) 15 | -------------------------------------------------------------------------------- /examples/hello-world/hello_world_library.gdnlib: -------------------------------------------------------------------------------- 1 | [entry] 2 | 3 | X11.64="res://../../target/debug/libhello_world.so" 4 | OSX.64="res://../../target/debug/libhello_world.dylib" 5 | Windows.64="res://../../target/debug/hello_world.dll" 6 | 7 | [dependencies] 8 | 9 | X11.64=[ ] 10 | OSX.64=[ ] 11 | 12 | [general] 13 | 14 | singleton=false 15 | load_once=true 16 | symbol_prefix="godot_" 17 | reloadable=true 18 | -------------------------------------------------------------------------------- /examples/hello-world/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/hello-world/icon.png -------------------------------------------------------------------------------- /examples/hello-world/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/hello-world/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="Godot Rust - Hello World" 19 | run/main_scene="res://Main.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [rendering] 23 | 24 | environment/default_environment="res://default_env.tres" 25 | -------------------------------------------------------------------------------- /examples/hello-world/src/lib.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | #[inherit(Node)] 5 | struct HelloWorld; 6 | 7 | #[methods] 8 | impl HelloWorld { 9 | fn new(_owner: &Node) -> Self { 10 | HelloWorld 11 | } 12 | 13 | #[method] 14 | fn _ready(&self) { 15 | godot_print!("hello, world.") 16 | } 17 | } 18 | 19 | struct HelloWorldLibrary; 20 | 21 | #[gdnative::init::callbacks] 22 | impl GDNativeCallbacks for HelloWorldLibrary { 23 | fn nativescript_init(handle: InitHandle) { 24 | handle.add_class::(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/native-plugin/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "native-plugin" 3 | version = "0.1.0" 4 | authors = ["The godot-rust developers"] 5 | edition = "2021" 6 | rust-version = "1.70" 7 | license = "MIT" 8 | publish = false 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | gdnative = { path = "../../gdnative" } 15 | -------------------------------------------------------------------------------- /examples/native-plugin/Main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://my_button.gdns" type="Script" id=1] 4 | 5 | [node name="Node2D" type="Node2D"] 6 | 7 | [node name="MyButton" type="Button" parent="."] 8 | margin_right = 359.0 9 | margin_bottom = 175.0 10 | text = "Click me!" 11 | script = ExtResource( 1 ) 12 | __meta__ = { 13 | "_edit_use_anchors_": false 14 | } 15 | -------------------------------------------------------------------------------- /examples/native-plugin/addons/my_custom_node/custom_node.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://native_plugin.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | class_name = "CustomNode" 7 | library = ExtResource( 1 ) 8 | script_class_name = "CustomNode" 9 | -------------------------------------------------------------------------------- /examples/native-plugin/addons/my_custom_node/plugin.cfg: -------------------------------------------------------------------------------- 1 | [plugin] 2 | 3 | name="My Custom Node" 4 | description="A custom node made to extend the Godot Engine." 5 | author="Your Name" 6 | version="1.0.0" 7 | script="custom_node.gdns" 8 | -------------------------------------------------------------------------------- /examples/native-plugin/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /examples/native-plugin/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/native-plugin/icon.png -------------------------------------------------------------------------------- /examples/native-plugin/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/native-plugin/making_plugins-custom_node_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/native-plugin/making_plugins-custom_node_icon.png -------------------------------------------------------------------------------- /examples/native-plugin/making_plugins-custom_node_icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/making_plugins-custom_node_icon.png-e44ae0012523a40f310f84bdbc218b0c.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://making_plugins-custom_node_icon.png" 13 | dest_files=[ "res://.import/making_plugins-custom_node_icon.png-e44ae0012523a40f310f84bdbc218b0c.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/native-plugin/my_button.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://native_plugin.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | class_name = "MyButton" 7 | library = ExtResource( 1 ) 8 | script_class_name = "MyButton" 9 | -------------------------------------------------------------------------------- /examples/native-plugin/native_plugin.gdnlib: -------------------------------------------------------------------------------- 1 | [entry] 2 | 3 | X11.64="res://../../target/debug/libnative_plugin.so" 4 | OSX.64="res://../../target/debug/libnative_plugin.dylib" 5 | Windows.64="res://../../target/debug/native_plugin.dll" 6 | 7 | [dependencies] 8 | 9 | X11.64=[ ] 10 | OSX.64=[ ] 11 | Windows.64=[ ] 12 | 13 | [general] 14 | 15 | singleton=false 16 | load_once=true 17 | symbol_prefix="godot_" 18 | reloadable=true 19 | -------------------------------------------------------------------------------- /examples/native-plugin/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ { 12 | "base": "EditorPlugin", 13 | "class": "CustomNode", 14 | "language": "NativeScript", 15 | "path": "res://addons/my_custom_node/custom_node.gdns" 16 | }, { 17 | "base": "Button", 18 | "class": "MyButton", 19 | "language": "NativeScript", 20 | "path": "res://my_button.gdns" 21 | } ] 22 | _global_script_class_icons={ 23 | "CustomNode": "", 24 | "MyButton": "" 25 | } 26 | 27 | [application] 28 | 29 | config/name="native_plugin" 30 | run/main_scene="res://Main.tscn" 31 | config/icon="res://icon.png" 32 | 33 | [editor_plugins] 34 | 35 | enabled=PoolStringArray( "my_custom_node" ) 36 | 37 | [rendering] 38 | 39 | environment/default_environment="res://default_env.tres" 40 | -------------------------------------------------------------------------------- /examples/property-export/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "property-export" 3 | version = "0.1.0" 4 | authors = ["The godot-rust developers"] 5 | edition = "2021" 6 | rust-version = "1.70" 7 | license = "MIT" 8 | publish = false 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | gdnative = { path = "../../gdnative" } 15 | -------------------------------------------------------------------------------- /examples/property-export/GDScriptPrinter.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | func _ready(): 4 | var rust = get_node("../PropertyExport") 5 | 6 | print("\n-----------------------------------------------------------------") 7 | print("Print from GDScript:") 8 | print(" PoolArray:"); 9 | for name in rust.name_vec: 10 | print(" * %s" % name) 11 | 12 | print("\n Dictionary (string -> color):") 13 | for string in rust.color_map: 14 | var color = rust.color_map[string] 15 | print(" * %s -> #%s" % [string, color.to_html(false)]); 16 | 17 | print("\n PoolArray:") 18 | for id in rust.id_set: 19 | print(" * %s" % id) 20 | 21 | # The program has printed the contents and fulfilled its purpose, quit 22 | get_tree().quit() -------------------------------------------------------------------------------- /examples/property-export/Main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://property_export_library.gdnlib" type="GDNativeLibrary" id=1] 4 | [ext_resource path="res://GDScriptPrinter.gd" type="Script" id=2] 5 | 6 | [sub_resource type="NativeScript" id=1] 7 | resource_name = "PropertyExport" 8 | class_name = "PropertyExport" 9 | library = ExtResource( 1 ) 10 | 11 | [node name="Node" type="Node"] 12 | 13 | [node name="PropertyExport" type="Node" parent="."] 14 | script = SubResource( 1 ) 15 | name_vec = PoolStringArray("Godot", "Godette", "Go .") 16 | color_map = { 17 | "blue": Color( 0.184314, 0.160784, 0.8, 1 ), 18 | "green": Color( 0.0941176, 0.447059, 0.192157, 1 ), 19 | "teal": Color( 0.0941176, 0.423529, 0.564706, 1 ) 20 | } 21 | id_set = PoolIntArray(21, 77, 8, 90) 22 | 23 | [node name="GDScriptPrinter" type="Node" parent="."] 24 | script = ExtResource( 2 ) 25 | -------------------------------------------------------------------------------- /examples/property-export/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) 5 | sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) 6 | sky_curve = 0.25 7 | ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) 8 | ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) 9 | ground_curve = 0.01 10 | sun_energy = 16.0 11 | 12 | [resource] 13 | background_mode = 2 14 | background_sky = SubResource( 1 ) 15 | -------------------------------------------------------------------------------- /examples/property-export/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | } 14 | 15 | [application] 16 | 17 | config/name="Godot Rust - Property Export" 18 | run/main_scene="res://Main.tscn" 19 | 20 | [rendering] 21 | 22 | environment/default_environment="res://default_env.tres" 23 | -------------------------------------------------------------------------------- /examples/property-export/property_export_library.gdnlib: -------------------------------------------------------------------------------- 1 | [entry] 2 | 3 | X11.64="res://../../target/debug/libproperty_export.so" 4 | OSX.64="res://../../target/debug/libproperty_export.dylib" 5 | Windows.64="res://../../target/debug/property_export.dll" 6 | 7 | [dependencies] 8 | 9 | X11.64=[ ] 10 | OSX.64=[ ] 11 | 12 | [general] 13 | 14 | singleton=false 15 | load_once=true 16 | symbol_prefix="godot_" 17 | reloadable=true 18 | -------------------------------------------------------------------------------- /examples/resource/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "resource" 3 | version = "0.1.0" 4 | authors = ["The godot-rust developers"] 5 | publish = false 6 | edition = "2021" 7 | rust-version = "1.70" 8 | license = "MIT" 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | gdnative = { path = "../../gdnative" } 15 | -------------------------------------------------------------------------------- /examples/resource/Greet.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" load_steps=3 format=2] 2 | 3 | [ext_resource path="res://resource_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [sub_resource type="NativeScript" id=1] 6 | class_name = "GreetingResource" 7 | library = ExtResource( 1 ) 8 | 9 | [resource] 10 | script = SubResource( 1 ) 11 | name = null 12 | -------------------------------------------------------------------------------- /examples/resource/GreetRust.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" load_steps=3 format=2] 2 | 3 | [ext_resource path="res://resource_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [sub_resource type="NativeScript" id=1] 6 | class_name = "GreetingResource" 7 | library = ExtResource( 1 ) 8 | 9 | [resource] 10 | script = SubResource( 1 ) 11 | name = "Rust" 12 | -------------------------------------------------------------------------------- /examples/resource/GreetWorld.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" load_steps=3 format=2] 2 | 3 | [ext_resource path="res://resource_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [sub_resource type="NativeScript" id=1] 6 | class_name = "GreetingResource" 7 | library = ExtResource( 1 ) 8 | 9 | [resource] 10 | script = SubResource( 1 ) 11 | name = "World" 12 | -------------------------------------------------------------------------------- /examples/resource/Main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://resource_library.gdnlib" type="GDNativeLibrary" id=1] 4 | [ext_resource path="res://GreetWorld.tres" type="Resource" id=2] 5 | 6 | [sub_resource type="NativeScript" id=1] 7 | resource_name = "Greeter" 8 | class_name = "Greeter" 9 | library = ExtResource( 1 ) 10 | 11 | [node name="Node" type="Node"] 12 | script = SubResource( 1 ) 13 | greeting_resource = ExtResource( 2 ) 14 | -------------------------------------------------------------------------------- /examples/resource/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) 5 | sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) 6 | sky_curve = 0.25 7 | ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) 8 | ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) 9 | ground_curve = 0.01 10 | sun_energy = 16.0 11 | 12 | [resource] 13 | background_mode = 2 14 | background_sky = SubResource( 1 ) 15 | -------------------------------------------------------------------------------- /examples/resource/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/resource/icon.png -------------------------------------------------------------------------------- /examples/resource/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/resource/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="Godot Rust - Resource" 19 | run/main_scene="res://Main.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [rendering] 23 | 24 | environment/default_environment="res://default_env.tres" 25 | -------------------------------------------------------------------------------- /examples/resource/resource_library.gdnlib: -------------------------------------------------------------------------------- 1 | [entry] 2 | 3 | X11.64="res://../../target/debug/libresource.so" 4 | OSX.64="res://../../target/debug/libresource.dylib" 5 | Windows.64="res://../../target/debug/resource.dll" 6 | 7 | [dependencies] 8 | 9 | X11.64=[ ] 10 | OSX.64=[ ] 11 | 12 | [general] 13 | 14 | singleton=false 15 | load_once=true 16 | symbol_prefix="godot_" 17 | reloadable=true 18 | -------------------------------------------------------------------------------- /examples/rpc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rpc" 3 | version = "0.1.0" 4 | authors = ["The godot-rust developers"] 5 | publish = false 6 | edition = "2021" 7 | rust-version = "1.70" 8 | license = "MIT" 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | gdnative = { path = "../../gdnative" } 15 | -------------------------------------------------------------------------------- /examples/rpc/Client.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://ServerPuppet.gdns" type="Script" id=1] 4 | 5 | [node name="Server" type="Node"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /examples/rpc/README.md: -------------------------------------------------------------------------------- 1 | # RPC Demo 2 | 3 | A very simple example to show peer to peer communication with Godot's high level multiplayer API calls. 4 | 5 | 6 | ## Setup 7 | 8 | 1. Build the library with `cargo build`. 9 | 10 | 2. Import the Godot project in the Godot editor. 11 | 12 | 3. Open the `Server.tscn` scene and start the current scene with `F6`. 13 | 14 | 4. Start a second instance of the Godot editor. 15 | 16 | 5. Set a separate "Remote Port" for the second editor (e.g. 6012). The two editor instances need to have different debug ports so that they can connect to their own running scenes. Needed to show the godot print messages. 17 | 18 | `Editor > Editor Settings > Network > Debug` 19 | 20 | 5. Open the `Client.tscn` scene and start the current scene with `F6` 21 | 22 | 23 | ## References 24 | 25 | * [Godot hih-level multiplayer API](https://docs.godotengine.org/en/stable/tutorials/networking/high_level_multiplayer.html) 26 | -------------------------------------------------------------------------------- /examples/rpc/Server.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://client_server_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Server" 7 | class_name = "Server" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/rpc/Server.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Server.gdns" type="Script" id=1] 4 | 5 | [node name="Server" type="Node"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /examples/rpc/ServerPuppet.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://client_server_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "ServerPuppet" 7 | class_name = "ServerPuppet" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/rpc/client_server_library.gdnlib: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | singleton=false 4 | load_once=true 5 | symbol_prefix="godot_" 6 | reloadable=true 7 | 8 | [entry] 9 | 10 | X11.64="res://../../target/debug/librpc.so" 11 | OSX.64="res://../../target/debug/librpc.dylib" 12 | Windows.64="res://../../target/debug/rpc.dll" 13 | 14 | [dependencies] 15 | 16 | X11.64=[ ] 17 | OSX.64=[ ] 18 | -------------------------------------------------------------------------------- /examples/rpc/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /examples/rpc/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/rpc/icon.png -------------------------------------------------------------------------------- /examples/rpc/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/rpc/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="RPC Demo" 19 | config/icon="res://icon.png" 20 | 21 | [rendering] 22 | 23 | environment/default_environment="res://default_env.tres" 24 | -------------------------------------------------------------------------------- /examples/rpc/src/lib.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | mod client; 4 | mod server; 5 | 6 | struct RpcLibrary; 7 | 8 | #[gdnative::init::callbacks] 9 | impl GDNativeCallbacks for RpcLibrary { 10 | fn nativescript_init(handle: InitHandle) { 11 | handle.add_class::(); 12 | handle.add_class::(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/scene-create/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "scene-create" 3 | version = "0.1.0" 4 | authors = ["The godot-rust developers"] 5 | publish = false 6 | edition = "2021" 7 | rust-version = "1.70" 8 | license = "MIT" 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | gdnative = { path = "../../gdnative" } 15 | -------------------------------------------------------------------------------- /examples/scene-create/Child_scene.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [sub_resource type="CubeMesh" id=1] 4 | 5 | [node name="Child" type="Spatial"] 6 | 7 | [node name="CSGMesh" type="CSGMesh" parent="."] 8 | transform = Transform( 0.9, 0, 0, 0, 0.9, 0, 0, 0, 0.9, 0, 0, 0 ) 9 | mesh = SubResource( 1 ) 10 | 11 | [node name="CSGMesh2" type="CSGMesh" parent="."] 12 | transform = Transform( 0.1, 0, 0, 0, 0.4, 0, 0, 0, 0.1, 0, 2.15568, 0 ) 13 | mesh = SubResource( 1 ) 14 | -------------------------------------------------------------------------------- /examples/scene-create/Parent.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://scene_create_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "ChildSpawner" 7 | class_name = "SceneCreate" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/scene-create/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) 5 | sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) 6 | sky_curve = 0.25 7 | ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) 8 | ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) 9 | ground_curve = 0.01 10 | sun_energy = 16.0 11 | 12 | [resource] 13 | background_mode = 2 14 | background_sky = SubResource( 1 ) 15 | -------------------------------------------------------------------------------- /examples/scene-create/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/scene-create/icon.png -------------------------------------------------------------------------------- /examples/scene-create/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/scene-create/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="Godot Rust - Scene Create Example" 19 | run/main_scene="res://Main.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [rendering] 23 | 24 | environment/default_environment="res://default_env.tres" 25 | -------------------------------------------------------------------------------- /examples/scene-create/scene_create_library.gdnlib: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | singleton=false 4 | load_once=false 5 | symbol_prefix="godot_" 6 | reloadable=true 7 | 8 | [entry] 9 | 10 | OSX.64="res://../../target/debug/libscene_create.dylib" 11 | X11.64="res://../../target/debug/libscene_create.so" 12 | Windows.64="res://../../target/debug/scene_create.dll" 13 | 14 | [dependencies] 15 | 16 | OSX.64=[ ] 17 | UWP.64=[ ] 18 | X11.64=[ ] 19 | -------------------------------------------------------------------------------- /examples/signals/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "signals" 3 | version = "0.1.0" 4 | authors = ["The godot-rust developers"] 5 | edition = "2021" 6 | rust-version = "1.70" 7 | license = "MIT" 8 | publish = false 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | gdnative = { path = "../../gdnative" } 15 | -------------------------------------------------------------------------------- /examples/signals/Signals.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://signals_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [sub_resource type="NativeScript" id=1] 6 | resource_name = "SignalEmitter" 7 | class_name = "SignalEmitter" 8 | library = ExtResource( 1 ) 9 | 10 | [sub_resource type="NativeScript" id=2] 11 | resource_name = "SignalSubscriber" 12 | class_name = "SignalSubscriber" 13 | library = ExtResource( 1 ) 14 | 15 | [node name="Signals" type="Node"] 16 | 17 | [node name="SignalEmitter" type="Node" parent="."] 18 | script = SubResource( 1 ) 19 | 20 | [node name="SignalSubscriber" type="Label" parent="."] 21 | margin_left = 56.0 22 | margin_top = 131.0 23 | margin_right = 210.0 24 | margin_bottom = 146.0 25 | script = SubResource( 2 ) 26 | __meta__ = { 27 | "_edit_use_anchors_": false 28 | } 29 | -------------------------------------------------------------------------------- /examples/signals/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /examples/signals/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/signals/icon.png -------------------------------------------------------------------------------- /examples/signals/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/signals/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="signals" 19 | run/main_scene="res://Signals.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [rendering] 23 | 24 | environment/default_environment="res://default_env.tres" 25 | -------------------------------------------------------------------------------- /examples/signals/signals_library.gdnlib: -------------------------------------------------------------------------------- 1 | [entry] 2 | 3 | X11.64="../../target/debug/libsignals.so" 4 | OSX.64="../../target/debug/libsignals.dylib" 5 | Windows.64="res://../../target/debug/signals.dll" 6 | 7 | [dependencies] 8 | 9 | Windows.64=[ ] 10 | X11.64=[ ] 11 | OSX.64=[ ] 12 | 13 | [general] 14 | 15 | singleton=false 16 | load_once=true 17 | symbol_prefix="godot_" 18 | reloadable=true 19 | -------------------------------------------------------------------------------- /examples/spinning-cube/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "spinning-cube" 3 | version = "0.1.0" 4 | authors = ["The godot-rust developers"] 5 | edition = "2021" 6 | rust-version = "1.70" 7 | license = "MIT" 8 | publish = false 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | gdnative = { path = "../../gdnative" } 15 | -------------------------------------------------------------------------------- /examples/spinning-cube/Main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://spinning_cube_library.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [sub_resource type="CubeMesh" id=1] 6 | 7 | [sub_resource type="SpatialMaterial" id=2] 8 | roughness = 0.0 9 | 10 | [sub_resource type="NativeScript" id=3] 11 | resource_name = "RustTest" 12 | class_name = "RustTest" 13 | library = ExtResource( 1 ) 14 | 15 | [node name="Main" type="Spatial"] 16 | 17 | [node name="Cube" type="MeshInstance" parent="."] 18 | mesh = SubResource( 1 ) 19 | material/0 = SubResource( 2 ) 20 | script = SubResource( 3 ) 21 | base/rotate_speed = 1.0 22 | 23 | [node name="Camera" type="Camera" parent="."] 24 | transform = Transform( 0.572229, -0.327396, 0.751909, 0, 0.916856, 0.399217, -0.820094, -0.228443, 0.524651, 4.71648, 2.5, 3.45846 ) 25 | current = true 26 | -------------------------------------------------------------------------------- /examples/spinning-cube/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) 5 | sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) 6 | sky_curve = 0.25 7 | ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) 8 | ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) 9 | ground_curve = 0.01 10 | sun_energy = 16.0 11 | 12 | [resource] 13 | background_mode = 2 14 | background_sky = SubResource( 1 ) 15 | -------------------------------------------------------------------------------- /examples/spinning-cube/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/examples/spinning-cube/icon.png -------------------------------------------------------------------------------- /examples/spinning-cube/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /examples/spinning-cube/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="Godot Rust - Misc Mesh Playground" 19 | run/main_scene="res://Main.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [rendering] 23 | 24 | environment/default_environment="res://default_env.tres" 25 | -------------------------------------------------------------------------------- /examples/spinning-cube/spinning_cube_library.gdnlib: -------------------------------------------------------------------------------- 1 | [entry] 2 | 3 | X11.64="res://../../target/debug/libspinning_cube.so" 4 | OSX.64="res://../../target/debug/libspinning_cube.dylib" 5 | Windows.64="res://../../target/debug/spinning_cube.dll" 6 | 7 | 8 | [dependencies] 9 | 10 | X11.64=[ ] 11 | OSX.64=[ ] 12 | 13 | [general] 14 | 15 | singleton=false 16 | load_once=true 17 | symbol_prefix="godot_" 18 | reloadable=true 19 | -------------------------------------------------------------------------------- /gdnative-async/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gdnative-async" 3 | authors = ["The godot-rust developers"] 4 | description = "Runtime async support for godot-rust." 5 | documentation = "https://docs.rs/crate/gdnative-async" 6 | repository = "https://github.com/godot-rust/godot-rust" 7 | homepage = "https://godot-rust.github.io/" 8 | version = "0.11.3" 9 | license = "MIT" 10 | workspace = ".." 11 | edition = "2021" 12 | rust-version = "1.70" 13 | 14 | [features] 15 | 16 | [dependencies] 17 | gdnative-derive = { path = "../gdnative-derive", version = "=0.11.3" } 18 | gdnative-core = { path = "../gdnative-core", version = "=0.11.3" } 19 | gdnative-bindings = { path = "../gdnative-bindings", version = "=0.11.3" } 20 | atomic-waker = "1" 21 | crossbeam-channel = "0.5" 22 | futures-task = "0.3" 23 | once_cell = "1" 24 | parking_lot = "0.12" 25 | 26 | [build-dependencies] 27 | -------------------------------------------------------------------------------- /gdnative-async/src/executor.rs: -------------------------------------------------------------------------------- 1 | use std::cell::Cell; 2 | 3 | use futures_task::LocalSpawn; 4 | 5 | thread_local!( 6 | static LOCAL_SPAWN: Cell> = Cell::new(None); 7 | ); 8 | 9 | pub(crate) fn local_spawn() -> Option<&'static dyn LocalSpawn> { 10 | LOCAL_SPAWN.with(|cell| cell.get()) 11 | } 12 | 13 | /// Sets the global executor for the current thread to a `Box`. This value is leaked. 14 | pub fn set_boxed_executor(sp: Box) { 15 | set_executor(Box::leak(sp)) 16 | } 17 | 18 | /// Sets the global executor for the current thread to a `&'static dyn LocalSpawn`. 19 | pub fn set_executor(sp: &'static dyn LocalSpawn) { 20 | LOCAL_SPAWN.with(|cell| cell.set(Some(sp))) 21 | } 22 | -------------------------------------------------------------------------------- /gdnative-async/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Runtime async support for godot-rust. 2 | //! 3 | //! This crate contains types and functions that enable using async code with godot-rust. 4 | //! 5 | //! # Safety assumptions 6 | //! 7 | //! This crate assumes that all user non-Rust code follow the official threading guidelines. 8 | 9 | #![warn(clippy::exhaustive_enums)] 10 | 11 | // Workaround for macros that expect the `gdnative` crate. 12 | extern crate gdnative_core as gdnative; 13 | 14 | mod executor; 15 | mod future; 16 | mod method; 17 | mod rt; 18 | 19 | pub use executor::{set_boxed_executor, set_executor}; 20 | pub use future::Yield; 21 | pub use method::{Async, AsyncMethod, Spawner, StaticArgs, StaticArgsAsyncMethod}; 22 | pub use rt::{register_runtime, terminate_runtime, Context}; 23 | -------------------------------------------------------------------------------- /gdnative-bindings/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gdnative-bindings" 3 | authors = ["The godot-rust developers"] 4 | description = "The Godot game engine's automatcally generated bindings to Godot classes." 5 | documentation = "https://docs.rs/crate/gdnative-bindings" 6 | repository = "https://github.com/godot-rust/godot-rust" 7 | homepage = "https://godot-rust.github.io/" 8 | version = "0.11.3" 9 | license = "MIT" 10 | workspace = ".." 11 | edition = "2021" 12 | rust-version = "1.70" 13 | 14 | [features] 15 | default = ["one-class-one-file"] 16 | formatted = [] 17 | one-class-one-file = [] 18 | custom-godot = ["gdnative_bindings_generator/custom-godot"] 19 | ptrcall = ["gdnative_bindings_generator/ptrcall"] 20 | 21 | [dependencies] 22 | gdnative-core = { path = "../gdnative-core", version = "=0.11.3" } 23 | libc = "0.2" 24 | 25 | [build-dependencies] 26 | gdnative_bindings_generator = { path = "../bindings-generator", version = "=0.11.3" } 27 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AnimationNodeOutput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generic output node to be added to [AnimationNodeBlendTree]. 5 | 6 | 7 | 8 | 9 | https://docs.godotengine.org/en/3.5.1/tutorials/animation/animation_tree.html 10 | https://godotengine.org/asset-library/asset/125 11 | https://godotengine.org/asset-library/asset/678 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AnimationNodeTimeScale.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A time-scaling animation node to be used with [AnimationTree]. 5 | 6 | 7 | Allows scaling the speed of the animation (or reversing it) in any children nodes. Setting it to 0 will pause the animation. 8 | 9 | 10 | https://docs.godotengine.org/en/3.5.1/tutorials/animation/animation_tree.html 11 | https://godotengine.org/asset-library/asset/125 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AnimationRootNode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AnimationTrackEditPlugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioBusLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Stores information about the audio buses. 5 | 6 | 7 | Stores position, muting, solo, bypass, effects, effect position, volume, and the connections between buses. See [AudioServer] for usage. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffect.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Audio effect for audio. 5 | 6 | 7 | Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on. 8 | 9 | 10 | https://godotengine.org/asset-library/asset/527 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectAmplify.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adds an amplifying audio effect to an audio bus. 5 | Increases or decreases the volume of the selected audio bus. 6 | 7 | 8 | Increases or decreases the volume being routed through the audio bus. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24. 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectBandLimitFilter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adds a band limit filter to the audio bus. 5 | 6 | 7 | Limits the frequencies in a range around the [member AudioEffectFilter.cutoff_hz] and allows frequencies outside of this range to pass. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectBandPassFilter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adds a band pass filter to the audio bus. 5 | 6 | 7 | Attenuates the frequencies inside of a range around the [member AudioEffectFilter.cutoff_hz] and cuts frequencies outside of this band. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectEQ10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adds a 10-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 31 Hz to 16000 Hz. 5 | Each frequency can be modulated between -60/+24 dB. 6 | 7 | 8 | Frequency bands: 9 | Band 1: 31 Hz 10 | Band 2: 62 Hz 11 | Band 3: 125 Hz 12 | Band 4: 250 Hz 13 | Band 5: 500 Hz 14 | Band 6: 1000 Hz 15 | Band 7: 2000 Hz 16 | Band 8: 4000 Hz 17 | Band 9: 8000 Hz 18 | Band 10: 16000 Hz 19 | See also [AudioEffectEQ], [AudioEffectEQ6], [AudioEffectEQ21]. 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectEQ6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adds a 6-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 32 Hz to 10000 Hz. 5 | Each frequency can be modulated between -60/+24 dB. 6 | 7 | 8 | Frequency bands: 9 | Band 1: 32 Hz 10 | Band 2: 100 Hz 11 | Band 3: 320 Hz 12 | Band 4: 1000 Hz 13 | Band 5: 3200 Hz 14 | Band 6: 10000 Hz 15 | See also [AudioEffectEQ], [AudioEffectEQ10], [AudioEffectEQ21]. 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectHighPassFilter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adds a high-pass filter to the Audio Bus. 5 | 6 | 7 | Cuts frequencies lower than the [member AudioEffectFilter.cutoff_hz] and allows higher frequencies to pass. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectHighShelfFilter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Reduces all frequencies above the [member AudioEffectFilter.cutoff_hz]. 5 | 6 | 7 | 8 | 9 | https://docs.godotengine.org/en/3.5.1/tutorials/audio/audio_buses.html 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectInstance.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectLowPassFilter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adds a low-pass filter to the Audio bus. 5 | 6 | 7 | Cuts frequencies higher than the [member AudioEffectFilter.cutoff_hz] and allows lower frequencies to pass. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectLowShelfFilter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Reduces all frequencies below the [member AudioEffectFilter.cutoff_hz]. 5 | 6 | 7 | 8 | 9 | https://docs.godotengine.org/en/3.5.1/tutorials/audio/audio_buses.html 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectNotchFilter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adds a notch filter to the Audio bus. 5 | 6 | 7 | Attenuates frequencies in a narrow band around the [member AudioEffectFilter.cutoff_hz] and cuts frequencies outside of this range. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectPanner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Adds a panner audio effect to an Audio bus. Pans sound left or right. 5 | 6 | 7 | Determines how much of an audio signal is sent to the left and right buses. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Pan position. Value can range from -1 (fully left) to 1 (fully right). 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioEffectStereoEnhance.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioStreamPlayback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Meta class for playing back audio. 5 | 6 | 7 | Can play, loop, pause a scroll through audio. See [AudioStream] and [AudioStreamOGGVorbis] for usage. 8 | 9 | 10 | https://godotengine.org/asset-library/asset/526 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioStreamPlaybackResampled.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/AudioStreamRandomPitch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Plays audio with random pitch shifting. 5 | 6 | 7 | Randomly varies pitch on each start. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The current [AudioStream]. 16 | 17 | 18 | The intensity of random pitch variation. 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/BoneAttachment.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A node that will attach to a bone. 5 | 6 | 7 | This node must be the child of a [Skeleton] node. You can then select a bone for this node to attach to. The BoneAttachment node will copy the transform of the selected bone. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The name of the attached bone. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/CanvasModulate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tint the entire canvas. 5 | 6 | 7 | [CanvasModulate] tints the canvas elements using its assigned [member color]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The tint color to apply. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/CapsuleShape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Capsule shape for collisions. 5 | 6 | 7 | Capsule shape for collisions. 8 | 9 | 10 | https://godotengine.org/asset-library/asset/675 11 | 12 | 13 | 14 | 15 | 16 | The capsule's height. 17 | 18 | 19 | The capsule's radius. 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/CapsuleShape2D.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Capsule shape for 2D collisions. 5 | 6 | 7 | Capsule shape for 2D collisions. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The capsule's height. 16 | 17 | 18 | The capsule's radius. 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/CenterContainer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Keeps children controls centered. 5 | 6 | 7 | CenterContainer keeps children controls centered. This container keeps all children to their minimum size, in the center. 8 | 9 | 10 | https://docs.godotengine.org/en/3.5.1/tutorials/ui/gui_containers.html 11 | 12 | 13 | 14 | 15 | 16 | If [code]true[/code], centers children relative to the [CenterContainer]'s top left corner. 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/CircleShape2D.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Circular shape for 2D collisions. 5 | 6 | 7 | Circular shape for 2D collisions. This shape is useful for modeling balls or small characters and its collision detection with everything else is very fast. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The circle's radius. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/ColorRect.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Colored rectangle. 5 | 6 | 7 | Displays a rectangle filled with a solid [member color]. If you need to display the border alone, consider using [ReferenceRect] instead. 8 | 9 | 10 | https://godotengine.org/asset-library/asset/515 11 | 12 | 13 | 14 | 15 | 16 | The fill color. 17 | [codeblock] 18 | $ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect's color to red. 19 | [/codeblock] 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/ConvexPolygonShape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Convex polygon shape for 3D physics. 5 | 6 | 7 | Convex polygon shape resource, which can be added to a [PhysicsBody] or area. 8 | 9 | 10 | https://godotengine.org/asset-library/asset/675 11 | 12 | 13 | 14 | 15 | 16 | The list of 3D points forming the convex polygon shape. 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/EditorResourceConversionPlugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/FlowContainer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Base class for flow containers. 5 | 6 | 7 | Arranges child [Control] nodes vertically or horizontally in a left-to-right or top-to-bottom flow. 8 | A line is filled with [Control] nodes until no more fit on the same line, similar to text in an autowrapped label. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Returns the current line count. 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/HBoxContainer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Horizontal box container. 5 | 6 | 7 | Horizontal box container. See [BoxContainer]. 8 | 9 | 10 | https://docs.godotengine.org/en/3.5.1/tutorials/ui/gui_containers.html 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | The horizontal space between the [HBoxContainer]'s elements. 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/HFlowContainer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Horizontal flow container. 5 | 6 | 7 | Horizontal version of [FlowContainer]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | The horizontal separation of children nodes. 18 | 19 | 20 | The vertical separation of children nodes. 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/HSeparator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Horizontal separator. 5 | 6 | 7 | Horizontal separator. See [Separator]. Even though it looks horizontal, it is used to separate objects vertically. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | The height of the area covered by the separator. Effectively works like a minimum height. 18 | 19 | 20 | The style for the separator line. Works best with [StyleBoxLine]. 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/InputEventGesture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Base class for touch control gestures. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | The local gesture position relative to the [Viewport]. If used in [method Control._gui_input], the position is relative to the current [Control] that received this gesture. 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/InputEventMagnifyGesture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/InputEventPanGesture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/IntervalTweener.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Creates an idle interval in a [SceneTreeTween] animation. 5 | 6 | 7 | [IntervalTweener] is used to make delays in a tweening sequence. See [method SceneTreeTween.tween_interval] for more usage information. 8 | [b]Note:[/b] [method SceneTreeTween.tween_interval] is the only correct way to create [IntervalTweener]. Any [IntervalTweener] created manually will not function correctly. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/JNISingleton.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Singleton that connects the engine with Android plugins to interface with native Android code. 5 | 6 | 7 | The JNISingleton is implemented only in the Android export. It's used to call methods and connect signals from an Android plugin written in Java or Kotlin. Methods and signals can be called and connected to the JNISingleton as if it is a Node. See [url=https://en.wikipedia.org/wiki/Java_Native_Interface]Java Native Interface - Wikipedia[/url] for more information. 8 | 9 | 10 | https://docs.godotengine.org/en/3.5.1/tutorials/platform/android/android_plugin.html 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/JavaClass.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/JavaClassWrapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/OccluderShape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Base class for shapes used for occlusion culling by the [Occluder] node. 5 | 6 | 7 | [Occluder]s can use any primitive shape derived from [OccluderShape]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/PHashTranslation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Optimized translation. 5 | 6 | 7 | Optimized translation. Uses real-time compressed translations, which results in very small dictionaries. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Generates and sets an optimized translation from the given [Translation] resource. 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/PackedDataContainer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/PackedDataContainerRef.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Reference version of [PackedDataContainer]. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/PanelContainer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Panel container type. 5 | 6 | 7 | Panel container type. This container fits controls inside of the delimited area of a stylebox. It's useful for giving controls an outline. 8 | 9 | 10 | https://docs.godotengine.org/en/3.5.1/tutorials/ui/gui_containers.html 11 | https://godotengine.org/asset-library/asset/520 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | The style of [PanelContainer]'s background. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/PinJoint2D.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Pin Joint for 2D shapes. 5 | 6 | 7 | Pin Joint for 2D rigid bodies. It pins two bodies (rigid or static) together. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The higher this value, the more the bond to the pinned partner can flex. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/PlaneShape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Infinite plane shape for 3D collisions. 5 | 6 | 7 | An infinite plane shape for 3D collisions. Note that the [Plane]'s normal matters; anything "below" the plane will collide with it. If the [PlaneShape] is used in a [PhysicsBody], it will cause colliding objects placed "below" it to teleport "above" the plane. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The [Plane] used by the [PlaneShape] for collision. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/PopupDialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Base class for popup dialogs. 5 | 6 | 7 | PopupDialog is a base class for popup dialogs, along with [WindowDialog]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Sets a custom [StyleBox] for the panel of the [PopupDialog]. 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/PopupPanel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Class for displaying popups with a panel background. 5 | 6 | 7 | Class for displaying popups with a panel background. In some cases it might be simpler to use than [Popup], since it provides a configurable background. If you are making windows, better check [WindowDialog]. 8 | If any [Control] node is added as a child of this [PopupPanel], it will be stretched to fit the panel's size (similar to how [PanelContainer] works). 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | The background panel style of this [PopupPanel]. 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/Position2D.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generic 2D position hint for editing. 5 | 6 | 7 | Generic 2D position hint for editing. It's just like a plain [Node2D], but it displays as a cross in the 2D editor at all times. You can set cross' visual size by using the gizmo in the 2D editor while the node is selected. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/Position3D.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generic 3D position hint for editing. 5 | 6 | 7 | Generic 3D position hint for editing. It's just like a plain [Spatial], but it displays as a cross in the 3D editor at all times. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/ProxyTexture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/RayShape2D.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Ray shape for 2D collisions. 5 | 6 | 7 | Ray shape for 2D collisions. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The ray's length. 16 | 17 | 18 | If [code]true[/code], allow the shape to return the correct normal. 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/RectangleShape2D.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Rectangle shape for 2D collisions. 5 | 6 | 7 | Rectangle shape for 2D collisions. This shape is useful for modeling box-like 2D objects. 8 | 9 | 10 | https://godotengine.org/asset-library/asset/121 11 | https://godotengine.org/asset-library/asset/113 12 | 13 | 14 | 15 | 16 | 17 | The rectangle's half extents. The width and height of this shape is twice the half extents. 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/SegmentShape2D.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Segment shape for 2D collisions. 5 | 6 | 7 | Segment shape for 2D collisions. Consists of two points, [code]a[/code] and [code]b[/code]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The segment's first point position. 16 | 17 | 18 | The segment's second point position. 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/Separator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Base class for separators. 5 | 6 | 7 | Separator is a [Control] used for separating other controls. It's purely a visual decoration. Horizontal ([HSeparator]) and Vertical ([VSeparator]) versions are available. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/SkinReference.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/SpatialGizmo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/SphereShape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sphere shape for 3D collisions. 5 | 6 | 7 | Sphere shape for 3D collisions, which can be set into a [PhysicsBody] or [Area]. This shape is useful for modeling sphere-like 3D objects. 8 | 9 | 10 | https://godotengine.org/asset-library/asset/675 11 | 12 | 13 | 14 | 15 | 16 | The sphere's radius. The shape's diameter is double the radius. 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/StyleBoxEmpty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Empty stylebox (does not display anything). 5 | 6 | 7 | Empty stylebox (really does not display anything). 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/TextFile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/TriangleMesh.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Internal mesh type. 5 | 6 | 7 | Mesh type used internally for collision calculations. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/Tweener.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Abstract class for all Tweeners used by [SceneTreeTween]. 5 | 6 | 7 | Tweeners are objects that perform a specific animating task, e.g. interpolating a property or calling a method at a given time. A [Tweener] can't be created manually, you need to use a dedicated method from [SceneTreeTween]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Emitted when the [Tweener] has just finished its job. 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VBoxContainer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Vertical box container. 5 | 6 | 7 | Vertical box container. See [BoxContainer]. 8 | 9 | 10 | https://docs.godotengine.org/en/3.5.1/tutorials/ui/gui_containers.html 11 | https://godotengine.org/asset-library/asset/676 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | The vertical space between the [VBoxContainer]'s elements. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VFlowContainer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Vertical flow container. 5 | 6 | 7 | Vertical version of [FlowContainer]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | The horizontal separation of children nodes. 18 | 19 | 20 | The vertical separation of children nodes. 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VSeparator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Vertical version of [Separator]. 5 | 6 | 7 | Vertical version of [Separator]. Even though it looks vertical, it is used to separate objects horizontally. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | The width of the area covered by the separator. Effectively works like a minimum width. 18 | 19 | 20 | The style for the separator line. Works best with [StyleBoxLine] (remember to enable [member StyleBoxLine.vertical]). 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VideoStream.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Base resource for video streams. 5 | 6 | 7 | Base resource type for all video streams. Classes that derive from [VideoStream] can all be used as resource types to play back videos in [VideoPlayer]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeBooleanConstant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A boolean constant to be used within the visual shader graph. 5 | 6 | 7 | Has only one output port and no inputs. 8 | Translated to [code]bool[/code] in the shader language. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | A boolean constant which represents a state of this node. 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeColorConstant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A [Color] constant to be used within the visual shader graph. 5 | 6 | 7 | Has two output ports representing RGB and alpha channels of [Color]. 8 | Translated to [code]vec3 rgb[/code] and [code]float alpha[/code] in the shader language. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | A [Color] constant which represents a state of this node. 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeCubeMapUniform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A [CubeMap] uniform node to be used within the visual shader graph. 5 | 6 | 7 | Translated to [code]uniform samplerCube[/code] in the shader language. The output value can be used as port for [VisualShaderNodeCubeMap]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeDeterminant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Calculates the determinant of a [Transform] within the visual shader graph. 5 | 6 | 7 | Translates to [code]determinant(x)[/code] in the shader language. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeDotProduct.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Calculates a dot product of two vectors within the visual shader graph. 5 | 6 | 7 | Translates to [code]dot(a, b)[/code] in the shader language. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeFaceForward.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Returns the vector that points in the same direction as a reference vector within the visual shader graph. 5 | 6 | 7 | Translates to [code]faceforward(N, I, Nref)[/code] in the shader language. The function has three vector parameters: [code]N[/code], the vector to orient, [code]I[/code], the incident vector, and [code]Nref[/code], the reference vector. If the dot product of [code]I[/code] and [code]Nref[/code] is smaller than zero the return value is [code]N[/code]. Otherwise, [code]-N[/code] is returned. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeFresnel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A Fresnel effect to be used within the visual shader graph. 5 | 6 | 7 | Returns falloff based on the dot product of surface normal and view direction of camera (pass associated inputs to it). 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeGlobalExpression.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A custom global visual shader graph expression written in Godot Shading Language. 5 | 6 | 7 | Custom Godot Shader Language expression, which is placed on top of the generated shader. You can place various function definitions inside to call later in [VisualShaderNodeExpression]s (which are injected in the main shader functions). You can also declare varyings, uniforms and global constants. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeIf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeOuterProduct.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Calculates an outer product of two vectors within the visual shader graph. 5 | 6 | 7 | [code]OuterProduct[/code] treats the first parameter [code]c[/code] as a column vector (matrix with one column) and the second parameter [code]r[/code] as a row vector (matrix with one row) and does a linear algebraic matrix multiply [code]c * r[/code], yielding a matrix whose number of rows is the number of components in [code]c[/code] and whose number of columns is the number of components in [code]r[/code]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeOutput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the output shader parameters within the visual shader graph. 5 | 6 | 7 | This visual shader node is present in all shader graphs in form of "Output" block with multiple output value ports. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeScalarClamp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Clamps a scalar value within the visual shader graph. 5 | 6 | 7 | Constrains a value to lie between [code]min[/code] and [code]max[/code] values. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeScalarConstant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeScalarInterp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Linearly interpolates between two scalars within the visual shader graph. 5 | 6 | 7 | Translates to [code]mix(a, b, weight)[/code] in the shader language. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeScalarSmoothStep.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Calculates a scalar SmoothStep function within the visual shader graph. 5 | 6 | 7 | Translates to [code]smoothstep(edge0, edge1, x)[/code] in the shader language. 8 | Returns [code]0.0[/code] if [code]x[/code] is smaller than [code]edge0[/code] and [code]1.0[/code] if [code]x[/code] is larger than [code]edge1[/code]. Otherwise the return value is interpolated between [code]0.0[/code] and [code]1.0[/code] using Hermite polynomials. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeScalarSwitch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A boolean/scalar function for use within the visual shader graph. 5 | 6 | 7 | Returns an associated scalar if the provided boolean value is [code]true[/code] or [code]false[/code]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeSwitch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A boolean/vector function for use within the visual shader graph. 5 | 6 | 7 | Returns an associated vector if the provided boolean value is [code]true[/code] or [code]false[/code]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeTextureUniformTriplanar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Performs a uniform texture lookup with triplanar within the visual shader graph. 5 | 6 | 7 | Performs a lookup operation on the texture provided as a uniform for the shader, with support for triplanar mapping. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeTransformCompose.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Composes a [Transform] from four [Vector3]s within the visual shader graph. 5 | 6 | 7 | Creates a 4x4 transform matrix using four vectors of type [code]vec3[/code]. Each vector is one row in the matrix and the last column is a [code]vec4(0, 0, 0, 1)[/code]. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeTransformConstant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A [Transform] constant for use within the visual shader graph. 5 | 6 | 7 | A constant [Transform], which can be used as an input node. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | A [Transform] constant which represents the state of this node. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeTransformDecompose.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Decomposes a [Transform] into four [Vector3]s within the visual shader graph. 5 | 6 | 7 | Takes a 4x4 transform matrix and decomposes it into four [code]vec3[/code] values, one from each row of the matrix. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeUniform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A base type for the uniforms within the visual shader graph. 5 | 6 | 7 | A uniform represents a variable in the shader which is set externally, i.e. from the [ShaderMaterial]. Uniforms are exposed as properties in the [ShaderMaterial] and can be assigned from the inspector or from a script. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Name of the uniform, by which it can be accessed through the [ShaderMaterial] properties. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeUniformRef.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A reference to an existing [VisualShaderNodeUniform]. 5 | 6 | 7 | Creating a reference to a [VisualShaderNodeUniform] allows you to reuse this uniform in different shaders or shader stages easily. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The name of the uniform which this reference points to. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVec3Constant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A [Vector3] constant to be used within the visual shader graph. 5 | 6 | 7 | A constant [Vector3], which can be used as an input node. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | A [Vector3] constant which represents the state of this node. 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorClamp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Clamps a vector value within the visual shader graph. 5 | 6 | 7 | Constrains a value to lie between [code]min[/code] and [code]max[/code] values. The operation is performed on each component of the vector individually. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorCompose.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Composes a [Vector3] from three scalars within the visual shader graph. 5 | 6 | 7 | Creates a [code]vec3[/code] using three scalar values that can be provided from separate inputs. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorDecompose.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Decomposes a [Vector3] into three scalars within the visual shader graph. 5 | 6 | 7 | Takes a [code]vec3[/code] and decomposes it into three scalar values that can be used as separate inputs. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorDistance.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Returns the distance between two points. To be used within the visual shader graph. 5 | 6 | 7 | Calculates distance from point represented by vector [code]p0[/code] to vector [code]p1[/code]. 8 | Translated to [code]distance(p0, p1)[/code] in the shader language. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorInterp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Linearly interpolates between two vectors within the visual shader graph. 5 | 6 | 7 | Translates to [code]mix(a, b, weight)[/code] in the shader language, where [code]weight[/code] is a [Vector3] with weights for each component. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorLen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Returns the length of a [Vector3] within the visual shader graph. 5 | 6 | 7 | Translated to [code]length(p0)[/code] in the shader language. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorRefract.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Returns the [Vector3] that points in the direction of refraction. For use within the visual shader graph. 5 | 6 | 7 | Translated to [code]refract(I, N, eta)[/code] in the shader language, where [code]I[/code] is the incident vector, [code]N[/code] is the normal vector and [code]eta[/code] is the ratio of the indices of the refraction. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorScalarMix.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Linearly interpolates between two vectors using a scalar. For use within the visual shader graph. 5 | 6 | 7 | Translates to [code]mix(a, b, weight)[/code] in the shader language, where [code]a[/code] and [code]b[/code] are vectors and [code]weight[/code] is a scalar. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorScalarSmoothStep.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Calculates a vector SmoothStep function using scalar within the visual shader graph. 5 | 6 | 7 | Translates to [code]smoothstep(edge0, edge1, x)[/code] in the shader language, where [code]x[/code] is a scalar. 8 | Returns [code]0.0[/code] if [code]x[/code] is smaller than [code]edge0[/code] and [code]1.0[/code] if [code]x[/code] is larger than [code]edge1[/code]. Otherwise the return value is interpolated between [code]0.0[/code] and [code]1.0[/code] using Hermite polynomials. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorScalarStep.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Calculates a vector Step function within the visual shader graph. 5 | 6 | 7 | Translates to [code]step(edge, x)[/code] in the shader language. 8 | Returns [code]0.0[/code] if [code]x[/code] is smaller than [code]edge[/code] and [code]1.0[/code] otherwise. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /gdnative-bindings/docs/VisualShaderNodeVectorSmoothStep.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Calculates a vector SmoothStep function within the visual shader graph. 5 | 6 | 7 | Translates to [code]smoothstep(edge0, edge1, x)[/code] in the shader language, where [code]x[/code] is a vector. 8 | Returns [code]0.0[/code] if [code]x[/code] is smaller than [code]edge0[/code] and [code]1.0[/code] if [code]x[/code] is larger than [code]edge1[/code]. Otherwise the return value is interpolated between [code]0.0[/code] and [code]1.0[/code] using Hermite polynomials. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /gdnative-bindings/src/generated.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_variables)] 2 | 3 | #[cfg(feature = "ptrcall")] 4 | use libc; 5 | 6 | use libc::c_char; 7 | use std::mem; 8 | use std::ptr; 9 | 10 | use gdnative_core::core_types::variant::*; 11 | use gdnative_core::core_types::*; 12 | use gdnative_core::object::*; 13 | use gdnative_core::object::{memory, ownership}; 14 | use gdnative_core::private::get_api; 15 | use gdnative_core::sys; 16 | use gdnative_core::sys::GodotApi; 17 | 18 | include!(concat!(env!("OUT_DIR"), "/generated.rs")); 19 | -------------------------------------------------------------------------------- /gdnative-bindings/src/icalls.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_variables)] 2 | 3 | #[cfg(feature = "ptrcall")] 4 | use gdnative_core::*; 5 | #[cfg(feature = "ptrcall")] 6 | use libc; 7 | 8 | use std::ptr; 9 | 10 | use gdnative_core::core_types::*; 11 | use gdnative_core::private::get_api; 12 | use gdnative_core::sys; 13 | 14 | include!(concat!(env!("OUT_DIR"), "/icalls.rs")); 15 | -------------------------------------------------------------------------------- /gdnative-bindings/src/lib.rs: -------------------------------------------------------------------------------- 1 | // For silenced lints/warnings, see also gdnative-sys/src/lib.rs 2 | 3 | // Generated bindings don't follow some conventions 4 | #![allow(non_snake_case)] 5 | #![allow(unused_unsafe)] 6 | // False positives on generated drops that enforce lifetime 7 | #![allow(dropping_copy_types)] 8 | // False positives on thread-safe singletons 9 | #![allow(clippy::non_send_fields_in_send_ty)] 10 | // Disable non-critical lints for generated code 11 | #![allow(clippy::style, clippy::complexity, clippy::perf)] 12 | 13 | mod generated; 14 | pub use generated::*; 15 | 16 | pub mod utils; 17 | 18 | pub(crate) mod icalls; 19 | -------------------------------------------------------------------------------- /gdnative-core/src/core_types/geom/mod.rs: -------------------------------------------------------------------------------- 1 | //! Geometric types. 2 | 3 | mod aabb; 4 | mod basis; 5 | mod plane; 6 | mod quat; 7 | mod rect2; 8 | mod transform; 9 | mod transform2d; 10 | 11 | pub use aabb::*; 12 | pub use basis::*; 13 | pub use plane::*; 14 | pub use quat::*; 15 | pub use rect2::*; 16 | pub use transform::*; 17 | pub use transform2d::*; 18 | -------------------------------------------------------------------------------- /gdnative-core/src/init/diagnostics.rs: -------------------------------------------------------------------------------- 1 | //! Run-time tracing functions to help debug the init process. 2 | //! 3 | //! The provided functions are designed to convey any issues found through human-readable 4 | //! error output, while programmatically providing only an overall indication of whether 5 | //! any problems were found. This is so that they can be freely improved without compatibility 6 | //! concerns. 7 | 8 | mod godot_version_mismatch; 9 | mod missing_manual_registration; 10 | mod missing_suggested_diagnostics; 11 | 12 | #[doc(inline)] 13 | pub use godot_version_mismatch::godot_version_mismatch; 14 | 15 | #[doc(inline)] 16 | pub use missing_manual_registration::missing_manual_registration; 17 | 18 | #[doc(inline)] 19 | pub use missing_suggested_diagnostics::missing_suggested_diagnostics; 20 | -------------------------------------------------------------------------------- /gdnative-core/src/init/terminate_handle.rs: -------------------------------------------------------------------------------- 1 | /// A handle passed from the engine during NativeScript termination. It's purpose is currently 2 | /// unclear. 3 | pub struct TerminateHandle { 4 | _handle: *mut libc::c_void, 5 | } 6 | 7 | impl TerminateHandle { 8 | #[doc(hidden)] 9 | #[inline] 10 | pub unsafe fn new(handle: *mut libc::c_void) -> Self { 11 | TerminateHandle { _handle: handle } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /gdnative-core/src/object/new_ref.rs: -------------------------------------------------------------------------------- 1 | /// A trait for incrementing the reference count to a Godot object. 2 | pub trait NewRef { 3 | /// Creates a new reference to the underlying object. 4 | fn new_ref(&self) -> Self; 5 | } 6 | -------------------------------------------------------------------------------- /gdnative-derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gdnative-derive" 3 | authors = ["The godot-rust developers"] 4 | description = "The Godot game engine's gdnative derive and procedural macros." 5 | documentation = "https://docs.rs/crate/gdnative-derive" 6 | repository = "https://github.com/godot-rust/godot-rust" 7 | homepage = "https://godot-rust.github.io/" 8 | version = "0.11.3" 9 | license = "MIT" 10 | workspace = ".." 11 | edition = "2021" 12 | rust-version = "1.70" 13 | 14 | [lib] 15 | proc-macro = true 16 | 17 | [dependencies] 18 | syn = { version = "1.0.84", features = ["full", "extra-traits", "visit"] } 19 | quote = "1" 20 | proc-macro2 = "1" 21 | proc-macro-crate = "3" 22 | 23 | [dev-dependencies] 24 | # This is included for the doc tests. 25 | gdnative = { path = "../gdnative" } 26 | -------------------------------------------------------------------------------- /gdnative-derive/src/syntax.rs: -------------------------------------------------------------------------------- 1 | pub mod rpc_mode; 2 | -------------------------------------------------------------------------------- /gdnative-derive/src/utils.rs: -------------------------------------------------------------------------------- 1 | pub mod extend_bounds; 2 | pub mod find_non_concrete; 3 | -------------------------------------------------------------------------------- /gdnative-sys/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gdnative-sys" 3 | authors = ["The godot-rust developers"] 4 | description = "Generated bindings to the Godot game engine's gdnative core types (See the gdnative crate)." 5 | documentation = "https://docs.rs/crate/gdnative-sys" 6 | repository = "https://github.com/godot-rust/godot-rust" 7 | homepage = "https://godot-rust.github.io/" 8 | version = "0.11.3" 9 | build = "build.rs" 10 | license = "MIT" 11 | workspace = ".." 12 | edition = "2021" 13 | rust-version = "1.70" 14 | 15 | [dependencies] 16 | libc = "0.2" 17 | 18 | [build-dependencies] 19 | bindgen = { version = "0.69.0", default-features = false, features = ["runtime"] } 20 | proc-macro2 = "1" 21 | quote = "1" 22 | miniserde = "0.1.16" 23 | semver = "1" 24 | 25 | # False positives found by cargo-machete 26 | [package.metadata.cargo-machete] 27 | ignored = ["libc"] 28 | -------------------------------------------------------------------------------- /gdnative-sys/godot_headers/images/faq/create_dlscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/gdnative-sys/godot_headers/images/faq/create_dlscript.png -------------------------------------------------------------------------------- /gdnative-sys/godot_headers/images/faq/dllibrary_create_new_dllibrary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/gdnative-sys/godot_headers/images/faq/dllibrary_create_new_dllibrary.png -------------------------------------------------------------------------------- /gdnative-sys/godot_headers/images/faq/dllibrary_create_new_resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/gdnative-sys/godot_headers/images/faq/dllibrary_create_new_resource.png -------------------------------------------------------------------------------- /gdnative-sys/godot_headers/images/faq/dllibrary_save_as_resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/gdnative-sys/godot_headers/images/faq/dllibrary_save_as_resource.png -------------------------------------------------------------------------------- /gdnative-sys/godot_headers/images/faq/set_project_dllibrary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/gdnative-sys/godot_headers/images/faq/set_project_dllibrary.png -------------------------------------------------------------------------------- /gdnative-sys/godot_headers/images/faq/set_script_dllibrary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/gdnative-sys/godot_headers/images/faq/set_script_dllibrary.png -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_inherit_param.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | #[inherit] 5 | struct Foo {} 6 | 7 | #[methods] 8 | impl Foo { 9 | fn new(_owner: &Node) -> Self { 10 | Foo {} 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_inherit_param.stderr: -------------------------------------------------------------------------------- 1 | error: expected attribute arguments in parentheses: #[inherit(...)] 2 | --> $DIR/derive_fail_inherit_param.rs:4:1 3 | | 4 | 4 | #[inherit] 5 | | ^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_lifetime.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | struct Foo<'a> { 5 | bar: &'a str, 6 | } 7 | 8 | impl<'a> Foo<'a> { 9 | fn new(_owner: &Node) -> Self { 10 | Foo { 11 | bar: "bar", 12 | } 13 | } 14 | } 15 | 16 | fn main() {} 17 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_lifetime.stderr: -------------------------------------------------------------------------------- 1 | error[E0478]: lifetime bound not satisfied 2 | --> tests/ui/derive_fail_lifetime.rs:3:10 3 | | 4 | 3 | #[derive(NativeClass)] 5 | | ^^^^^^^^^^^ 6 | | 7 | note: lifetime parameter instantiated with the lifetime `'a` as defined here 8 | --> tests/ui/derive_fail_lifetime.rs:4:12 9 | | 10 | 4 | struct Foo<'a> { 11 | | ^^ 12 | = note: but lifetime parameter must outlive the static lifetime 13 | = note: this error originates in the derive macro `NativeClass` (in Nightly builds, run with -Z macro-backtrace for more info) 14 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_methods.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | #[inherit(Node)] 5 | struct Foo {} 6 | 7 | impl Foo { 8 | fn new(_owner: &Node) -> Self { 9 | Foo {} 10 | } 11 | 12 | #[method] 13 | fn draw(&self) {} 14 | } 15 | 16 | fn main() {} 17 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_methods.stderr: -------------------------------------------------------------------------------- 1 | error: cannot find attribute `method` in this scope 2 | --> tests/ui/derive_fail_methods.rs:12:7 3 | | 4 | 12 | #[method] 5 | | ^^^^^^ help: an attribute macro with a similar name exists: `methods` 6 | | 7 | ::: $WORKSPACE/gdnative-derive/src/lib.rs 8 | | 9 | | pub fn methods(meta: TokenStream, input: TokenStream) -> TokenStream { 10 | | -------------------------------------------------------------------- similarly named attribute macro `methods` defined here 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_methods_list.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | #[inherit(Node)] 5 | struct Foo {} 6 | 7 | #[methods(foo, bar)] 8 | impl Foo { 9 | fn new(_owner: &Node) -> Self { 10 | Foo {} 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_methods_list.stderr: -------------------------------------------------------------------------------- 1 | error: unexpected argument: Some(Ident { ident: "foo", span: #0 bytes(92..95) }) 2 | --> tests/ui/derive_fail_methods_list.rs:7:11 3 | | 4 | 7 | #[methods(foo, bar)] 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_methods_missing_new.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | #[inherit(Node)] 5 | struct Foo {} 6 | 7 | #[methods] 8 | impl Foo {} 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_methods_param.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | #[inherit(Node)] 5 | struct Foo {} 6 | 7 | #[methods(foo=bar)] 8 | impl Foo { 9 | fn new(_owner: &Node) -> Self { 10 | Foo {} 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_methods_param.stderr: -------------------------------------------------------------------------------- 1 | error: expected literal 2 | --> tests/ui/derive_fail_methods_param.rs:7:15 3 | | 4 | 7 | #[methods(foo=bar)] 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_methods_special_args.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | #[inherit(Node)] 5 | struct Foo {} 6 | 7 | #[methods] 8 | impl Foo { 9 | fn new(_base: &Node) -> Self { 10 | Foo {} 11 | } 12 | 13 | #[method] 14 | async fn optional(#[opt] self, #[base] #[opt] _base: &Node, #[async_ctx] #[opt] _ctx: ()) {} 15 | 16 | #[method] 17 | fn based(#[base] self, #[base] _base: &Node, #[base] #[base] _basil: &Node, #[base] #[base] #[base] _basin: &Node) {} 18 | 19 | #[method] 20 | fn sync(self, #[async_ctx] _ctx: ()) {} 21 | } 22 | 23 | fn main() {} 24 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_property_empty_hint.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | fn test_hint() {} // bad return type 4 | 5 | #[derive(Default, NativeClass)] 6 | #[inherit(Node)] 7 | struct Foo { 8 | #[property] 9 | bar: String, 10 | 11 | // hint 12 | #[property(hint = "")] 13 | prop_hint: String, 14 | } 15 | 16 | #[methods] 17 | impl Foo { 18 | fn new(_owner: &Node) -> Self { 19 | Foo::default() 20 | } 21 | } 22 | 23 | fn main() {} 24 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_property_empty_hint.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected input, expected a double quoted string: "path::to::something" 2 | --> $DIR/derive_fail_property_empty_hint.rs:12:23 3 | | 4 | 12 | #[property(hint = "")] 5 | | ^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_property_hint.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | fn test_hint() {} // bad return type 4 | 5 | #[derive(Default, NativeClass)] 6 | #[inherit(Node)] 7 | struct Foo { 8 | #[property] 9 | bar: String, 10 | 11 | // hint 12 | #[property(hint = "test_hint")] 13 | prop_hint: String, 14 | } 15 | 16 | #[methods] 17 | impl Foo { 18 | fn new(_owner: &Node) -> Self { 19 | Foo::default() 20 | } 21 | } 22 | 23 | fn main() {} 24 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_property_hint.stderr: -------------------------------------------------------------------------------- 1 | error[E0271]: type mismatch resolving `::Hint == ()` 2 | --> $DIR/derive_fail_property_hint.rs:5:19 3 | | 4 | 5 | #[derive(Default, NativeClass)] 5 | | ^^^^^^^^^^^ expected `StringHint`, found `()` 6 | | 7 | = note: this error originates in the derive macro `NativeClass` (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_userdata.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | #[inherit(Node)] 5 | #[user_data] 6 | struct Foo {} 7 | 8 | impl Foo { 9 | fn new(_owner: &Node) -> Self { 10 | Foo {} 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_fail_userdata.stderr: -------------------------------------------------------------------------------- 1 | error: expected attribute arguments in parentheses: #[user_data(...)] 2 | --> $DIR/derive_fail_userdata.rs:5:1 3 | | 4 | 5 | #[user_data] 5 | | ^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_flexible_self_types.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | use gdnative::prelude::*; 4 | 5 | #[derive(NativeClass)] 6 | #[user_data(gdnative::export::user_data::ArcData)] 7 | struct Foo {} 8 | 9 | #[methods] 10 | impl Foo { 11 | fn new(_owner: &Reference) -> Self { 12 | Foo {} 13 | } 14 | 15 | #[method] 16 | fn none() {} 17 | 18 | #[method] 19 | fn arc(self: Arc) {} 20 | 21 | #[method] 22 | fn instance(#[self] _this: Instance) {} 23 | 24 | #[method] 25 | fn t_instance(#[self] _this: TInstance) {} 26 | } 27 | 28 | fn main() {} 29 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_no_inherit.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | struct Foo {} 5 | 6 | #[methods] 7 | impl Foo { 8 | fn new(_owner: &Reference) -> Self { 9 | Foo {} 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_pass.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | #[inherit(Node)] 5 | struct Foo {} 6 | 7 | #[methods] 8 | impl Foo { 9 | fn new(_owner: &Node) -> Self { 10 | Foo {} 11 | } 12 | 13 | #[method] 14 | fn bar(&self) {} 15 | } 16 | 17 | fn main() {} 18 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_property_basic.rs: -------------------------------------------------------------------------------- 1 | use gdnative::export::hint::*; 2 | use gdnative::prelude::*; 3 | 4 | fn test_hint() -> StringHint { 5 | StringHint::File(EnumHint::new(vec![])) 6 | } 7 | 8 | #[derive(Default, NativeClass)] 9 | #[inherit(Node)] 10 | struct Foo { 11 | #[property] 12 | bar: String, 13 | 14 | // hint 15 | #[property(hint = "test_hint")] 16 | prop_hint: String, 17 | } 18 | 19 | #[methods] 20 | impl Foo { 21 | fn new(_owner: &Node) -> Self { 22 | Foo::default() 23 | } 24 | } 25 | 26 | fn main() {} 27 | -------------------------------------------------------------------------------- /gdnative/tests/ui/derive_property_fail_inherit.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(NativeClass)] 4 | #[inherit] 5 | struct Foo {} 6 | 7 | #[methods] 8 | impl Foo { 9 | fn new(_owner: &Node) -> Self { 10 | Foo {} 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_01.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(FromVariant)] 4 | pub struct Foo { 5 | #[variant] 6 | bar: String, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_01.stderr: -------------------------------------------------------------------------------- 1 | error: Missing macro arguments 2 | expecting #[variant(...)]. See documentation: 3 | https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes 4 | --> $DIR/from_variant_fail_01.rs:5:7 5 | | 6 | 5 | #[variant] 7 | | ^^^^^^^ 8 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_02.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(FromVariant)] 4 | pub struct Foo { 5 | // Not a 'simple' ident, has `::` 6 | #[variant(baz::quux)] 7 | bar: String, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_02.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid syntax 2 | expecting #[variant(...)]. See documentation: 3 | https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes 4 | --> $DIR/from_variant_fail_02.rs:6:15 5 | | 6 | 6 | #[variant(baz::quux)] 7 | | ^^^^^^^^^ 8 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_03.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(FromVariant)] 4 | pub struct Foo { 5 | // error: baz::quux is not a simple ident in the NameValue 6 | #[variant(baz::quux = "path::to::function")] 7 | bar: String, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_03.stderr: -------------------------------------------------------------------------------- 1 | error: Found baz::quux, expected one of: 2 | to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip 3 | --> $DIR/from_variant_fail_03.rs:6:15 4 | | 5 | 6 | #[variant(baz::quux = "path::to::function")] 6 | | ^^^^^^^^^ 7 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_04.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(FromVariant)] 4 | pub struct Foo { 5 | // the path to the module must be wrapped in double quotes (a string) 6 | #[variant(with = path)] 7 | bar: String, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_04.stderr: -------------------------------------------------------------------------------- 1 | error: String expected, wrap with double quotes. 2 | --> $DIR/from_variant_fail_04.rs:6:22 3 | | 4 | 6 | #[variant(with = path)] 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_05.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(FromVariant)] 4 | pub struct Foo { 5 | // the path to the function must be wrapped in double quotes (a string) 6 | #[variant(from_variant_with = path)] 7 | bar: String, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_05.stderr: -------------------------------------------------------------------------------- 1 | error: String expected, wrap with double quotes. 2 | --> $DIR/from_variant_fail_05.rs:6:35 3 | | 4 | 6 | #[variant(from_variant_with = path)] 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_06.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(FromVariant)] 4 | pub struct Foo { 5 | // the path to the function must be wrapped in double quotes (a string) 6 | #[variant(from_variant_with = path)] 7 | bar: String, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_06.stderr: -------------------------------------------------------------------------------- 1 | error: String expected, wrap with double quotes. 2 | --> $DIR/from_variant_fail_06.rs:6:35 3 | | 4 | 6 | #[variant(from_variant_with = path)] 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_07.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(FromVariant)] 4 | pub struct Foo { 5 | #[variant(aoeu = "aoeu")] 6 | bar: String, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_07.stderr: -------------------------------------------------------------------------------- 1 | error: unknown argument, expected one of: 2 | to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip 3 | --> $DIR/from_variant_fail_07.rs:5:15 4 | | 5 | 5 | #[variant(aoeu = "aoeu")] 6 | | ^^^^ 7 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_08.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(FromVariant)] 4 | // `enum` representation should only be allowed on enums 5 | #[variant(enum = "repr")] 6 | pub struct Foo { 7 | bar: String, 8 | } 9 | 10 | #[derive(FromVariant)] 11 | // The `repr` representation requires an explicit type 12 | #[variant(enum = "repr")] 13 | pub enum Bar { 14 | A, 15 | B, 16 | C, 17 | } 18 | 19 | #[derive(FromVariant)] 20 | // The `repr` representation should only be allowed for fieldless enums 21 | #[variant(enum = "repr")] 22 | #[repr(i32)] 23 | pub enum Baz { 24 | A, 25 | B(String), 26 | C, 27 | } 28 | 29 | fn main() {} 30 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_08.stderr: -------------------------------------------------------------------------------- 1 | error: `enum` representation can only be set for enums 2 | --> tests/ui/from_variant_fail_08.rs:5:18 3 | | 4 | 5 | #[variant(enum = "repr")] 5 | | ^^^^^^ 6 | 7 | error: a primitive representation must be specified using `#[repr]` 8 | --> tests/ui/from_variant_fail_08.rs:13:10 9 | | 10 | 13 | pub enum Bar { 11 | | ^^^ 12 | 13 | error: `repr` representation can only be used for fieldless enums 14 | --> tests/ui/from_variant_fail_08.rs:25:5 15 | | 16 | 25 | B(String), 17 | | ^ 18 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_09.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(FromVariant)] 4 | // `enum` representation should only be allowed on enums 5 | #[variant(enum = "str")] 6 | pub struct Foo { 7 | bar: String, 8 | } 9 | 10 | #[derive(FromVariant)] 11 | // The `str` representation should only be allowed for fieldless enums 12 | #[variant(enum = "str")] 13 | pub enum Bar { 14 | A, 15 | B(String), 16 | C, 17 | } 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /gdnative/tests/ui/from_variant_fail_09.stderr: -------------------------------------------------------------------------------- 1 | error: `enum` representation can only be set for enums 2 | --> tests/ui/from_variant_fail_09.rs:5:18 3 | | 4 | 5 | #[variant(enum = "str")] 5 | | ^^^^^ 6 | 7 | error: `str` representation can only be used for fieldless enums 8 | --> tests/ui/from_variant_fail_09.rs:15:5 9 | | 10 | 15 | B(String), 11 | | ^ 12 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_01.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(ToVariant)] 4 | pub struct Foo { 5 | #[variant] 6 | bar: String, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_01.stderr: -------------------------------------------------------------------------------- 1 | error: Missing macro arguments 2 | expecting #[variant(...)]. See documentation: 3 | https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes 4 | --> $DIR/to_variant_fail_01.rs:5:7 5 | | 6 | 5 | #[variant] 7 | | ^^^^^^^ 8 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_02.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(ToVariant)] 4 | pub struct Foo { 5 | // Not a 'simple' ident, has `::` 6 | #[variant(baz::quux)] 7 | bar: String, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_02.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid syntax 2 | expecting #[variant(...)]. See documentation: 3 | https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes 4 | --> $DIR/to_variant_fail_02.rs:6:15 5 | | 6 | 6 | #[variant(baz::quux)] 7 | | ^^^^^^^^^ 8 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_03.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(ToVariant)] 4 | pub struct Foo { 5 | // error: baz::quux is not a simple ident in the NameValue 6 | #[variant(baz::quux = "path::to::function")] 7 | bar: String, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_03.stderr: -------------------------------------------------------------------------------- 1 | error: Found baz::quux, expected one of: 2 | to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip 3 | --> $DIR/to_variant_fail_03.rs:6:15 4 | | 5 | 6 | #[variant(baz::quux = "path::to::function")] 6 | | ^^^^^^^^^ 7 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_04.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(ToVariant)] 4 | pub struct Foo { 5 | // the path to the module must be wrapped in double quotes (a string) 6 | #[variant(with = path)] 7 | bar: String, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_04.stderr: -------------------------------------------------------------------------------- 1 | error: String expected, wrap with double quotes. 2 | --> $DIR/to_variant_fail_04.rs:6:22 3 | | 4 | 6 | #[variant(with = path)] 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_05.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(ToVariant)] 4 | pub struct Foo { 5 | // the path to the function must be wrapped in double quotes (a string) 6 | #[variant(to_variant_with = path)] 7 | bar: String, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_05.stderr: -------------------------------------------------------------------------------- 1 | error: String expected, wrap with double quotes. 2 | --> $DIR/to_variant_fail_05.rs:6:33 3 | | 4 | 6 | #[variant(to_variant_with = path)] 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_06.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(ToVariant)] 4 | pub struct Foo { 5 | // the path to the function must be wrapped in double quotes (a string) 6 | #[variant(to_variant_with = path)] 7 | bar: String, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_06.stderr: -------------------------------------------------------------------------------- 1 | error: String expected, wrap with double quotes. 2 | --> $DIR/to_variant_fail_06.rs:6:33 3 | | 4 | 6 | #[variant(to_variant_with = path)] 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_07.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(ToVariant)] 4 | pub struct Foo { 5 | #[variant(aoeu = "aoeu")] 6 | bar: String, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_07.stderr: -------------------------------------------------------------------------------- 1 | error: unknown argument, expected one of: 2 | to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip 3 | --> $DIR/to_variant_fail_07.rs:5:15 4 | | 5 | 5 | #[variant(aoeu = "aoeu")] 6 | | ^^^^ 7 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_08.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(ToVariant)] 4 | // `enum` representation should only be allowed on enums 5 | #[variant(enum = "repr")] 6 | pub struct Foo { 7 | bar: String, 8 | } 9 | 10 | #[derive(ToVariant)] 11 | // The `repr` representation requires an explicit type 12 | #[variant(enum = "repr")] 13 | pub enum Bar { 14 | A, 15 | B, 16 | C, 17 | } 18 | 19 | #[derive(ToVariant)] 20 | // The `repr` representation should only be allowed for fieldless enums 21 | #[variant(enum = "repr")] 22 | #[repr(i32)] 23 | pub enum Baz { 24 | A, 25 | B(String), 26 | C, 27 | } 28 | 29 | fn main() {} 30 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_08.stderr: -------------------------------------------------------------------------------- 1 | error: `enum` representation can only be set for enums 2 | --> tests/ui/to_variant_fail_08.rs:5:18 3 | | 4 | 5 | #[variant(enum = "repr")] 5 | | ^^^^^^ 6 | 7 | error: a primitive representation must be specified using `#[repr]` 8 | --> tests/ui/to_variant_fail_08.rs:13:10 9 | | 10 | 13 | pub enum Bar { 11 | | ^^^ 12 | 13 | error: `repr` representation can only be used for fieldless enums 14 | --> tests/ui/to_variant_fail_08.rs:25:5 15 | | 16 | 25 | B(String), 17 | | ^ 18 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_09.rs: -------------------------------------------------------------------------------- 1 | use gdnative::prelude::*; 2 | 3 | #[derive(ToVariant)] 4 | // `enum` representation should only be allowed on enums 5 | #[variant(enum = "str")] 6 | pub struct Foo { 7 | bar: String, 8 | } 9 | 10 | #[derive(ToVariant)] 11 | // The `str` representation should only be allowed for fieldless enums 12 | #[variant(enum = "str")] 13 | pub enum Bar { 14 | A, 15 | B(String), 16 | C, 17 | } 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /gdnative/tests/ui/to_variant_fail_09.stderr: -------------------------------------------------------------------------------- 1 | error: `enum` representation can only be set for enums 2 | --> tests/ui/to_variant_fail_09.rs:5:18 3 | | 4 | 5 | #[variant(enum = "str")] 5 | | ^^^^^ 6 | 7 | error: `str` representation can only be used for fieldless enums 8 | --> tests/ui/to_variant_fail_09.rs:15:5 9 | | 10 | 15 | B(String), 11 | | ^ 12 | -------------------------------------------------------------------------------- /impl/proc-macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gdnative-impl-proc-macros" 3 | authors = ["The godot-rust developers"] 4 | description = "Internal dependency of the gdnative bindings." 5 | repository = "https://github.com/godot-rust/godot-rust" 6 | homepage = "https://godot-rust.github.io/" 7 | version = "0.11.3" 8 | license = "MIT" 9 | workspace = "../.." 10 | edition = "2021" 11 | rust-version = "1.70" 12 | 13 | [lib] 14 | proc-macro = true 15 | 16 | [dependencies] 17 | syn = { version = "1.0.84", features = ["full", "extra-traits", "visit", "visit-mut"] } 18 | quote = "1" 19 | proc-macro2 = "1" 20 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/rustfmt.toml -------------------------------------------------------------------------------- /test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gdnative-test" 3 | version = "0.1.0" 4 | workspace = ".." 5 | edition = "2021" 6 | rust-version = "1.70" 7 | license = "MIT" 8 | publish = false 9 | 10 | [lib] 11 | crate-type = ["cdylib"] 12 | 13 | [features] 14 | default = [] 15 | type-tag-fallback = ["gdnative/type-tag-fallback"] 16 | custom-godot = ["gdnative/custom-godot"] 17 | ptrcall = ["gdnative/ptrcall"] 18 | inventory = ["gdnative/inventory"] 19 | no-manual-register = [] 20 | 21 | [dependencies] 22 | gdnative = { path = "../gdnative", features = ["gd-test", "serde", "async"] } 23 | gdnative-core = { path = "../gdnative-core" } 24 | approx = "0.5" 25 | ron = "0.8" 26 | serde = "1" 27 | serde_json = "1" 28 | bincode = "1" 29 | rmp-serde = "1" 30 | futures = "0.3" 31 | -------------------------------------------------------------------------------- /test/project/Scene.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://main.gd" type="Script" id=1] 4 | 5 | [node name="Node" type="Node"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /test/project/addons/editor_test_runner/plugin.cfg: -------------------------------------------------------------------------------- 1 | [plugin] 2 | 3 | name="editor_test_runner" 4 | description="" 5 | author="" 6 | version="" 7 | script="plugin.gd" 8 | -------------------------------------------------------------------------------- /test/project/addons/editor_test_runner/plugin.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends EditorPlugin 3 | 4 | var gdn 5 | 6 | func _enter_tree(): 7 | var run_tests = false 8 | for arg in OS.get_cmdline_args(): 9 | if arg == "--run-editor-tests": 10 | run_tests = true 11 | break 12 | if run_tests: 13 | var tests = Tests.new() 14 | add_child(tests) 15 | tests.run() 16 | else: 17 | print("Opening editor normally for the test project. To run tests, pass `--run-editor-tests` to the executable.") 18 | -------------------------------------------------------------------------------- /test/project/gdnative.gdnlib: -------------------------------------------------------------------------------- 1 | [entry] 2 | 3 | X11.32="res://lib/libgdnative_test.so" 4 | X11.64="res://lib/libgdnative_test.so" 5 | Server.32="res://lib/libgdnative_test.so" 6 | Server.64="res://lib/libgdnative_test.so" 7 | Windows="res://lib/gdnative_test.dll" 8 | OSX.64="res://lib/libgdnative_test.dylib" 9 | 10 | [dependencies] 11 | 12 | X11.64=[ ] 13 | 14 | [general] 15 | 16 | singleton=false 17 | load_once=true 18 | symbol_prefix="godot_" 19 | reloadable=false 20 | -------------------------------------------------------------------------------- /test/project/lib/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-rust/gdnative/ea72d5914cd50ebb9fd26821a592035bc86f97b7/test/project/lib/.gitkeep -------------------------------------------------------------------------------- /test/project/main.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | func _ready(): 4 | var tests = Tests.new() 5 | add_child(tests) 6 | tests.run() -------------------------------------------------------------------------------- /test/project/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ { 12 | "base": "Node", 13 | "class": "Tests", 14 | "language": "GDScript", 15 | "path": "res://tests.gd" 16 | } ] 17 | _global_script_class_icons={ 18 | "Tests": "" 19 | } 20 | 21 | [application] 22 | 23 | config/name="GodotRustTests" 24 | run/main_scene="res://Scene.tscn" 25 | 26 | [editor_plugins] 27 | 28 | enabled=PoolStringArray( "editor_test_runner" ) 29 | -------------------------------------------------------------------------------- /test/src/test_indexed_props.rs: -------------------------------------------------------------------------------- 1 | use gdnative::core_types::Margin; 2 | use gdnative::prelude::*; 3 | 4 | pub(crate) fn run_tests() -> bool { 5 | let mut status = true; 6 | 7 | status &= test_indexed_props(); 8 | 9 | status 10 | } 11 | 12 | pub(crate) fn register(_handle: InitHandle) {} 13 | 14 | crate::godot_itest! { test_indexed_props { 15 | let control = Control::new(); 16 | 17 | assert_eq!(0, control.margin_top()); 18 | assert_eq!(0, control.margin_left()); 19 | 20 | control.set_margin_top(42); 21 | 22 | assert_eq!(42, control.margin_top()); 23 | assert_eq!(42, control.margin(Margin::Top.into()) as i64); 24 | assert_eq!(0, control.margin_left()); 25 | assert_eq!(0, control.margin(Margin::Left.into()) as i64); 26 | 27 | control.set_margin(Margin::Left.into(), 24.0); 28 | 29 | assert_eq!(24, control.margin_left()); 30 | 31 | control.free(); 32 | }} 33 | -------------------------------------------------------------------------------- /test/src/test_vararray_return.rs: -------------------------------------------------------------------------------- 1 | use gdnative::api::Camera; 2 | use gdnative::prelude::*; 3 | 4 | pub(crate) fn run_tests() -> bool { 5 | let mut status = true; 6 | 7 | status &= test_vararray_return_crash(); 8 | 9 | status 10 | } 11 | 12 | pub(crate) fn register(_handle: InitHandle) {} 13 | 14 | crate::godot_itest! { test_vararray_return_crash { 15 | // See https://github.com/godot-rust/godot-rust/issues/422 16 | let camera = Camera::new(); 17 | 18 | camera.set_frustum(5.0, Vector2::new(1.0, 2.0), 0.0, 1.0); 19 | camera.get_frustum(); // this should not crash! 20 | camera.free(); 21 | }} 22 | -------------------------------------------------------------------------------- /tools/check-test-output.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | # Look for required error messages and leaked instances in the outputs of the integration test 4 | # Usage: check-test-output.sh stdout.log stderr.log 5 | 6 | FAIL=0 7 | 8 | while read COUNT && read PATTERN; do 9 | ACTUAL="$(grep -c "$PATTERN" "$2")" 10 | if [[ $? -ne 0 ]]; then 11 | ACTUAL=0 12 | fi 13 | if [[ COUNT -ne ACTUAL ]]; then 14 | FAIL=1 15 | echo "Found ${ACTUAL} out of ${COUNT} expected instances of message ${PATTERN}" 16 | fi 17 | done < <(sed -e 's/^#.*//' -e '/^$/d' -e 's/^\([0-9]\+\),/\1\n/' -e 's/\\/\\\\/g' "${BASH_SOURCE%/*}/required-errors.txt") 18 | 19 | if grep -q "Leaked instance" "$1"; then 20 | echo Leaked instances found. 21 | FAIL=1 22 | fi 23 | 24 | exit $FAIL -------------------------------------------------------------------------------- /tools/required-errors.txt: -------------------------------------------------------------------------------- 1 | # Error messages that must be found in the output of the integration test, in the format: 2 | # , 3 | 4 | # Empty lines or lines that start with '#' are ignored. 5 | 6 | # test_array_debug 7 | 4,Index 3 out of bounds (len 3) 8 | 9 | # test_derive_nativeclass_property_with_only_getter 10 | 1,ERROR: \(: \)\?property size on native class MyVec does not have a setter 11 | 12 | # _test_optional_args 13 | 1,ERROR: \(OptionalArgs :: opt_sum: \)\?missing non-optional parameter `b` (#1) 14 | 1,ERROR: \(OptionalArgs :: opt_sum: \)\?an excessive argument is given: I64(6) 15 | --------------------------------------------------------------------------------