summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/@GlobalScope.xml1468
-rw-r--r--doc/classes/AABB.xml78
-rw-r--r--doc/classes/AESContext.xml138
-rw-r--r--doc/classes/AStar.xml92
-rw-r--r--doc/classes/AStar2D.xml75
-rw-r--r--doc/classes/AcceptDialog.xml2
-rw-r--r--doc/classes/AnimatedSprite2D.xml9
-rw-r--r--doc/classes/AnimatedSprite3D.xml1
-rw-r--r--doc/classes/AnimatedTexture.xml12
-rw-r--r--doc/classes/Animation.xml32
-rw-r--r--doc/classes/AnimationNode.xml2
-rw-r--r--doc/classes/AnimationNodeAdd2.xml2
-rw-r--r--doc/classes/AnimationNodeAdd3.xml3
-rw-r--r--doc/classes/AnimationNodeAnimation.xml4
-rw-r--r--doc/classes/AnimationNodeBlend2.xml4
-rw-r--r--doc/classes/AnimationNodeBlend3.xml2
-rw-r--r--doc/classes/AnimationNodeBlendSpace1D.xml2
-rw-r--r--doc/classes/AnimationNodeBlendSpace2D.xml3
-rw-r--r--doc/classes/AnimationNodeBlendTree.xml2
-rw-r--r--doc/classes/AnimationNodeOneShot.xml3
-rw-r--r--doc/classes/AnimationNodeOutput.xml4
-rw-r--r--doc/classes/AnimationNodeStateMachine.xml12
-rw-r--r--doc/classes/AnimationNodeStateMachinePlayback.xml12
-rw-r--r--doc/classes/AnimationNodeStateMachineTransition.xml13
-rw-r--r--doc/classes/AnimationNodeTimeScale.xml3
-rw-r--r--doc/classes/AnimationNodeTimeSeek.xml2
-rw-r--r--doc/classes/AnimationNodeTransition.xml4
-rw-r--r--doc/classes/AnimationPlayer.xml8
-rw-r--r--doc/classes/AnimationTree.xml8
-rw-r--r--doc/classes/Area2D.xml15
-rw-r--r--doc/classes/Area3D.xml12
-rw-r--r--doc/classes/Array.xml250
-rw-r--r--doc/classes/ArrayMesh.xml28
-rw-r--r--doc/classes/AudioEffect.xml1
-rw-r--r--doc/classes/AudioEffectDistortion.xml5
-rw-r--r--doc/classes/AudioEffectFilter.xml3
-rw-r--r--doc/classes/AudioEffectHighShelfFilter.xml2
-rw-r--r--doc/classes/AudioEffectLowShelfFilter.xml2
-rw-r--r--doc/classes/AudioEffectRecord.xml4
-rw-r--r--doc/classes/AudioEffectReverb.xml1
-rw-r--r--doc/classes/AudioServer.xml5
-rw-r--r--doc/classes/AudioStream.xml5
-rw-r--r--doc/classes/AudioStreamGenerator.xml2
-rw-r--r--doc/classes/AudioStreamGeneratorPlayback.xml2
-rw-r--r--doc/classes/AudioStreamPlayback.xml1
-rw-r--r--doc/classes/AudioStreamPlayer.xml9
-rw-r--r--doc/classes/AudioStreamPlayer2D.xml4
-rw-r--r--doc/classes/AudioStreamPlayer3D.xml5
-rw-r--r--doc/classes/BakedLightmap.xml81
-rw-r--r--doc/classes/BakedLightmapData.xml65
-rw-r--r--doc/classes/BaseButton.xml16
-rw-r--r--doc/classes/BaseMaterial3D.xml36
-rw-r--r--doc/classes/Basis.xml131
-rw-r--r--doc/classes/BitMap.xml1
-rw-r--r--doc/classes/BitmapFont.xml11
-rw-r--r--doc/classes/BoxShape3D.xml3
-rw-r--r--doc/classes/Button.xml31
-rw-r--r--doc/classes/ButtonGroup.xml2
-rw-r--r--doc/classes/CPUParticles2D.xml5
-rw-r--r--doc/classes/Callable.xml73
-rw-r--r--doc/classes/Camera2D.xml3
-rw-r--r--doc/classes/Camera3D.xml16
-rw-r--r--doc/classes/CameraEffects.xml4
-rw-r--r--doc/classes/CanvasGroup.xml21
-rw-r--r--doc/classes/CanvasItem.xml151
-rw-r--r--doc/classes/CanvasLayer.xml5
-rw-r--r--doc/classes/CanvasTexture.xml29
-rw-r--r--doc/classes/CapsuleShape3D.xml1
-rw-r--r--doc/classes/CharFXTransform.xml15
-rw-r--r--doc/classes/CheckBox.xml1
-rw-r--r--doc/classes/CheckButton.xml1
-rw-r--r--doc/classes/ClippedCamera3D.xml2
-rw-r--r--doc/classes/CodeEdit.xml203
-rw-r--r--doc/classes/CodeHighlighter.xml145
-rw-r--r--doc/classes/CollisionShape2D.xml7
-rw-r--r--doc/classes/CollisionShape3D.xml7
-rw-r--r--doc/classes/Color.xml414
-rw-r--r--doc/classes/ColorPicker.xml1
-rw-r--r--doc/classes/ColorPickerButton.xml3
-rw-r--r--doc/classes/ColorRect.xml14
-rw-r--r--doc/classes/ConcavePolygonShape3D.xml1
-rw-r--r--doc/classes/ConfigFile.xml22
-rw-r--r--doc/classes/ConfirmationDialog.xml9
-rw-r--r--doc/classes/Control.xml307
-rw-r--r--doc/classes/ConvexPolygonShape2D.xml2
-rw-r--r--doc/classes/ConvexPolygonShape3D.xml1
-rw-r--r--doc/classes/Crypto.xml121
-rw-r--r--doc/classes/CryptoKey.xml37
-rw-r--r--doc/classes/Cubemap.xml2
-rw-r--r--doc/classes/CubemapArray.xml2
-rw-r--r--doc/classes/Curve2D.xml8
-rw-r--r--doc/classes/Curve3D.xml8
-rw-r--r--doc/classes/CylinderShape3D.xml3
-rw-r--r--doc/classes/DTLSServer.xml97
-rw-r--r--doc/classes/Decal.xml28
-rw-r--r--doc/classes/Dictionary.xml256
-rw-r--r--doc/classes/DirectionalLight2D.xml20
-rw-r--r--doc/classes/DirectionalLight3D.xml12
-rw-r--r--doc/classes/Directory.xml39
-rw-r--r--doc/classes/DisplayServer.xml152
-rw-r--r--doc/classes/DynamicFont.xml35
-rw-r--r--doc/classes/DynamicFontData.xml3
-rw-r--r--doc/classes/EditorDebuggerPlugin.xml103
-rw-r--r--doc/classes/EditorExportPlugin.xml12
-rw-r--r--doc/classes/EditorFeatureProfile.xml10
-rw-r--r--doc/classes/EditorFileSystem.xml1
-rw-r--r--doc/classes/EditorFileSystemDirectory.xml2
-rw-r--r--doc/classes/EditorImportPlugin.xml105
-rw-r--r--doc/classes/EditorInspector.xml11
-rw-r--r--doc/classes/EditorInterface.xml83
-rw-r--r--doc/classes/EditorNode3DGizmo.xml9
-rw-r--r--doc/classes/EditorNode3DGizmoPlugin.xml9
-rw-r--r--doc/classes/EditorPlugin.xml216
-rw-r--r--doc/classes/EditorProperty.xml14
-rw-r--r--doc/classes/EditorScenePostImport.xml44
-rw-r--r--doc/classes/EditorScript.xml21
-rw-r--r--doc/classes/EditorSettings.xml71
-rw-r--r--doc/classes/EditorSyntaxHighlighter.xml31
-rw-r--r--doc/classes/EditorTranslationParserPlugin.xml128
-rw-r--r--doc/classes/Engine.xml22
-rw-r--r--doc/classes/EngineDebugger.xml132
-rw-r--r--doc/classes/Environment.xml183
-rw-r--r--doc/classes/Expression.xml37
-rw-r--r--doc/classes/File.xml57
-rw-r--r--doc/classes/FileDialog.xml9
-rw-r--r--doc/classes/FileSystemDock.xml18
-rw-r--r--doc/classes/Font.xml14
-rw-r--r--doc/classes/FuncRef.xml57
-rw-r--r--doc/classes/GIProbe.xml5
-rw-r--r--doc/classes/GIProbeData.xml1
-rw-r--r--doc/classes/GPUParticles2D.xml8
-rw-r--r--doc/classes/GPUParticles3D.xml35
-rw-r--r--doc/classes/GPUParticlesAttractor3D.xml23
-rw-r--r--doc/classes/GPUParticlesAttractorBox.xml17
-rw-r--r--doc/classes/GPUParticlesAttractorSphere.xml17
-rw-r--r--doc/classes/GPUParticlesAttractorVectorField.xml19
-rw-r--r--doc/classes/GPUParticlesCollision3D.xml17
-rw-r--r--doc/classes/GPUParticlesCollisionBox.xml17
-rw-r--r--doc/classes/GPUParticlesCollisionHeightField.xml43
-rw-r--r--doc/classes/GPUParticlesCollisionSDF.xml37
-rw-r--r--doc/classes/GPUParticlesCollisionSphere.xml17
-rw-r--r--doc/classes/Generic6DOFJoint3D.xml12
-rw-r--r--doc/classes/Geometry2D.xml (renamed from doc/classes/Geometry.xml)239
-rw-r--r--doc/classes/Geometry3D.xml185
-rw-r--r--doc/classes/GeometryInstance3D.xml48
-rw-r--r--doc/classes/Gradient.xml18
-rw-r--r--doc/classes/GraphEdit.xml16
-rw-r--r--doc/classes/GridContainer.xml8
-rw-r--r--doc/classes/HSlider.xml1
-rw-r--r--doc/classes/HTTPClient.xml13
-rw-r--r--doc/classes/HTTPRequest.xml61
-rw-r--r--doc/classes/Image.xml38
-rw-r--r--doc/classes/ImageTexture3D.xml39
-rw-r--r--doc/classes/ImageTextureLayered.xml31
-rw-r--r--doc/classes/Input.xml (renamed from doc/classes/InputFilter.xml)85
-rw-r--r--doc/classes/InputEvent.xml6
-rw-r--r--doc/classes/InputEventAction.xml4
-rw-r--r--doc/classes/InputEventJoypadButton.xml4
-rw-r--r--doc/classes/InputEventJoypadMotion.xml4
-rw-r--r--doc/classes/InputEventKey.xml6
-rw-r--r--doc/classes/InputEventMouse.xml2
-rw-r--r--doc/classes/InputEventMouseButton.xml2
-rw-r--r--doc/classes/InputEventMouseMotion.xml6
-rw-r--r--doc/classes/InputEventScreenDrag.xml2
-rw-r--r--doc/classes/InputEventScreenTouch.xml2
-rw-r--r--doc/classes/InputEventWithModifiers.xml14
-rw-r--r--doc/classes/InputMap.xml20
-rw-r--r--doc/classes/InstancePlaceholder.xml3
-rw-r--r--doc/classes/ItemList.xml8
-rw-r--r--doc/classes/JSON.xml25
-rw-r--r--doc/classes/JSONParseResult.xml10
-rw-r--r--doc/classes/JSONParser.xml57
-rw-r--r--doc/classes/JavaScript.xml3
-rw-r--r--doc/classes/Joint2D.xml2
-rw-r--r--doc/classes/Joint3D.xml1
-rw-r--r--doc/classes/KinematicBody2D.xml22
-rw-r--r--doc/classes/KinematicBody3D.xml40
-rw-r--r--doc/classes/Label.xml3
-rw-r--r--doc/classes/Light2D.xml58
-rw-r--r--doc/classes/Light3D.xml40
-rw-r--r--doc/classes/LightOccluder2D.xml2
-rw-r--r--doc/classes/LightmapProbe.xml13
-rw-r--r--doc/classes/Lightmapper.xml13
-rw-r--r--doc/classes/LightmapperRD.xml13
-rw-r--r--doc/classes/Line2D.xml6
-rw-r--r--doc/classes/LineEdit.xml72
-rw-r--r--doc/classes/LineShape2D.xml2
-rw-r--r--doc/classes/LinkButton.xml3
-rw-r--r--doc/classes/MainLoop.xml48
-rw-r--r--doc/classes/MarginContainer.xml13
-rw-r--r--doc/classes/Material.xml4
-rw-r--r--doc/classes/MenuButton.xml3
-rw-r--r--doc/classes/Mesh.xml8
-rw-r--r--doc/classes/MeshDataTool.xml34
-rw-r--r--doc/classes/MeshInstance2D.xml3
-rw-r--r--doc/classes/MeshInstance3D.xml4
-rw-r--r--doc/classes/MeshLibrary.xml2
-rw-r--r--doc/classes/MultiMesh.xml8
-rw-r--r--doc/classes/MultiMeshInstance2D.xml1
-rw-r--r--doc/classes/MultiMeshInstance3D.xml6
-rw-r--r--doc/classes/Mutex.xml2
-rw-r--r--doc/classes/Navigation2D.xml1
-rw-r--r--doc/classes/Navigation3D.xml1
-rw-r--r--doc/classes/NavigationMesh.xml11
-rw-r--r--doc/classes/NavigationPolygon.xml30
-rw-r--r--doc/classes/NavigationServer2D.xml1
-rw-r--r--doc/classes/NavigationServer3D.xml1
-rw-r--r--doc/classes/NetworkedMultiplayerPeer.xml3
-rw-r--r--doc/classes/NinePatchRect.xml18
-rw-r--r--doc/classes/Node.xml97
-rw-r--r--doc/classes/Node2D.xml11
-rw-r--r--doc/classes/Node3D.xml28
-rw-r--r--doc/classes/NodePath.xml95
-rw-r--r--doc/classes/OS.xml86
-rw-r--r--doc/classes/Object.xml43
-rw-r--r--doc/classes/OmniLight3D.xml4
-rw-r--r--doc/classes/OptionButton.xml3
-rw-r--r--doc/classes/PCKPacker.xml18
-rw-r--r--doc/classes/PackedByteArray.xml129
-rw-r--r--doc/classes/PackedColorArray.xml104
-rw-r--r--doc/classes/PackedFloat32Array.xml88
-rw-r--r--doc/classes/PackedFloat64Array.xml96
-rw-r--r--doc/classes/PackedInt32Array.xml104
-rw-r--r--doc/classes/PackedInt64Array.xml104
-rw-r--r--doc/classes/PackedScene.xml51
-rw-r--r--doc/classes/PackedStringArray.xml105
-rw-r--r--doc/classes/PackedVector2Array.xml113
-rw-r--r--doc/classes/PackedVector3Array.xml112
-rw-r--r--doc/classes/PacketPeerUDP.xml33
-rw-r--r--doc/classes/Panel.xml3
-rw-r--r--doc/classes/PanelContainer.xml1
-rw-r--r--doc/classes/ParticlesMaterial.xml37
-rw-r--r--doc/classes/Path2D.xml1
-rw-r--r--doc/classes/Performance.xml119
-rw-r--r--doc/classes/PhysicalBone3D.xml4
-rw-r--r--doc/classes/PhysicalSkyMaterial.xml3
-rw-r--r--doc/classes/PhysicsBody2D.xml9
-rw-r--r--doc/classes/PhysicsBody3D.xml6
-rw-r--r--doc/classes/PhysicsDirectBodyState2D.xml10
-rw-r--r--doc/classes/PhysicsDirectBodyState3D.xml12
-rw-r--r--doc/classes/PhysicsDirectSpaceState2D.xml5
-rw-r--r--doc/classes/PhysicsDirectSpaceState3D.xml2
-rw-r--r--doc/classes/PhysicsMaterial.xml2
-rw-r--r--doc/classes/PhysicsServer2D.xml27
-rw-r--r--doc/classes/PhysicsServer3D.xml6
-rw-r--r--doc/classes/PhysicsShapeQueryParameters2D.xml44
-rw-r--r--doc/classes/PhysicsShapeQueryParameters3D.xml44
-rw-r--r--doc/classes/Plane.xml120
-rw-r--r--doc/classes/PointLight2D.xml27
-rw-r--r--doc/classes/Polygon2D.xml8
-rw-r--r--doc/classes/Popup.xml2
-rw-r--r--doc/classes/PopupMenu.xml42
-rw-r--r--doc/classes/PrimitiveMesh.xml14
-rw-r--r--doc/classes/ProjectSettings.xml289
-rw-r--r--doc/classes/QuadMesh.xml2
-rw-r--r--doc/classes/Quat.xml179
-rw-r--r--doc/classes/RID.xml61
-rw-r--r--doc/classes/RandomNumberGenerator.xml4
-rw-r--r--doc/classes/RayCast2D.xml18
-rw-r--r--doc/classes/RayCast3D.xml19
-rw-r--r--doc/classes/Rect2.xml78
-rw-r--r--doc/classes/Rect2i.xml174
-rw-r--r--doc/classes/RectangleShape2D.xml2
-rw-r--r--doc/classes/Reference.xml3
-rw-r--r--doc/classes/ReferenceRect.xml5
-rw-r--r--doc/classes/ReflectionProbe.xml27
-rw-r--r--doc/classes/RenderingDevice.xml26
-rw-r--r--doc/classes/RenderingServer.xml372
-rw-r--r--doc/classes/Resource.xml8
-rw-r--r--doc/classes/ResourceFormatLoader.xml2
-rw-r--r--doc/classes/ResourceLoader.xml5
-rw-r--r--doc/classes/RichTextEffect.xml4
-rw-r--r--doc/classes/RichTextLabel.xml18
-rw-r--r--doc/classes/RigidBody2D.xml36
-rw-r--r--doc/classes/RigidBody3D.xml43
-rw-r--r--doc/classes/SceneTree.xml4
-rw-r--r--doc/classes/Script.xml2
-rw-r--r--doc/classes/ScriptEditor.xml29
-rw-r--r--doc/classes/ScriptEditorBase.xml67
-rw-r--r--doc/classes/Semaphore.xml2
-rw-r--r--doc/classes/Shader.xml4
-rw-r--r--doc/classes/ShaderMaterial.xml2
-rw-r--r--doc/classes/Shape2D.xml13
-rw-r--r--doc/classes/Shape3D.xml2
-rw-r--r--doc/classes/Shortcut.xml (renamed from doc/classes/ShortCut.xml)2
-rw-r--r--doc/classes/Signal.xml40
-rw-r--r--doc/classes/Skeleton2D.xml2
-rw-r--r--doc/classes/Skeleton3D.xml55
-rw-r--r--doc/classes/SkeletonIK3D.xml1
-rw-r--r--doc/classes/Sky.xml12
-rw-r--r--doc/classes/Slider.xml1
-rw-r--r--doc/classes/SoftBody3D.xml6
-rw-r--r--doc/classes/SphereShape3D.xml1
-rw-r--r--doc/classes/SpinBox.xml2
-rw-r--r--doc/classes/SpotLight3D.xml7
-rw-r--r--doc/classes/SpringArm3D.xml4
-rw-r--r--doc/classes/Sprite2D.xml17
-rw-r--r--doc/classes/Sprite3D.xml7
-rw-r--r--doc/classes/SpriteBase3D.xml12
-rw-r--r--doc/classes/SpriteFrames.xml3
-rw-r--r--doc/classes/StaticBody3D.xml3
-rw-r--r--doc/classes/StreamCubemap.xml13
-rw-r--r--doc/classes/StreamCubemapArray.xml13
-rw-r--r--doc/classes/StreamPeerSSL.xml2
-rw-r--r--doc/classes/StreamPeerTCP.xml2
-rw-r--r--doc/classes/StreamTexture2D.xml (renamed from doc/classes/StreamTexture.xml)2
-rw-r--r--doc/classes/StreamTexture2DArray.xml13
-rw-r--r--doc/classes/StreamTexture3D.xml25
-rw-r--r--doc/classes/StreamTextureLayered.xml25
-rw-r--r--doc/classes/String.xml517
-rw-r--r--doc/classes/StringName.xml50
-rw-r--r--doc/classes/StyleBox.xml1
-rw-r--r--doc/classes/StyleBoxTexture.xml3
-rw-r--r--doc/classes/SubViewport.xml10
-rw-r--r--doc/classes/SubViewportContainer.xml1
-rw-r--r--doc/classes/SurfaceTool.xml2
-rw-r--r--doc/classes/SyntaxHighlighter.xml53
-rw-r--r--doc/classes/TabContainer.xml4
-rw-r--r--doc/classes/Tabs.xml9
-rw-r--r--doc/classes/TextEdit.xml426
-rw-r--r--doc/classes/Texture2D.xml34
-rw-r--r--doc/classes/Texture2DArray.xml2
-rw-r--r--doc/classes/Texture3D.xml49
-rw-r--r--doc/classes/TextureButton.xml8
-rw-r--r--doc/classes/TextureLayered.xml28
-rw-r--r--doc/classes/TextureRect.xml1
-rw-r--r--doc/classes/Theme.xml128
-rw-r--r--doc/classes/Thread.xml7
-rw-r--r--doc/classes/TileMap.xml24
-rw-r--r--doc/classes/TileSet.xml41
-rw-r--r--doc/classes/Timer.xml2
-rw-r--r--doc/classes/ToolButton.xml57
-rw-r--r--doc/classes/TouchScreenButton.xml6
-rw-r--r--doc/classes/Transform.xml134
-rw-r--r--doc/classes/Transform2D.xml146
-rw-r--r--doc/classes/Translation.xml41
-rw-r--r--doc/classes/TranslationServer.xml34
-rw-r--r--doc/classes/Tree.xml13
-rw-r--r--doc/classes/TreeItem.xml33
-rw-r--r--doc/classes/Tween.xml5
-rw-r--r--doc/classes/UDPServer.xml20
-rw-r--r--doc/classes/VBoxContainer.xml1
-rw-r--r--doc/classes/VSlider.xml1
-rw-r--r--doc/classes/Variant.xml2
-rw-r--r--doc/classes/Vector2.xml246
-rw-r--r--doc/classes/Vector2i.xml220
-rw-r--r--doc/classes/Vector3.xml268
-rw-r--r--doc/classes/Vector3i.xml229
-rw-r--r--doc/classes/VehicleBody3D.xml2
-rw-r--r--doc/classes/VehicleWheel3D.xml2
-rw-r--r--doc/classes/VideoPlayer.xml2
-rw-r--r--doc/classes/Viewport.xml51
-rw-r--r--doc/classes/ViewportTexture.xml4
-rw-r--r--doc/classes/VisibilityEnabler2D.xml3
-rw-r--r--doc/classes/VisibilityEnabler3D.xml3
-rw-r--r--doc/classes/VisibilityNotifier2D.xml4
-rw-r--r--doc/classes/VisibilityNotifier3D.xml3
-rw-r--r--doc/classes/VisualInstance3D.xml4
-rw-r--r--doc/classes/VisualShader.xml9
-rw-r--r--doc/classes/VisualShaderNode.xml2
-rw-r--r--doc/classes/VisualShaderNodeBooleanUniform.xml8
-rw-r--r--doc/classes/VisualShaderNodeColorUniform.xml8
-rw-r--r--doc/classes/VisualShaderNodeCurveTexture.xml17
-rw-r--r--doc/classes/VisualShaderNodeCustom.xml6
-rw-r--r--doc/classes/VisualShaderNodeFloatUniform.xml6
-rw-r--r--doc/classes/VisualShaderNodeGroupBase.xml7
-rw-r--r--doc/classes/VisualShaderNodeInput.xml4
-rw-r--r--doc/classes/VisualShaderNodeIntUniform.xml6
-rw-r--r--doc/classes/VisualShaderNodeIs.xml5
-rw-r--r--doc/classes/VisualShaderNodeMultiplyAdd.xml29
-rw-r--r--doc/classes/VisualShaderNodeOuterProduct.xml2
-rw-r--r--doc/classes/VisualShaderNodeOutput.xml2
-rw-r--r--doc/classes/VisualShaderNodeResizableBase.xml18
-rw-r--r--doc/classes/VisualShaderNodeSample3D.xml26
-rw-r--r--doc/classes/VisualShaderNodeScalarClamp.xml2
-rw-r--r--doc/classes/VisualShaderNodeScalarDerivativeFunc.xml6
-rw-r--r--doc/classes/VisualShaderNodeScalarInterp.xml2
-rw-r--r--doc/classes/VisualShaderNodeScalarSmoothStep.xml3
-rw-r--r--doc/classes/VisualShaderNodeScalarSwitch.xml2
-rw-r--r--doc/classes/VisualShaderNodeSwitch.xml2
-rw-r--r--doc/classes/VisualShaderNodeTexture.xml14
-rw-r--r--doc/classes/VisualShaderNodeTexture2DArray.xml20
-rw-r--r--doc/classes/VisualShaderNodeTexture2DArrayUniform.xml13
-rw-r--r--doc/classes/VisualShaderNodeTexture3D.xml20
-rw-r--r--doc/classes/VisualShaderNodeTexture3DUniform.xml15
-rw-r--r--doc/classes/VisualShaderNodeTextureUniform.xml10
-rw-r--r--doc/classes/VisualShaderNodeTextureUniformTriplanar.xml2
-rw-r--r--doc/classes/VisualShaderNodeTransformCompose.xml2
-rw-r--r--doc/classes/VisualShaderNodeTransformConstant.xml3
-rw-r--r--doc/classes/VisualShaderNodeTransformDecompose.xml2
-rw-r--r--doc/classes/VisualShaderNodeTransformFunc.xml5
-rw-r--r--doc/classes/VisualShaderNodeTransformMult.xml7
-rw-r--r--doc/classes/VisualShaderNodeTransformUniform.xml10
-rw-r--r--doc/classes/VisualShaderNodeTransformVecMult.xml7
-rw-r--r--doc/classes/VisualShaderNodeUniform.xml11
-rw-r--r--doc/classes/VisualShaderNodeUniformRef.xml20
-rw-r--r--doc/classes/VisualShaderNodeVec3Constant.xml3
-rw-r--r--doc/classes/VisualShaderNodeVec3Uniform.xml10
-rw-r--r--doc/classes/VisualShaderNodeVectorClamp.xml2
-rw-r--r--doc/classes/VisualShaderNodeVectorCompose.xml2
-rw-r--r--doc/classes/VisualShaderNodeVectorDecompose.xml2
-rw-r--r--doc/classes/VisualShaderNodeVectorDerivativeFunc.xml6
-rw-r--r--doc/classes/VisualShaderNodeVectorDistance.xml3
-rw-r--r--doc/classes/VisualShaderNodeVectorFunc.xml38
-rw-r--r--doc/classes/VisualShaderNodeVectorInterp.xml2
-rw-r--r--doc/classes/VisualShaderNodeVectorLen.xml2
-rw-r--r--doc/classes/VisualShaderNodeVectorOp.xml15
-rw-r--r--doc/classes/VisualShaderNodeVectorRefract.xml2
-rw-r--r--doc/classes/VisualShaderNodeVectorScalarMix.xml2
-rw-r--r--doc/classes/VisualShaderNodeVectorScalarSmoothStep.xml3
-rw-r--r--doc/classes/VisualShaderNodeVectorScalarStep.xml3
-rw-r--r--doc/classes/VisualShaderNodeVectorSmoothStep.xml3
-rw-r--r--doc/classes/Window.xml6
-rw-r--r--doc/classes/World2D.xml4
-rw-r--r--doc/classes/World3D.xml4
-rw-r--r--doc/classes/WorldEnvironment.xml5
-rw-r--r--doc/classes/XRCamera3D.xml2
-rw-r--r--doc/classes/XRController3D.xml4
-rw-r--r--doc/classes/XRInterface.xml2
-rw-r--r--doc/classes/XROrigin3D.xml2
-rw-r--r--doc/classes/XRPositionalTracker.xml2
-rw-r--r--doc/classes/XRServer.xml2
-rw-r--r--doc/classes/bool.xml144
-rw-r--r--doc/classes/float.xml239
-rw-r--r--doc/classes/int.xml291
425 files changed, 12501 insertions, 3451 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 602d0e4d0e..f6b1bb4d7c 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -10,6 +10,1147 @@
<tutorials>
</tutorials>
<methods>
+ <method name="abs">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="x" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="absf">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the absolute value of float parameter [code]x[/code] (i.e. positive value).
+ [codeblock]
+ # a is 1.2
+ a = absf(-1.2)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="absi">
+ <return type="int">
+ </return>
+ <argument index="0" name="x" type="int">
+ </argument>
+ <description>
+ Returns the absolute value of int parameter [code]x[/code] (i.e. positive value).
+ [codeblock]
+ # a is 1
+ a = absi(-1)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="acos">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the arc cosine of [code]x[/code] in radians. Use to get the angle of cosine [code]x[/code].
+ [codeblock]
+ # c is 0.523599 or 30 degrees if converted with rad2deg(c)
+ c = acos(0.866025)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="asin">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the arc sine of [code]x[/code] in radians. Use to get the angle of sine [code]x[/code].
+ [codeblock]
+ # s is 0.523599 or 30 degrees if converted with rad2deg(s)
+ s = asin(0.5)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="atan">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the arc tangent of [code]x[/code] in radians. Use it to get the angle from an angle's tangent in trigonometry: [code]atan(tan(angle)) == angle[/code].
+ The method cannot know in which quadrant the angle should fall. See [method atan2] if you have both [code]y[/code] and [code]x[/code].
+ [codeblock]
+ a = atan(0.5) # a is 0.463648
+ [/codeblock]
+ </description>
+ </method>
+ <method name="atan2">
+ <return type="float">
+ </return>
+ <argument index="0" name="y" type="float">
+ </argument>
+ <argument index="1" name="x" type="float">
+ </argument>
+ <description>
+ Returns the arc tangent of [code]y/x[/code] in radians. Use to get the angle of tangent [code]y/x[/code]. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant.
+ Important note: The Y coordinate comes first, by convention.
+ [codeblock]
+ a = atan2(0, -1) # a is 3.141593
+ [/codeblock]
+ </description>
+ </method>
+ <method name="bytes2var">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="bytes" type="PackedByteArray">
+ </argument>
+ <description>
+ Decodes a byte array back to a [Variant] value, without decoding objects.
+ [b]Note:[/b] If you need object deserialization, see [method bytes2var_with_objects].
+ </description>
+ </method>
+ <method name="bytes2var_with_objects">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="bytes" type="PackedByteArray">
+ </argument>
+ <description>
+ Decodes a byte array back to a [Variant] value. Decoding objects is allowed.
+ [b]WARNING:[/b] Deserialized object can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats (remote code execution).
+ </description>
+ </method>
+ <method name="cartesian2polar">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <description>
+ Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle).
+ </description>
+ </method>
+ <method name="ceil">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Rounds [code]x[/code] upward (towards positive infinity), returning the smallest whole number that is not less than [code]x[/code].
+ [codeblock]
+ i = ceil(1.45) # i is 2
+ i = ceil(1.001) # i is 2
+ [/codeblock]
+ See also [method floor], [method round], and [method stepify].
+ </description>
+ </method>
+ <method name="clamp">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="value" type="Variant">
+ </argument>
+ <argument index="1" name="min" type="Variant">
+ </argument>
+ <argument index="2" name="max" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="clampf">
+ <return type="float">
+ </return>
+ <argument index="0" name="value" type="float">
+ </argument>
+ <argument index="1" name="min" type="float">
+ </argument>
+ <argument index="2" name="max" type="float">
+ </argument>
+ <description>
+ Clamps the float [code]value[/code] and returns a value not less than [code]min[/code] and not more than [code]max[/code].
+ [codeblock]
+ speed = 42.1
+ # a is 20.0
+ a = clampf(speed, 1.0, 20.0)
+
+ speed = -10.0
+ # a is -1.0
+ a = clampf(speed, -1.0, 1.0)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="clampi">
+ <return type="int">
+ </return>
+ <argument index="0" name="value" type="int">
+ </argument>
+ <argument index="1" name="min" type="int">
+ </argument>
+ <argument index="2" name="max" type="int">
+ </argument>
+ <description>
+ Clamps the integer [code]value[/code] and returns a value not less than [code]min[/code] and not more than [code]max[/code].
+ [codeblock]
+ speed = 42
+ # a is 20
+ a = clampi(speed, 1, 20)
+
+ speed = -10
+ # a is -1
+ a = clampi(speed, -1, 1)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="cos">
+ <return type="float">
+ </return>
+ <argument index="0" name="angle_rad" type="float">
+ </argument>
+ <description>
+ Returns the cosine of angle [code]angle_rad[/code] in radians.
+ [codeblock]
+ # Prints 1 then -1
+ print(cos(PI * 2))
+ print(cos(PI))
+ [/codeblock]
+ </description>
+ </method>
+ <method name="cosh">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the hyperbolic cosine of [code]x[/code] in radians.
+ [codeblock]
+ # Prints 1.543081
+ print(cosh(1))
+ [/codeblock]
+ </description>
+ </method>
+ <method name="db2linear">
+ <return type="float">
+ </return>
+ <argument index="0" name="db" type="float">
+ </argument>
+ <description>
+ Converts from decibels to linear energy (audio).
+ </description>
+ </method>
+ <method name="dectime">
+ <return type="float">
+ </return>
+ <argument index="0" name="value" type="float">
+ </argument>
+ <argument index="1" name="amount" type="float">
+ </argument>
+ <argument index="2" name="step" type="float">
+ </argument>
+ <description>
+ Returns the result of [code]value[/code] decreased by [code]step[/code] * [code]amount[/code].
+ [codeblock]
+ # a = 59
+ a = dectime(60, 10, 0.1))
+ [/codeblock]
+ </description>
+ </method>
+ <method name="deg2rad">
+ <return type="float">
+ </return>
+ <argument index="0" name="deg" type="float">
+ </argument>
+ <description>
+ Converts an angle expressed in degrees to radians.
+ [codeblock]
+ # r is 3.141593
+ r = deg2rad(180)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="ease">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="curve" type="float">
+ </argument>
+ <description>
+ Easing function, based on exponent. The curve values are: 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in.
+ </description>
+ </method>
+ <method name="exp">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ The natural exponential function. It raises the mathematical constant [b]e[/b] to the power of [code]x[/code] and returns it.
+ [b]e[/b] has an approximate value of 2.71828, and can be obtained with [code]exp(1)[/code].
+ For exponents to other bases use the method [method pow].
+ [codeblock]
+ a = exp(2) # Approximately 7.39
+ [/codeblock]
+ </description>
+ </method>
+ <method name="floor">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Rounds [code]x[/code] downward (towards negative infinity), returning the largest whole number that is not more than [code]x[/code].
+ [codeblock]
+ # a is 2.0
+ a = floor(2.99)
+ # a is -3.0
+ a = floor(-2.99)
+ [/codeblock]
+ See also [method ceil], [method round], and [method stepify].
+ [b]Note:[/b] This method returns a float. If you need an integer, you can use [code]int(x)[/code] directly.
+ </description>
+ </method>
+ <method name="fmod">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <description>
+ Returns the floating-point remainder of [code]x/y[/code], keeping the sign of [code]x[/code].
+ [codeblock]
+ # Remainder is 1.5
+ var remainder = fmod(7, 5.5)
+ [/codeblock]
+ For the integer remainder operation, use the [code]%[/code] operator.
+ </description>
+ </method>
+ <method name="fposmod">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <description>
+ Returns the floating-point modulus of [code]x/y[/code] that wraps equally in positive and negative.
+ [codeblock]
+ for i in 7:
+ var x = 0.5 * i - 1.5
+ print("%4.1f %4.1f %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)])
+ [/codeblock]
+ Produces:
+ [codeblock]
+ -1.5 -0.0 0.0
+ -1.0 -1.0 0.5
+ -0.5 -0.5 1.0
+ 0.0 0.0 0.0
+ 0.5 0.5 0.5
+ 1.0 1.0 1.0
+ 1.5 0.0 0.0
+ [/codeblock]
+ </description>
+ </method>
+ <method name="hash">
+ <return type="int">
+ </return>
+ <argument index="0" name="variable" type="Variant">
+ </argument>
+ <description>
+ Returns the integer hash of the variable passed.
+ [codeblock]
+ print(hash("a")) # Prints 177670
+ [/codeblock]
+ </description>
+ </method>
+ <method name="instance_from_id">
+ <return type="Object">
+ </return>
+ <argument index="0" name="instance_id" type="int">
+ </argument>
+ <description>
+ Returns the Object that corresponds to [code]instance_id[/code]. All Objects have a unique instance ID.
+ [codeblock]
+ var foo = "bar"
+ func _ready():
+ var id = get_instance_id()
+ var inst = instance_from_id(id)
+ print(inst.foo) # Prints bar
+ [/codeblock]
+ </description>
+ </method>
+ <method name="inverse_lerp">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="weight" type="float">
+ </argument>
+ <description>
+ Returns a normalized value considering the given range. This is the opposite of [method lerp].
+ [codeblock]
+ var middle = lerp(20, 30, 0.75)
+ # `middle` is now 27.5.
+ # Now, we pretend to have forgotten the original ratio and want to get it back.
+ var ratio = inverse_lerp(20, 30, 27.5)
+ # `ratio` is now 0.75.
+ [/codeblock]
+ </description>
+ </method>
+ <method name="is_equal_approx">
+ <return type="bool">
+ </return>
+ <argument index="0" name="a" type="float">
+ </argument>
+ <argument index="1" name="b" type="float">
+ </argument>
+ <description>
+ Returns [code]true[/code] if [code]a[/code] and [code]b[/code] are approximately equal to each other.
+ Here, approximately equal means that [code]a[/code] and [code]b[/code] are within a small internal epsilon of each other, which scales with the magnitude of the numbers.
+ Infinity values of the same sign are considered equal.
+ </description>
+ </method>
+ <method name="is_inf">
+ <return type="bool">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns whether [code]x[/code] is an infinity value (either positive infinity or negative infinity).
+ </description>
+ </method>
+ <method name="is_instance_id_valid">
+ <return type="bool">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_instance_valid">
+ <return type="bool">
+ </return>
+ <argument index="0" name="instance" type="Variant">
+ </argument>
+ <description>
+ Returns whether [code]instance[/code] is a valid object (e.g. has not been deleted from memory).
+ </description>
+ </method>
+ <method name="is_nan">
+ <return type="bool">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns whether [code]x[/code] is a NaN ("Not a Number" or invalid) value.
+ </description>
+ </method>
+ <method name="is_zero_approx">
+ <return type="bool">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns [code]true[/code] if [code]x[/code] is zero or almost zero.
+ This method is faster than using [method is_equal_approx] with one value as zero.
+ </description>
+ </method>
+ <method name="lerp">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="weight" type="float">
+ </argument>
+ <description>
+ Linearly interpolates between two values by a normalized value. This is the opposite of [method inverse_lerp].
+ [codeblock]
+ lerp(0, 4, 0.75) # Returns 3.0
+ [/codeblock]
+ </description>
+ </method>
+ <method name="lerp_angle">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="weight" type="float">
+ </argument>
+ <description>
+ Linearly interpolates between two angles (in radians) by a normalized value.
+ Similar to [method lerp], but interpolates correctly when the angles wrap around [constant @GDScript.TAU].
+ [codeblock]
+ extends Sprite
+ var elapsed = 0.0
+ func _process(delta):
+ var min_angle = deg2rad(0.0)
+ var max_angle = deg2rad(90.0)
+ rotation = lerp_angle(min_angle, max_angle, elapsed)
+ elapsed += delta
+ [/codeblock]
+ </description>
+ </method>
+ <method name="linear2db">
+ <return type="float">
+ </return>
+ <argument index="0" name="lin" type="float">
+ </argument>
+ <description>
+ Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear). Example:
+ [codeblock]
+ # "Slider" refers to a node that inherits Range such as HSlider or VSlider.
+ # Its range must be configured to go from 0 to 1.
+ # Change the bus name if you'd like to change the volume of a specific bus only.
+ AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), linear2db($Slider.value))
+ [/codeblock]
+ </description>
+ </method>
+ <method name="log">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Natural logarithm. The amount of time needed to reach a certain level of continuous growth.
+ [b]Note:[/b] This is not the same as the "log" function on most calculators, which uses a base 10 logarithm.
+ [codeblock]
+ log(10) # Returns 2.302585
+ [/codeblock]
+ [b]Note:[/b] The logarithm of [code]0[/code] returns [code]-inf[/code], while negative values return [code]-nan[/code].
+ </description>
+ </method>
+ <method name="max" qualifiers="vararg">
+ <return type="Variant">
+ </return>
+ <description>
+ Returns the maximum of the given values. This method can take any number of arguments.
+ [codeblock]
+ max(1, 7, 3, -6, 5) # Returns 7
+ [/codeblock]
+ </description>
+ </method>
+ <method name="maxf">
+ <return type="float">
+ </return>
+ <argument index="0" name="a" type="float">
+ </argument>
+ <argument index="1" name="b" type="float">
+ </argument>
+ <description>
+ Returns the maximum of two float values.
+ [codeblock]
+ maxf(3.6, 24) # Returns 24.0
+ maxf(-3.99, -4) # Returns -3.99
+ [/codeblock]
+ </description>
+ </method>
+ <method name="maxi">
+ <return type="int">
+ </return>
+ <argument index="0" name="a" type="int">
+ </argument>
+ <argument index="1" name="b" type="int">
+ </argument>
+ <description>
+ Returns the maximum of two int values.
+ [codeblock]
+ maxi(1, 2) # Returns 2
+ maxi(-3, -4) # Returns -3
+ [/codeblock]
+ </description>
+ </method>
+ <method name="min" qualifiers="vararg">
+ <return type="Variant">
+ </return>
+ <description>
+ Returns the minimum of the given values. This method can take any number of arguments.
+ [codeblock]
+ min(1, 7, 3, -6, 5) # Returns -6
+ [/codeblock]
+ </description>
+ </method>
+ <method name="minf">
+ <return type="float">
+ </return>
+ <argument index="0" name="a" type="float">
+ </argument>
+ <argument index="1" name="b" type="float">
+ </argument>
+ <description>
+ Returns the minimum of two float values.
+ [codeblock]
+ minf(3.6, 24) # Returns 3.6
+ minf(-3.99, -4) # Returns -4.0
+ [/codeblock]
+ </description>
+ </method>
+ <method name="mini">
+ <return type="int">
+ </return>
+ <argument index="0" name="a" type="int">
+ </argument>
+ <argument index="1" name="b" type="int">
+ </argument>
+ <description>
+ Returns the minimum of two int values.
+ [codeblock]
+ mini(1, 2) # Returns 1
+ mini(-3, -4) # Returns -4
+ [/codeblock]
+ </description>
+ </method>
+ <method name="move_toward">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="delta" type="float">
+ </argument>
+ <description>
+ Moves [code]from[/code] toward [code]to[/code] by the [code]delta[/code] value.
+ Use a negative [code]delta[/code] value to move away.
+ [codeblock]
+ move_toward(5, 10, 4) # Returns 9
+ move_toward(10, 5, 4) # Returns 6
+ move_toward(10, 5, -1.5) # Returns 11.5
+ [/codeblock]
+ </description>
+ </method>
+ <method name="nearest_po2">
+ <return type="int">
+ </return>
+ <argument index="0" name="value" type="int">
+ </argument>
+ <description>
+ Returns the nearest equal or larger power of 2 for integer [code]value[/code].
+ In other words, returns the smallest value [code]a[/code] where [code]a = pow(2, n)[/code] such that [code]value &lt;= a[/code] for some non-negative integer [code]n[/code].
+ [codeblock]
+ nearest_po2(3) # Returns 4
+ nearest_po2(4) # Returns 4
+ nearest_po2(5) # Returns 8
+
+ nearest_po2(0) # Returns 0 (this may not be what you expect)
+ nearest_po2(-1) # Returns 0 (this may not be what you expect)
+ [/codeblock]
+ [b]WARNING:[/b] Due to the way it is implemented, this function returns [code]0[/code] rather than [code]1[/code] for non-positive values of [code]value[/code] (in reality, 1 is the smallest integer power of 2).
+ </description>
+ </method>
+ <method name="polar2cartesian">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="r" type="float">
+ </argument>
+ <argument index="1" name="th" type="float">
+ </argument>
+ <description>
+ Converts a 2D point expressed in the polar coordinate system (a distance from the origin [code]r[/code] and an angle [code]th[/code]) to the cartesian coordinate system (X and Y axis).
+ </description>
+ </method>
+ <method name="pow">
+ <return type="float">
+ </return>
+ <argument index="0" name="base" type="float">
+ </argument>
+ <argument index="1" name="exp" type="float">
+ </argument>
+ <description>
+ Returns the result of [code]base[/code] raised to the power of [code]exp[/code].
+ [codeblock]
+ pow(2, 5) # Returns 32
+ [/codeblock]
+ </description>
+ </method>
+ <method name="print" qualifiers="vararg">
+ <description>
+ Converts one or more arguments to strings in the best way possible and prints them to the console.
+ [codeblock]
+ a = [1, 2, 3]
+ print("a", "b", a) # Prints ab[1, 2, 3]
+ [/codeblock]
+ [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed.
+ </description>
+ </method>
+ <method name="printerr" qualifiers="vararg">
+ <description>
+ Prints one or more arguments to strings in the best way possible to standard error line.
+ [codeblock]
+ printerr("prints to stderr")
+ [/codeblock]
+ </description>
+ </method>
+ <method name="printraw" qualifiers="vararg">
+ <description>
+ Prints one or more arguments to strings in the best way possible to console. No newline is added at the end.
+ [codeblock]
+ printraw("A")
+ printraw("B")
+ # Prints AB
+ [/codeblock]
+ [b]Note:[/b] Due to limitations with Godot's built-in console, this only prints to the terminal. If you need to print in the editor, use another method, such as [method print].
+ </description>
+ </method>
+ <method name="prints" qualifiers="vararg">
+ <description>
+ Prints one or more arguments to the console with a space between each argument.
+ [codeblock]
+ prints("A", "B", "C") # Prints A B C
+ [/codeblock]
+ </description>
+ </method>
+ <method name="printt" qualifiers="vararg">
+ <description>
+ Prints one or more arguments to the console with a tab between each argument.
+ [codeblock]
+ printt("A", "B", "C") # Prints A B C
+ [/codeblock]
+ </description>
+ </method>
+ <method name="push_error" qualifiers="vararg">
+ <description>
+ Pushes an error message to Godot's built-in debugger and to the OS terminal.
+ [codeblock]
+ push_error("test error") # Prints "test error" to debugger and terminal as error call
+ [/codeblock]
+ [b]Note:[/b] Errors printed this way will not pause project execution. To print an error message and pause project execution in debug builds, use [code]assert(false, "test error")[/code] instead.
+ </description>
+ </method>
+ <method name="push_warning" qualifiers="vararg">
+ <description>
+ Pushes a warning message to Godot's built-in debugger and to the OS terminal.
+ [codeblock]
+ push_warning("test warning") # Prints "test warning" to debugger and terminal as warning call
+ [/codeblock]
+ </description>
+ </method>
+ <method name="rad2deg">
+ <return type="float">
+ </return>
+ <argument index="0" name="rad" type="float">
+ </argument>
+ <description>
+ Converts an angle expressed in radians to degrees.
+ [codeblock]
+ rad2deg(0.523599) # Returns 30
+ [/codeblock]
+ </description>
+ </method>
+ <method name="rand_from_seed">
+ <return type="PackedInt64Array">
+ </return>
+ <argument index="0" name="seed" type="int">
+ </argument>
+ <description>
+ Random from seed: pass a [code]seed[/code], and an array with both number and new seed is returned. "Seed" here refers to the internal state of the pseudo random number generator. The internal state of the current implementation is 64 bits.
+ </description>
+ </method>
+ <method name="randf">
+ <return type="float">
+ </return>
+ <description>
+ Returns a random floating point value on the interval [code][0, 1][/code].
+ [codeblock]
+ randf() # Returns e.g. 0.375671
+ [/codeblock]
+ </description>
+ </method>
+ <method name="randf_range">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <description>
+ Random range, any floating point value between [code]from[/code] and [code]to[/code].
+ [codeblock]
+ prints(randf_range(-10, 10), randf_range(-10, 10)) # Prints e.g. -3.844535 7.45315
+ [/codeblock]
+ </description>
+ </method>
+ <method name="randi">
+ <return type="int">
+ </return>
+ <description>
+ Returns a random unsigned 32 bit integer. Use remainder to obtain a random value in the interval [code][0, N - 1][/code] (where N is smaller than 2^32).
+ [codeblock]
+ randi() # Returns random integer between 0 and 2^32 - 1
+ randi() % 20 # Returns random integer between 0 and 19
+ randi() % 100 # Returns random integer between 0 and 99
+ randi() % 100 + 1 # Returns random integer between 1 and 100
+ [/codeblock]
+ </description>
+ </method>
+ <method name="randi_range">
+ <return type="int">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ Random range, any 32-bit integer value between [code]from[/code] and [code]to[/code] (inclusive). If [code]to[/code] is lesser than [code]from[/code] they are swapped.
+ [codeblock]
+ print(randi_range(0, 1)) # Prints 0 or 1
+ print(randi_range(-10, 1000)) # Prints any number from -10 to 1000
+ [/codeblock]
+ </description>
+ </method>
+ <method name="randomize">
+ <description>
+ Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time.
+ [codeblock]
+ func _ready():
+ randomize()
+ [/codeblock]
+ </description>
+ </method>
+ <method name="range_lerp">
+ <return type="float">
+ </return>
+ <argument index="0" name="value" type="float">
+ </argument>
+ <argument index="1" name="istart" type="float">
+ </argument>
+ <argument index="2" name="istop" type="float">
+ </argument>
+ <argument index="3" name="ostart" type="float">
+ </argument>
+ <argument index="4" name="ostop" type="float">
+ </argument>
+ <description>
+ Maps a [code]value[/code] from range [code][istart, istop][/code] to [code][ostart, ostop][/code].
+ [codeblock]
+ range_lerp(75, 0, 100, -1, 1) # Returns 0.5
+ [/codeblock]
+ </description>
+ </method>
+ <method name="range_step_decimals">
+ <return type="int">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="round">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Rounds [code]x[/code] to the nearest whole number, with halfway cases rounded away from zero.
+ [codeblock]
+ round(2.6) # Returns 3
+ [/codeblock]
+ See also [method floor], [method ceil], and [method stepify].
+ </description>
+ </method>
+ <method name="seed">
+ <argument index="0" name="base" type="int">
+ </argument>
+ <description>
+ Sets seed for the random number generator.
+ [codeblock]
+ my_seed = "Godot Rocks"
+ seed(my_seed.hash())
+ [/codeblock]
+ </description>
+ </method>
+ <method name="sign">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="x" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="signf">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the sign of [code]x[/code] as a float: -1.0 or 1.0. Returns 0.0 if [code]x[/code] is 0.
+ [codeblock]
+ sign(-6.0) # Returns -1.0
+ sign(0.0) # Returns 0.0
+ sign(6.0) # Returns 1.0
+ [/codeblock]
+ </description>
+ </method>
+ <method name="signi">
+ <return type="int">
+ </return>
+ <argument index="0" name="x" type="int">
+ </argument>
+ <description>
+ Returns the sign of [code]x[/code] as an integer: -1 or 1. Returns 0 if [code]x[/code] is 0.
+ [codeblock]
+ sign(-6) # Returns -1
+ sign(0) # Returns 0
+ sign(6) # Returns 1
+ [/codeblock]
+ </description>
+ </method>
+ <method name="sin">
+ <return type="float">
+ </return>
+ <argument index="0" name="angle_rad" type="float">
+ </argument>
+ <description>
+ Returns the sine of angle [code]angle_rad[/code] in radians.
+ [codeblock]
+ sin(0.523599) # Returns 0.5
+ [/codeblock]
+ </description>
+ </method>
+ <method name="sinh">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the hyperbolic sine of [code]x[/code].
+ [codeblock]
+ a = log(2.0) # Returns 0.693147
+ sinh(a) # Returns 0.75
+ [/codeblock]
+ </description>
+ </method>
+ <method name="smoothstep">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="x" type="float">
+ </argument>
+ <description>
+ Returns the result of smoothly interpolating the value of [code]x[/code] between [code]0[/code] and [code]1[/code], based on the where [code]x[/code] lies with respect to the edges [code]from[/code] and [code]to[/code].
+ The return value is [code]0[/code] if [code]x &lt;= from[/code], and [code]1[/code] if [code]x &gt;= to[/code]. If [code]x[/code] lies between [code]from[/code] and [code]to[/code], the returned value follows an S-shaped curve that maps [code]x[/code] between [code]0[/code] and [code]1[/code].
+ This S-shaped curve is the cubic Hermite interpolator, given by [code]f(x) = 3*x^2 - 2*x^3[/code].
+ [codeblock]
+ smoothstep(0, 2, -5.0) # Returns 0.0
+ smoothstep(0, 2, 0.5) # Returns 0.15625
+ smoothstep(0, 2, 1.0) # Returns 0.5
+ smoothstep(0, 2, 2.0) # Returns 1.0
+ [/codeblock]
+ </description>
+ </method>
+ <method name="sqrt">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the square root of [code]x[/code], where [code]x[/code] is a non-negative number.
+ [codeblock]
+ sqrt(9) # Returns 3
+ [/codeblock]
+ [b]Note:[/b]Negative values of [code]x[/code] return NaN. If you need negative inputs, use [code]System.Numerics.Complex[/code] in C#.
+ </description>
+ </method>
+ <method name="step_decimals">
+ <return type="int">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation.
+ [codeblock]
+ # n is 0
+ n = step_decimals(5)
+ # n is 4
+ n = step_decimals(1.0005)
+ # n is 9
+ n = step_decimals(0.000000005)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="stepify">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="step" type="float">
+ </argument>
+ <description>
+ Snaps float value [code]x[/code] to a given [code]step[/code]. This can also be used to round a floating point number to an arbitrary number of decimals.
+ [codeblock]
+ stepify(100, 32) # Returns 96
+ stepify(3.14159, 0.01) # Returns 3.14
+ [/codeblock]
+ See also [method ceil], [method floor], and [method round].
+ </description>
+ </method>
+ <method name="str" qualifiers="vararg">
+ <return type="String">
+ </return>
+ <description>
+ Converts one or more arguments to string in the best way possible.
+ </description>
+ </method>
+ <method name="str2var">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="string" type="String">
+ </argument>
+ <description>
+ Converts a formatted string that was returned by [method var2str] to the original value.
+ [codeblock]
+ a = '{ "a": 1, "b": 2 }'
+ b = str2var(a)
+ print(b["a"]) # Prints 1
+ [/codeblock]
+ </description>
+ </method>
+ <method name="tan">
+ <return type="float">
+ </return>
+ <argument index="0" name="angle_rad" type="float">
+ </argument>
+ <description>
+ Returns the tangent of angle [code]angle_rad[/code] in radians.
+ [codeblock]
+ tan(deg2rad(45)) # Returns 1
+ [/codeblock]
+ </description>
+ </method>
+ <method name="tanh">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the hyperbolic tangent of [code]x[/code].
+ [codeblock]
+ a = log(2.0) # Returns 0.693147
+ tanh(a) # Returns 0.6
+ [/codeblock]
+ </description>
+ </method>
+ <method name="typeof">
+ <return type="int">
+ </return>
+ <argument index="0" name="variable" type="Variant">
+ </argument>
+ <description>
+ Returns the internal type of the given Variant object, using the [enum Variant.Type] values.
+ [codeblock]
+ p = parse_json('["a", "b", "c"]')
+ if typeof(p) == TYPE_ARRAY:
+ print(p[0]) # Prints a
+ else:
+ print("unexpected results")
+ [/codeblock]
+ </description>
+ </method>
+ <method name="var2bytes">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="variable" type="Variant">
+ </argument>
+ <description>
+ Encodes a [Variant] value to a byte array, without encoding objects. Deserialization can be done with [method bytes2var].
+ [b]Note:[/b] If you need object serialization, see [method var2bytes_with_objects].
+ </description>
+ </method>
+ <method name="var2bytes_with_objects">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="variable" type="Variant">
+ </argument>
+ <description>
+ Encodes a [Variant] value to a byte array. Encoding objects is allowed (and can potentially include code). Deserialization can be done with [method bytes2var_with_objects].
+ </description>
+ </method>
+ <method name="var2str">
+ <return type="String">
+ </return>
+ <argument index="0" name="variable" type="Variant">
+ </argument>
+ <description>
+ Converts a Variant [code]variable[/code] to a formatted string that can later be parsed using [method str2var].
+ [codeblock]
+ a = { "a": 1, "b": 2 }
+ print(var2str(a))
+ [/codeblock]
+ prints
+ [codeblock]
+ {
+ "a": 1,
+ "b": 2
+ }
+ [/codeblock]
+ </description>
+ </method>
+ <method name="weakref">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="obj" type="Variant">
+ </argument>
+ <description>
+ Returns a weak reference to an object, or [code]null[/code] is the argument is invalid.
+ A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else. However, until the object is actually destroyed the weak reference may return the object even if there are no strong references to it.
+ </description>
+ </method>
+ <method name="wrapf">
+ <return type="float">
+ </return>
+ <argument index="0" name="value" type="float">
+ </argument>
+ <argument index="1" name="min" type="float">
+ </argument>
+ <argument index="2" name="max" type="float">
+ </argument>
+ <description>
+ Wraps float [code]value[/code] between [code]min[/code] and [code]max[/code].
+ Usable for creating loop-alike behavior or infinite surfaces.
+ [codeblock]
+ # Infinite loop between 5.0 and 9.9
+ value = wrapf(value + 0.1, 5.0, 10.0)
+ [/codeblock]
+ [codeblock]
+ # Infinite rotation (in radians)
+ angle = wrapf(angle + 0.1, 0.0, TAU)
+ [/codeblock]
+ [codeblock]
+ # Infinite rotation (in radians)
+ angle = wrapf(angle + 0.1, -PI, PI)
+ [/codeblock]
+ [b]Note:[/b] If [code]min[/code] is [code]0[/code], this is equivalent to [method fposmod], so prefer using that instead.
+ [code]wrapf[/code] is more flexible than using the [method fposmod] approach by giving the user control over the minimum value.
+ </description>
+ </method>
+ <method name="wrapi">
+ <return type="int">
+ </return>
+ <argument index="0" name="value" type="int">
+ </argument>
+ <argument index="1" name="min" type="int">
+ </argument>
+ <argument index="2" name="max" type="int">
+ </argument>
+ <description>
+ Wraps integer [code]value[/code] between [code]min[/code] and [code]max[/code].
+ Usable for creating loop-alike behavior or infinite surfaces.
+ [codeblock]
+ # Infinite loop between 5 and 9
+ frame = wrapi(frame + 1, 5, 10)
+ [/codeblock]
+ [codeblock]
+ # result is -2
+ var result = wrapi(-6, -5, -1)
+ [/codeblock]
+ </description>
+ </method>
</methods>
<members>
<member name="AudioServer" type="AudioServer" setter="" getter="">
@@ -27,14 +1168,23 @@
<member name="Engine" type="Engine" setter="" getter="">
The [Engine] singleton.
</member>
- <member name="Geometry" type="Geometry" setter="" getter="">
- The [Geometry] singleton.
+ <member name="EngineDebugger" type="EngineDebugger" setter="" getter="">
+ The [EngineDebugger] singleton.
+ </member>
+ <member name="Geometry2D" type="Geometry2D" setter="" getter="">
+ The [Geometry2D] singleton.
+ </member>
+ <member name="Geometry3D" type="Geometry3D" setter="" getter="">
+ The [Geometry3D] singleton.
+ </member>
+ <member name="GodotSharp" type="GodotSharp" setter="" getter="">
+ The [GodotSharp] singleton.
</member>
<member name="IP" type="IP" setter="" getter="">
The [IP] singleton.
</member>
- <member name="Input" type="InputFilter" setter="" getter="">
- The [InputFilter] singleton.
+ <member name="Input" type="Input" setter="" getter="">
+ The [Input] singleton.
</member>
<member name="InputMap" type="InputMap" setter="" getter="">
The [InputMap] singleton.
@@ -155,7 +1305,7 @@
Tab key.
</constant>
<constant name="KEY_BACKTAB" value="16777219" enum="KeyList">
- Shift+Tab key.
+ Shift + Tab key.
</constant>
<constant name="KEY_BACKSPACE" value="16777220" enum="KeyList">
Backspace key.
@@ -347,16 +1497,16 @@
Right Direction key.
</constant>
<constant name="KEY_BACK" value="16777280" enum="KeyList">
- Back key.
+ Media back key. Not to be confused with the Back button on an Android device.
</constant>
<constant name="KEY_FORWARD" value="16777281" enum="KeyList">
- Forward key.
+ Media forward key.
</constant>
<constant name="KEY_STOP" value="16777282" enum="KeyList">
- Stop key.
+ Media stop key.
</constant>
<constant name="KEY_REFRESH" value="16777283" enum="KeyList">
- Refresh key.
+ Media refresh key.
</constant>
<constant name="KEY_VOLUMEDOWN" value="16777284" enum="KeyList">
Volume down key.
@@ -892,7 +2042,7 @@
<constant name="KEY_MASK_CTRL" value="268435456" enum="KeyModifierMask">
Ctrl key mask.
</constant>
- <constant name="KEY_MASK_CMD" value="268435456" enum="KeyModifierMask">
+ <constant name="KEY_MASK_CMD" value="platform-dependent" enum="KeyModifierMask">
Command key mask. On macOS, this is equivalent to [constant KEY_MASK_META]. On other platforms, this is equivalent to [constant KEY_MASK_CTRL]. This mask should be preferred to [constant KEY_MASK_META] or [constant KEY_MASK_CTRL] for system shortcuts as it handles all platforms correctly.
</constant>
<constant name="KEY_MASK_KPAD" value="536870912" enum="KeyModifierMask">
@@ -943,212 +2093,185 @@
<constant name="BUTTON_MASK_XBUTTON2" value="256" enum="ButtonList">
Extra mouse button 2 mask.
</constant>
- <constant name="JOY_BUTTON_0" value="0" enum="JoystickList">
- Gamepad button 0.
- </constant>
- <constant name="JOY_BUTTON_1" value="1" enum="JoystickList">
- Gamepad button 1.
- </constant>
- <constant name="JOY_BUTTON_2" value="2" enum="JoystickList">
- Gamepad button 2.
- </constant>
- <constant name="JOY_BUTTON_3" value="3" enum="JoystickList">
- Gamepad button 3.
+ <constant name="JOY_INVALID_BUTTON" value="-1" enum="JoyButtonList">
+ An invalid game controller button.
</constant>
- <constant name="JOY_BUTTON_4" value="4" enum="JoystickList">
- Gamepad button 4.
+ <constant name="JOY_BUTTON_A" value="0" enum="JoyButtonList">
+ Game controller SDL button A.
</constant>
- <constant name="JOY_BUTTON_5" value="5" enum="JoystickList">
- Gamepad button 5.
+ <constant name="JOY_BUTTON_B" value="1" enum="JoyButtonList">
+ Game controller SDL button B.
</constant>
- <constant name="JOY_BUTTON_6" value="6" enum="JoystickList">
- Gamepad button 6.
+ <constant name="JOY_BUTTON_X" value="2" enum="JoyButtonList">
+ Game controller SDL button X.
</constant>
- <constant name="JOY_BUTTON_7" value="7" enum="JoystickList">
- Gamepad button 7.
+ <constant name="JOY_BUTTON_Y" value="3" enum="JoyButtonList">
+ Game controller SDL button Y.
</constant>
- <constant name="JOY_BUTTON_8" value="8" enum="JoystickList">
- Gamepad button 8.
+ <constant name="JOY_BUTTON_BACK" value="4" enum="JoyButtonList">
+ Game controller SDL back button.
</constant>
- <constant name="JOY_BUTTON_9" value="9" enum="JoystickList">
- Gamepad button 9.
+ <constant name="JOY_BUTTON_GUIDE" value="5" enum="JoyButtonList">
+ Game controller SDL guide button.
</constant>
- <constant name="JOY_BUTTON_10" value="10" enum="JoystickList">
- Gamepad button 10.
+ <constant name="JOY_BUTTON_START" value="6" enum="JoyButtonList">
+ Game controller SDL start button.
</constant>
- <constant name="JOY_BUTTON_11" value="11" enum="JoystickList">
- Gamepad button 11.
+ <constant name="JOY_BUTTON_LEFT_STICK" value="7" enum="JoyButtonList">
+ Game controller SDL left stick button.
</constant>
- <constant name="JOY_BUTTON_12" value="12" enum="JoystickList">
- Gamepad button 12.
+ <constant name="JOY_BUTTON_RIGHT_STICK" value="8" enum="JoyButtonList">
+ Game controller SDL right stick button.
</constant>
- <constant name="JOY_BUTTON_13" value="13" enum="JoystickList">
- Gamepad button 13.
+ <constant name="JOY_BUTTON_LEFT_SHOULDER" value="9" enum="JoyButtonList">
+ Game controller SDL left shoulder button.
</constant>
- <constant name="JOY_BUTTON_14" value="14" enum="JoystickList">
- Gamepad button 14.
+ <constant name="JOY_BUTTON_RIGHT_SHOULDER" value="10" enum="JoyButtonList">
+ Game controller SDL right shoulder button.
</constant>
- <constant name="JOY_BUTTON_15" value="15" enum="JoystickList">
- Gamepad button 15.
+ <constant name="JOY_BUTTON_DPAD_UP" value="11" enum="JoyButtonList">
+ Game controller SDL D-pad up button.
</constant>
- <constant name="JOY_BUTTON_MAX" value="16" enum="JoystickList">
- Represents the maximum number of joystick buttons supported.
+ <constant name="JOY_BUTTON_DPAD_DOWN" value="12" enum="JoyButtonList">
+ Game controller SDL D-pad down button.
</constant>
- <constant name="JOY_SONY_CIRCLE" value="1" enum="JoystickList">
- DualShock circle button.
+ <constant name="JOY_BUTTON_DPAD_LEFT" value="13" enum="JoyButtonList">
+ Game controller SDL D-pad left button.
</constant>
- <constant name="JOY_SONY_X" value="0" enum="JoystickList">
- DualShock X button.
+ <constant name="JOY_BUTTON_DPAD_RIGHT" value="14" enum="JoyButtonList">
+ Game controller SDL D-pad right button.
</constant>
- <constant name="JOY_SONY_SQUARE" value="2" enum="JoystickList">
- DualShock square button.
+ <constant name="JOY_SDL_BUTTONS" value="15" enum="JoyButtonList">
+ The number of SDL game controller buttons.
</constant>
- <constant name="JOY_SONY_TRIANGLE" value="3" enum="JoystickList">
- DualShock triangle button.
+ <constant name="JOY_SONY_X" value="0" enum="JoyButtonList">
+ Sony DualShock controller X button maps to SDL button A.
</constant>
- <constant name="JOY_XBOX_B" value="1" enum="JoystickList">
- Xbox controller B button.
+ <constant name="JOY_SONY_CROSS" value="0" enum="JoyButtonList">
+ Sony DualShock controller cross button maps to SDL button A.
</constant>
- <constant name="JOY_XBOX_A" value="0" enum="JoystickList">
- Xbox controller A button.
+ <constant name="JOY_SONY_CIRCLE" value="1" enum="JoyButtonList">
+ Sony DualShock controller circle button maps to SDL button B.
</constant>
- <constant name="JOY_XBOX_X" value="2" enum="JoystickList">
- Xbox controller X button.
+ <constant name="JOY_SONY_SQUARE" value="2" enum="JoyButtonList">
+ Sony DualShock controller square button maps to SDL button X.
</constant>
- <constant name="JOY_XBOX_Y" value="3" enum="JoystickList">
- Xbox controller Y button.
+ <constant name="JOY_SONY_TRIANGLE" value="3" enum="JoyButtonList">
+ Sony DualShock controller triangle button maps to SDL button Y.
</constant>
- <constant name="JOY_DS_A" value="1" enum="JoystickList">
- Nintendo controller A button.
+ <constant name="JOY_SONY_SELECT" value="4" enum="JoyButtonList">
+ Sony DualShock controller select button maps to SDL back button.
</constant>
- <constant name="JOY_DS_B" value="0" enum="JoystickList">
- Nintendo controller B button.
+ <constant name="JOY_SONY_START" value="6" enum="JoyButtonList">
+ Sony DualShock controller start button maps to SDL start button.
</constant>
- <constant name="JOY_DS_X" value="3" enum="JoystickList">
- Nintendo controller X button.
+ <constant name="JOY_SONY_PS" value="5" enum="JoyButtonList">
+ Sony DualShock controller PS button maps to SDL guide button.
</constant>
- <constant name="JOY_DS_Y" value="2" enum="JoystickList">
- Nintendo controller Y button.
+ <constant name="JOY_SONY_L1" value="9" enum="JoyButtonList">
+ Sony DualShock controller L1 button maps to SDL left shoulder button.
</constant>
- <constant name="JOY_VR_GRIP" value="2" enum="JoystickList">
- Grip (side) buttons on a VR controller.
+ <constant name="JOY_SONY_R1" value="10" enum="JoyButtonList">
+ Sony DualShock controller R1 button maps to SDL right shoulder button.
</constant>
- <constant name="JOY_VR_PAD" value="14" enum="JoystickList">
- Push down on the touchpad or main joystick on a VR controller.
+ <constant name="JOY_SONY_L3" value="7" enum="JoyButtonList">
+ Sony DualShock controller L3 button maps to SDL left stick button.
</constant>
- <constant name="JOY_VR_TRIGGER" value="15" enum="JoystickList">
- Trigger on a VR controller.
+ <constant name="JOY_SONY_R3" value="8" enum="JoyButtonList">
+ Sony DualShock controller R3 button maps to SDL right stick button.
</constant>
- <constant name="JOY_OCULUS_AX" value="7" enum="JoystickList">
- A button on the right Oculus Touch controller, X button on the left controller (also when used in OpenVR).
+ <constant name="JOY_XBOX_A" value="0" enum="JoyButtonList">
+ Xbox game controller A button maps to SDL button A.
</constant>
- <constant name="JOY_OCULUS_BY" value="1" enum="JoystickList">
- B button on the right Oculus Touch controller, Y button on the left controller (also when used in OpenVR).
+ <constant name="JOY_XBOX_B" value="1" enum="JoyButtonList">
+ Xbox game controller B button maps to SDL button B.
</constant>
- <constant name="JOY_OCULUS_MENU" value="3" enum="JoystickList">
- Menu button on either Oculus Touch controller.
+ <constant name="JOY_XBOX_X" value="2" enum="JoyButtonList">
+ Xbox game controller X button maps to SDL button X.
</constant>
- <constant name="JOY_OPENVR_MENU" value="1" enum="JoystickList">
- Menu button in OpenVR (Except when Oculus Touch controllers are used).
+ <constant name="JOY_XBOX_Y" value="3" enum="JoyButtonList">
+ Xbox game controller Y button maps to SDL button Y.
</constant>
- <constant name="JOY_SELECT" value="10" enum="JoystickList">
- Gamepad button Select.
+ <constant name="JOY_XBOX_BACK" value="4" enum="JoyButtonList">
+ Xbox game controller back button maps to SDL back button.
</constant>
- <constant name="JOY_START" value="11" enum="JoystickList">
- Gamepad button Start.
+ <constant name="JOY_XBOX_START" value="6" enum="JoyButtonList">
+ Xbox game controller start button maps to SDL start button.
</constant>
- <constant name="JOY_DPAD_UP" value="12" enum="JoystickList">
- Gamepad DPad up.
+ <constant name="JOY_XBOX_HOME" value="5" enum="JoyButtonList">
+ Xbox game controller home button maps to SDL guide button.
</constant>
- <constant name="JOY_DPAD_DOWN" value="13" enum="JoystickList">
- Gamepad DPad down.
+ <constant name="JOY_XBOX_LS" value="7" enum="JoyButtonList">
+ Xbox game controller left stick button maps to SDL left stick button.
</constant>
- <constant name="JOY_DPAD_LEFT" value="14" enum="JoystickList">
- Gamepad DPad left.
+ <constant name="JOY_XBOX_RS" value="8" enum="JoyButtonList">
+ Xbox game controller right stick button maps to SDL right stick button.
</constant>
- <constant name="JOY_DPAD_RIGHT" value="15" enum="JoystickList">
- Gamepad DPad right.
+ <constant name="JOY_XBOX_LB" value="9" enum="JoyButtonList">
+ Xbox game controller left bumper button maps to SDL left shoulder button.
</constant>
- <constant name="JOY_L" value="4" enum="JoystickList">
- Gamepad left Shoulder button.
+ <constant name="JOY_XBOX_RB" value="10" enum="JoyButtonList">
+ Xbox game controller right bumper button maps to SDL right shoulder button.
</constant>
- <constant name="JOY_L2" value="6" enum="JoystickList">
- Gamepad left trigger.
+ <constant name="JOY_BUTTON_MAX" value="36" enum="JoyButtonList">
+ The maximum number of game controller buttons.
</constant>
- <constant name="JOY_L3" value="8" enum="JoystickList">
- Gamepad left stick click.
+ <constant name="JOY_INVALID_AXIS" value="-1" enum="JoyAxisList">
+ An invalid game controller axis.
</constant>
- <constant name="JOY_R" value="5" enum="JoystickList">
- Gamepad right Shoulder button.
+ <constant name="JOY_AXIS_LEFT_X" value="0" enum="JoyAxisList">
+ Game controller left joystick x-axis.
</constant>
- <constant name="JOY_R2" value="7" enum="JoystickList">
- Gamepad right trigger.
+ <constant name="JOY_AXIS_LEFT_Y" value="1" enum="JoyAxisList">
+ Game controller left joystick y-axis.
</constant>
- <constant name="JOY_R3" value="9" enum="JoystickList">
- Gamepad right stick click.
+ <constant name="JOY_AXIS_RIGHT_X" value="2" enum="JoyAxisList">
+ Game controller right joystick x-axis.
</constant>
- <constant name="JOY_AXIS_0" value="0" enum="JoystickList">
- Gamepad left stick horizontal axis.
+ <constant name="JOY_AXIS_RIGHT_Y" value="3" enum="JoyAxisList">
+ Game controller right joystick y-axis.
</constant>
- <constant name="JOY_AXIS_1" value="1" enum="JoystickList">
- Gamepad left stick vertical axis.
+ <constant name="JOY_AXIS_TRIGGER_LEFT" value="4" enum="JoyAxisList">
+ Game controller left trigger axis.
</constant>
- <constant name="JOY_AXIS_2" value="2" enum="JoystickList">
- Gamepad right stick horizontal axis.
+ <constant name="JOY_AXIS_TRIGGER_RIGHT" value="5" enum="JoyAxisList">
+ Game controller right trigger axis.
</constant>
- <constant name="JOY_AXIS_3" value="3" enum="JoystickList">
- Gamepad right stick vertical axis.
+ <constant name="JOY_SDL_AXES" value="6" enum="JoyAxisList">
+ The number of SDL game controller axes.
</constant>
- <constant name="JOY_AXIS_4" value="4" enum="JoystickList">
- Generic gamepad axis 4.
+ <constant name="JOY_AXIS_0_X" value="0" enum="JoyAxisList">
+ Game controller joystick 0 x-axis.
</constant>
- <constant name="JOY_AXIS_5" value="5" enum="JoystickList">
- Generic gamepad axis 5.
+ <constant name="JOY_AXIS_0_Y" value="1" enum="JoyAxisList">
+ Game controller joystick 0 y-axis.
</constant>
- <constant name="JOY_AXIS_6" value="6" enum="JoystickList">
- Gamepad left trigger analog axis.
+ <constant name="JOY_AXIS_1_X" value="2" enum="JoyAxisList">
+ Game controller joystick 1 x-axis.
</constant>
- <constant name="JOY_AXIS_7" value="7" enum="JoystickList">
- Gamepad right trigger analog axis.
+ <constant name="JOY_AXIS_1_Y" value="3" enum="JoyAxisList">
+ Game controller joystick 1 y-axis.
</constant>
- <constant name="JOY_AXIS_8" value="8" enum="JoystickList">
- Generic gamepad axis 8.
+ <constant name="JOY_AXIS_2_X" value="4" enum="JoyAxisList">
+ Game controller joystick 2 x-axis.
</constant>
- <constant name="JOY_AXIS_9" value="9" enum="JoystickList">
- Generic gamepad axis 9.
+ <constant name="JOY_AXIS_2_Y" value="5" enum="JoyAxisList">
+ Game controller joystick 2 y-axis.
</constant>
- <constant name="JOY_AXIS_MAX" value="10" enum="JoystickList">
- Represents the maximum number of joystick axes supported.
+ <constant name="JOY_AXIS_3_X" value="6" enum="JoyAxisList">
+ Game controller joystick 3 x-axis.
</constant>
- <constant name="JOY_ANALOG_LX" value="0" enum="JoystickList">
- Gamepad left stick horizontal axis.
+ <constant name="JOY_AXIS_3_Y" value="7" enum="JoyAxisList">
+ Game controller joystick 3 y-axis.
</constant>
- <constant name="JOY_ANALOG_LY" value="1" enum="JoystickList">
- Gamepad left stick vertical axis.
+ <constant name="JOY_AXIS_4_X" value="8" enum="JoyAxisList">
+ Game controller joystick 4 x-axis.
</constant>
- <constant name="JOY_ANALOG_RX" value="2" enum="JoystickList">
- Gamepad right stick horizontal axis.
+ <constant name="JOY_AXIS_4_Y" value="9" enum="JoyAxisList">
+ Game controller joystick 4 y-axis.
</constant>
- <constant name="JOY_ANALOG_RY" value="3" enum="JoystickList">
- Gamepad right stick vertical axis.
- </constant>
- <constant name="JOY_ANALOG_L2" value="6" enum="JoystickList">
- Gamepad left analog trigger.
- </constant>
- <constant name="JOY_ANALOG_R2" value="7" enum="JoystickList">
- Gamepad right analog trigger.
- </constant>
- <constant name="JOY_VR_ANALOG_TRIGGER" value="2" enum="JoystickList">
- VR Controller analog trigger.
- </constant>
- <constant name="JOY_VR_ANALOG_GRIP" value="4" enum="JoystickList">
- VR Controller analog grip (side buttons).
- </constant>
- <constant name="JOY_OPENVR_TOUCHPADX" value="0" enum="JoystickList">
- OpenVR touchpad X axis (Joystick axis on Oculus Touch and Windows MR controllers).
- </constant>
- <constant name="JOY_OPENVR_TOUCHPADY" value="1" enum="JoystickList">
- OpenVR touchpad Y axis (Joystick axis on Oculus Touch and Windows MR controllers).
+ <constant name="JOY_AXIS_MAX" value="10" enum="JoyAxisList">
+ The maximum number of game controller axes.
</constant>
<constant name="MIDI_MESSAGE_NOTE_OFF" value="8" enum="MidiMessageList">
MIDI note OFF message.
@@ -1177,10 +2300,10 @@
[codeblock]
var err = method_that_returns_error()
if err != OK:
- print("Failure!)
+ print("Failure!")
# Or, equivalent:
if err:
- print("Still failing!)
+ print("Still failing!")
[/codeblock]
</constant>
<constant name="FAILED" value="1" enum="Error">
@@ -1612,43 +2735,40 @@
<constant name="OP_MODULE" value="12" enum="Variant.Operator">
Remainder/modulo operator ([code]%[/code]).
</constant>
- <constant name="OP_STRING_CONCAT" value="13" enum="Variant.Operator">
- String concatenation operator ([code]+[/code]).
- </constant>
- <constant name="OP_SHIFT_LEFT" value="14" enum="Variant.Operator">
+ <constant name="OP_SHIFT_LEFT" value="13" enum="Variant.Operator">
Left shift operator ([code]&lt;&lt;[/code]).
</constant>
- <constant name="OP_SHIFT_RIGHT" value="15" enum="Variant.Operator">
+ <constant name="OP_SHIFT_RIGHT" value="14" enum="Variant.Operator">
Right shift operator ([code]&gt;&gt;[/code]).
</constant>
- <constant name="OP_BIT_AND" value="16" enum="Variant.Operator">
+ <constant name="OP_BIT_AND" value="15" enum="Variant.Operator">
Bitwise AND operator ([code]&amp;[/code]).
</constant>
- <constant name="OP_BIT_OR" value="17" enum="Variant.Operator">
+ <constant name="OP_BIT_OR" value="16" enum="Variant.Operator">
Bitwise OR operator ([code]|[/code]).
</constant>
- <constant name="OP_BIT_XOR" value="18" enum="Variant.Operator">
+ <constant name="OP_BIT_XOR" value="17" enum="Variant.Operator">
Bitwise XOR operator ([code]^[/code]).
</constant>
- <constant name="OP_BIT_NEGATE" value="19" enum="Variant.Operator">
+ <constant name="OP_BIT_NEGATE" value="18" enum="Variant.Operator">
Bitwise NOT operator ([code]~[/code]).
</constant>
- <constant name="OP_AND" value="20" enum="Variant.Operator">
+ <constant name="OP_AND" value="19" enum="Variant.Operator">
Logical AND operator ([code]and[/code] or [code]&amp;&amp;[/code]).
</constant>
- <constant name="OP_OR" value="21" enum="Variant.Operator">
+ <constant name="OP_OR" value="20" enum="Variant.Operator">
Logical OR operator ([code]or[/code] or [code]||[/code]).
</constant>
- <constant name="OP_XOR" value="22" enum="Variant.Operator">
+ <constant name="OP_XOR" value="21" enum="Variant.Operator">
Logical XOR operator (not implemented in GDScript).
</constant>
- <constant name="OP_NOT" value="23" enum="Variant.Operator">
+ <constant name="OP_NOT" value="22" enum="Variant.Operator">
Logical NOT operator ([code]not[/code] or [code]![/code]).
</constant>
- <constant name="OP_IN" value="24" enum="Variant.Operator">
+ <constant name="OP_IN" value="23" enum="Variant.Operator">
Logical IN operator ([code]in[/code]).
</constant>
- <constant name="OP_MAX" value="25" enum="Variant.Operator">
+ <constant name="OP_MAX" value="24" enum="Variant.Operator">
Represents the size of the [enum Variant.Operator] enum.
</constant>
</constants>
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index 3f2f27d121..baea84df65 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -4,13 +4,33 @@
Axis-Aligned Bounding Box.
</brief_description>
<description>
- AABB consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
+ [AABB] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
+ It uses floating-point coordinates. The 2D counterpart to [AABB] is [Rect2].
+ [b]Note:[/b] Unlike [Rect2], [AABB] does not have a variant that uses integer coordinates.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link>
</tutorials>
<methods>
- <method name="AABB">
+ <method name="AABB" qualifiers="constructor">
+ <return type="AABB">
+ </return>
+ <description>
+ Constructs a default-initialized [AABB] with default (zero) values of [member position] and [member size].
+ </description>
+ </method>
+ <method name="AABB" qualifiers="constructor">
+ <return type="AABB">
+ </return>
+ <argument index="0" name="from" type="AABB">
+ </argument>
+ <description>
+ Constructs an [AABB] as a copy of the given [AABB].
+ </description>
+ </method>
+ <method name="AABB" qualifiers="constructor">
<return type="AABB">
</return>
<argument index="0" name="position" type="Vector3">
@@ -18,7 +38,14 @@
<argument index="1" name="size" type="Vector3">
</argument>
<description>
- Optional constructor, accepts position and size.
+ Constructs an [AABB] from a position and size.
+ </description>
+ </method>
+ <method name="abs">
+ <return type="AABB">
+ </return>
+ <description>
+ Returns an AABB with equivalent position and size, modified so that the most-negative corner is the origin and the size is positive.
</description>
</method>
<method name="encloses">
@@ -165,8 +192,18 @@
Returns [code]true[/code] if the [AABB] is on both sides of a plane.
</description>
</method>
+ <method name="intersects_ray">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <argument index="1" name="dir" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="intersects_segment">
- <return type="bool">
+ <return type="Variant">
</return>
<argument index="0" name="from" type="Vector3">
</argument>
@@ -194,16 +231,41 @@
Returns a larger [AABB] that contains both this [AABB] and [code]with[/code].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="AABB">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="AABB">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="AABB">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="end" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
- Ending corner. This is calculated as [code]position + size[/code]. Changing this property changes [member size] accordingly.
+ Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size.
</member>
<member name="position" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
- Beginning corner.
+ Beginning corner. Typically has values lower than [member end].
</member>
<member name="size" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
- Size from position to end.
+ Size from [member position] to [member end]. Typically all components are positive.
+ If the size is negative, you can use [method abs] to fix it.
</member>
</members>
<constants>
diff --git a/doc/classes/AESContext.xml b/doc/classes/AESContext.xml
new file mode 100644
index 0000000000..f577bab992
--- /dev/null
+++ b/doc/classes/AESContext.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="AESContext" inherits="Reference" version="4.0">
+ <brief_description>
+ Interface to low level AES encryption features.
+ </brief_description>
+ <description>
+ This class provides access to AES encryption/decryption of raw data. Both AES-ECB and AES-CBC mode are supported.
+ [codeblocks]
+ [gdscript]
+ extends Node
+
+ var aes = AESContext.new()
+
+ func _ready():
+ var key = "My secret key!!!" # Key must be either 16 or 32 bytes.
+ var data = "My secret text!!" # Data size must be multiple of 16 bytes, apply padding if needed.
+ # Encrypt ECB
+ aes.start(AESContext.MODE_ECB_ENCRYPT, key.to_utf8())
+ var encrypted = aes.update(data.to_utf8())
+ aes.finish()
+ # Decrypt ECB
+ aes.start(AESContext.MODE_ECB_DECRYPT, key.to_utf8())
+ var decrypted = aes.update(encrypted)
+ aes.finish()
+ # Check ECB
+ assert(decrypted == data.to_utf8())
+
+ var iv = "My secret iv!!!!" # IV must be of exactly 16 bytes.
+ # Encrypt CBC
+ aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8(), iv.to_utf8())
+ encrypted = aes.update(data.to_utf8())
+ aes.finish()
+ # Decrypt CBC
+ aes.start(AESContext.MODE_CBC_DECRYPT, key.to_utf8(), iv.to_utf8())
+ decrypted = aes.update(encrypted)
+ aes.finish()
+ # Check CBC
+ assert(decrypted == data.to_utf8())
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+ using System.Diagnostics;
+
+ public class Example : Node
+ {
+ public AESContext Aes = new AESContext();
+ public override void _Ready()
+ {
+ string key = "My secret key!!!"; // Key must be either 16 or 32 bytes.
+ string data = "My secret text!!"; // Data size must be multiple of 16 bytes, apply padding if needed.
+ // Encrypt ECB
+ Aes.Start(AESContext.Mode.EcbEncrypt, key.ToUTF8());
+ byte[] encrypted = Aes.Update(data.ToUTF8());
+ Aes.Finish();
+ // Decrypt ECB
+ Aes.Start(AESContext.Mode.EcbDecrypt, key.ToUTF8());
+ byte[] decrypted = Aes.Update(encrypted);
+ Aes.Finish();
+ // Check ECB
+ Debug.Assert(decrypted == data.ToUTF8());
+
+ string iv = "My secret iv!!!!"; // IV must be of exactly 16 bytes.
+ // Encrypt CBC
+ Aes.Start(AESContext.Mode.EcbEncrypt, key.ToUTF8(), iv.ToUTF8());
+ encrypted = Aes.Update(data.ToUTF8());
+ Aes.Finish();
+ // Decrypt CBC
+ Aes.Start(AESContext.Mode.EcbDecrypt, key.ToUTF8(), iv.ToUTF8());
+ decrypted = Aes.Update(encrypted);
+ Aes.Finish();
+ // Check CBC
+ Debug.Assert(decrypted == data.ToUTF8());
+ }
+ }
+ [/csharp]
+ [/codeblocks]
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="finish">
+ <return type="void">
+ </return>
+ <description>
+ Close this AES context so it can be started again. See [method start].
+ </description>
+ </method>
+ <method name="get_iv_state">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ Get the current IV state for this context (IV gets updated when calling [method update]). You normally don't need this function.
+ Note: This function only makes sense when the context is started with [constant MODE_CBC_ENCRYPT] or [constant MODE_CBC_DECRYPT].
+ </description>
+ </method>
+ <method name="start">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="mode" type="int" enum="AESContext.Mode">
+ </argument>
+ <argument index="1" name="key" type="PackedByteArray">
+ </argument>
+ <argument index="2" name="iv" type="PackedByteArray" default="PackedByteArray( )">
+ </argument>
+ <description>
+ Start the AES context in the given [code]mode[/code]. A [code]key[/code] of either 16 or 32 bytes must always be provided, while an [code]iv[/code] (initialization vector) of exactly 16 bytes, is only needed when [code]mode[/code] is either [constant MODE_CBC_ENCRYPT] or [constant MODE_CBC_DECRYPT].
+ </description>
+ </method>
+ <method name="update">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="src" type="PackedByteArray">
+ </argument>
+ <description>
+ Run the desired operation for this AES context. Will return a [PackedByteArray] containing the result of encrypting (or decrypting) the given [code]src[/code]. See [method start] for mode of operation.
+ Note: The size of [code]src[/code] must be a multiple of 16. Apply some padding if needed.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ <constant name="MODE_ECB_ENCRYPT" value="0" enum="Mode">
+ AES electronic codebook encryption mode.
+ </constant>
+ <constant name="MODE_ECB_DECRYPT" value="1" enum="Mode">
+ AES electronic codebook decryption mode.
+ </constant>
+ <constant name="MODE_CBC_ENCRYPT" value="2" enum="Mode">
+ AES cipher blocker chaining encryption mode.
+ </constant>
+ <constant name="MODE_CBC_DECRYPT" value="3" enum="Mode">
+ AES cipher blocker chaining decryption mode.
+ </constant>
+ <constant name="MODE_MAX" value="4" enum="Mode">
+ Maximum value for the mode enum.
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml
index e930abba87..0cd7d3dc25 100644
--- a/doc/classes/AStar.xml
+++ b/doc/classes/AStar.xml
@@ -7,7 +7,8 @@
A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in three-dimensional space and Euclidean distances by default.
You must add points manually with [method add_point] and create segments manually with [method connect_points]. Then you can test if there is a path between two points with the [method are_points_connected] function, get a path containing indices by [method get_id_path], or one containing actual coordinates with [method get_point_path].
It is also possible to use non-Euclidean distances. To do so, create a class that extends [code]AStar[/code] and override methods [method _compute_cost] and [method _estimate_cost]. Both take two indices and return a length, as is shown in the following example.
- [codeblock]
+ [codeblocks]
+ [gdscript]
class MyAStar:
extends AStar
@@ -16,7 +17,21 @@
func _estimate_cost(u, v):
return min(0, abs(u - v) - 1)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public class MyAStar : AStar
+ {
+ public override float _ComputeCost(int u, int v)
+ {
+ return Mathf.Abs(u - v);
+ }
+ public override float _EstimateCost(int u, int v)
+ {
+ return Mathf.Min(0, Mathf.Abs(u - v) - 1);
+ }
+ }
+ [/csharp]
+ [/codeblocks]
[method _estimate_cost] should return a lower bound of the distance, i.e. [code]_estimate_cost(u, v) &lt;= _compute_cost(u, v)[/code]. This serves as a hint to the algorithm because the custom [code]_compute_cost[/code] might be computation-heavy. If this is not the case, make [method _estimate_cost] return the same value as [method _compute_cost] to provide the algorithm with the most accurate information.
</description>
<tutorials>
@@ -57,10 +72,16 @@
</argument>
<description>
Adds a new point at the given position with the given identifier. The algorithm prefers points with lower [code]weight_scale[/code] to form a path. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar.new()
astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar();
+ astar.AddPoint(1, new Vector3(1, 0, 0), 4); // Adds the point (1, 0, 0) with weight_scale 4 and id 1
+ [/csharp]
+ [/codeblocks]
If there already exists a point for the given [code]id[/code], its position and weight scale are updated to the given values.
</description>
</method>
@@ -95,12 +116,20 @@
</argument>
<description>
Creates a segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is allowed, not the reverse direction.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar.new()
astar.add_point(1, Vector3(1, 1, 0))
astar.add_point(2, Vector3(0, 5, 0))
astar.connect_points(1, 2, false)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar();
+ astar.AddPoint(1, new Vector3(1, 1, 0));
+ astar.AddPoint(2, new Vector3(0, 5, 0));
+ astar.ConnectPoints(1, 2, false);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="disconnect_points">
@@ -131,7 +160,8 @@
<argument index="1" name="include_disabled" type="bool" default="false">
</argument>
<description>
- Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns -1 if there are no points in the points pool.
+ Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns [code]-1[/code] if there are no points in the points pool.
+ [b]Note:[/b] If several points are the closest to [code]to_position[/code], the one with the smallest ID will be returned, ensuring a deterministic result.
</description>
</method>
<method name="get_closest_position_in_segment" qualifiers="const">
@@ -141,13 +171,22 @@
</argument>
<description>
Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar.new()
astar.add_point(1, Vector3(0, 0, 0))
astar.add_point(2, Vector3(0, 5, 0))
astar.connect_points(1, 2)
var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar();
+ astar.AddPoint(1, new Vector3(0, 0, 0));
+ astar.AddPoint(2, new Vector3(0, 5, 0));
+ astar.ConnectPoints(1, 2);
+ Vector3 res = astar.GetClosestPositionInSegment(new Vector3(3, 3, 0)); // Returns (0, 3, 0)
+ [/csharp]
+ [/codeblocks]
The result is in the segment that goes from [code]y = 0[/code] to [code]y = 5[/code]. It's the closest position in the segment to the given point.
</description>
</method>
@@ -160,7 +199,8 @@
</argument>
<description>
Returns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar.new()
astar.add_point(1, Vector3(0, 0, 0))
astar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1
@@ -173,7 +213,20 @@
astar.connect_points(1, 4, false)
var res = astar.get_id_path(1, 3) # Returns [1, 2, 3]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar();
+ astar.AddPoint(1, new Vector3(0, 0, 0));
+ astar.AddPoint(2, new Vector3(0, 1, 0), 1); // Default weight is 1
+ astar.AddPoint(3, new Vector3(1, 1, 0));
+ astar.AddPoint(4, new Vector3(2, 0, 0));
+ astar.ConnectPoints(1, 2, false);
+ astar.ConnectPoints(2, 3, false);
+ astar.ConnectPoints(4, 3, false);
+ astar.ConnectPoints(1, 4, false);
+ int[] res = astar.GetIdPath(1, 3); // Returns [1, 2, 3]
+ [/csharp]
+ [/codeblocks]
If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2.
</description>
</method>
@@ -191,7 +244,8 @@
</argument>
<description>
Returns an array with the IDs of the points that form the connection with the given point.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar.new()
astar.add_point(1, Vector3(0, 0, 0))
astar.add_point(2, Vector3(0, 1, 0))
@@ -202,7 +256,19 @@
astar.connect_points(1, 3, true)
var neighbors = astar.get_point_connections(1) # Returns [2, 3]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar();
+ astar.AddPoint(1, new Vector3(0, 0, 0));
+ astar.AddPoint(2, new Vector3(0, 1, 0));
+ astar.AddPoint(3, new Vector3(1, 1, 0));
+ astar.AddPoint(4, new Vector3(2, 0, 0));
+ astar.ConnectPoints(1, 2, true);
+ astar.ConnectPoints(1, 3, true);
+
+ int[] neighbors = astar.GetPointConnections(1); // Returns [2, 3]
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_point_count" qualifiers="const">
diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml
index 16fa05041e..1540d8dacc 100644
--- a/doc/classes/AStar2D.xml
+++ b/doc/classes/AStar2D.xml
@@ -44,10 +44,16 @@
</argument>
<description>
Adds a new point at the given position with the given identifier. The algorithm prefers points with lower [code]weight_scale[/code] to form a path. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar2D.new()
astar.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar2D();
+ astar.AddPoint(1, new Vector2(1, 0), 4); // Adds the point (1, 0) with weight_scale 4 and id 1
+ [/csharp]
+ [/codeblocks]
If there already exists a point for the given [code]id[/code], its position and weight scale are updated to the given values.
</description>
</method>
@@ -80,12 +86,20 @@
</argument>
<description>
Creates a segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is allowed, not the reverse direction.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar2D.new()
astar.add_point(1, Vector2(1, 1))
astar.add_point(2, Vector2(0, 5))
astar.connect_points(1, 2, false)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar2D();
+ astar.AddPoint(1, new Vector2(1, 1));
+ astar.AddPoint(2, new Vector2(0, 5));
+ astar.ConnectPoints(1, 2, false);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="disconnect_points">
@@ -114,7 +128,8 @@
<argument index="1" name="include_disabled" type="bool" default="false">
</argument>
<description>
- Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns -1 if there are no points in the points pool.
+ Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns [code]-1[/code] if there are no points in the points pool.
+ [b]Note:[/b] If several points are the closest to [code]to_position[/code], the one with the smallest ID will be returned, ensuring a deterministic result.
</description>
</method>
<method name="get_closest_position_in_segment" qualifiers="const">
@@ -124,13 +139,22 @@
</argument>
<description>
Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar2D.new()
astar.add_point(1, Vector2(0, 0))
astar.add_point(2, Vector2(0, 5))
astar.connect_points(1, 2)
var res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar2D();
+ astar.AddPoint(1, new Vector2(0, 0));
+ astar.AddPoint(2, new Vector2(0, 5));
+ astar.ConnectPoints(1, 2);
+ Vector2 res = astar.GetClosestPositionInSegment(new Vector2(3, 3)); // Returns (0, 3)
+ [/csharp]
+ [/codeblocks]
The result is in the segment that goes from [code]y = 0[/code] to [code]y = 5[/code]. It's the closest position in the segment to the given point.
</description>
</method>
@@ -143,7 +167,8 @@
</argument>
<description>
Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar2D.new()
astar.add_point(1, Vector2(0, 0))
astar.add_point(2, Vector2(0, 1), 1) # Default weight is 1
@@ -156,7 +181,21 @@
astar.connect_points(1, 4, false)
var res = astar.get_id_path(1, 3) # Returns [1, 2, 3]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar2D();
+ astar.AddPoint(1, new Vector2(0, 0));
+ astar.AddPoint(2, new Vector2(0, 1), 1); // Default weight is 1
+ astar.AddPoint(3, new Vector2(1, 1));
+ astar.AddPoint(4, new Vector2(2, 0));
+
+ astar.ConnectPoints(1, 2, false);
+ astar.ConnectPoints(2, 3, false);
+ astar.ConnectPoints(4, 3, false);
+ astar.ConnectPoints(1, 4, false);
+ int[] res = astar.GetIdPath(1, 3); // Returns [1, 2, 3]
+ [/csharp]
+ [/codeblocks]
If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2.
</description>
</method>
@@ -174,7 +213,8 @@
</argument>
<description>
Returns an array with the IDs of the points that form the connection with the given point.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar2D.new()
astar.add_point(1, Vector2(0, 0))
astar.add_point(2, Vector2(0, 1))
@@ -185,7 +225,20 @@
astar.connect_points(1, 3, true)
var neighbors = astar.get_point_connections(1) # Returns [2, 3]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar2D();
+ astar.AddPoint(1, new Vector2(0, 0));
+ astar.AddPoint(2, new Vector2(0, 1));
+ astar.AddPoint(3, new Vector2(1, 1));
+ astar.AddPoint(4, new Vector2(2, 0));
+
+ astar.ConnectPoints(1, 2, true);
+ astar.ConnectPoints(1, 3, true);
+
+ int[] neighbors = astar.GetPointConnections(1); // Returns [2, 3]
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_point_count" qualifiers="const">
diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml
index 99b566e74f..e5eb216062 100644
--- a/doc/classes/AcceptDialog.xml
+++ b/doc/classes/AcceptDialog.xml
@@ -67,6 +67,7 @@
<member name="dialog_text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
The text displayed by the dialog.
</member>
+ <member name="exclusive" type="bool" setter="set_exclusive" getter="is_exclusive" override="true" default="true" />
<member name="title" type="String" setter="set_title" getter="get_title" override="true" default="&quot;Alert!&quot;" />
<member name="transient" type="bool" setter="set_transient" getter="is_transient" override="true" default="true" />
<member name="visible" type="bool" setter="set_visible" getter="is_visible" override="true" default="false" />
@@ -75,6 +76,7 @@
<signals>
<signal name="cancelled">
<description>
+ Emitted when the dialog is closed or the button created with [method add_cancel] is pressed.
</description>
</signal>
<signal name="confirmed">
diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml
index 8d0534ccd2..969e9cc85b 100644
--- a/doc/classes/AnimatedSprite2D.xml
+++ b/doc/classes/AnimatedSprite2D.xml
@@ -5,8 +5,11 @@
</brief_description>
<description>
Animations are created using a [SpriteFrames] resource, which can be configured in the editor via the SpriteFrames panel.
+ [b]Note:[/b] You can associate a set of normal or specular maps by creating additional [SpriteFrames] resources with a [code]_normal[/code] or [code]_specular[/code] suffix. For example, having 3 [SpriteFrames] resources [code]run[/code], [code]run_normal[/code], and [code]run_specular[/code] will make it so the [code]run[/code] animation uses normal and specular maps.
</description>
<tutorials>
+ <link title="2D Sprite animation">https://docs.godotengine.org/en/latest/tutorials/2d/2d_sprite_animation.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="is_playing" qualifiers="const">
@@ -60,12 +63,6 @@
<member name="playing" type="bool" setter="_set_playing" getter="_is_playing" default="false">
If [code]true[/code], the [member animation] is currently playing.
</member>
- <member name="shininess" type="float" setter="set_shininess" getter="get_shininess" default="1.0">
- Strength of the specular light effect of this [AnimatedSprite2D].
- </member>
- <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )">
- The color of the specular light effect.
- </member>
<member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0">
The animation speed is multiplied by this value.
</member>
diff --git a/doc/classes/AnimatedSprite3D.xml b/doc/classes/AnimatedSprite3D.xml
index ad9706a52a..e1fb78e5b5 100644
--- a/doc/classes/AnimatedSprite3D.xml
+++ b/doc/classes/AnimatedSprite3D.xml
@@ -7,6 +7,7 @@
Animations are created using a [SpriteFrames] resource, which can be configured in the editor via the SpriteFrames panel.
</description>
<tutorials>
+ <link title="2D Sprite animation (also applies to 3D)">https://docs.godotengine.org/en/latest/tutorials/2d/2d_sprite_animation.html</link>
</tutorials>
<methods>
<method name="is_playing" qualifiers="const">
diff --git a/doc/classes/AnimatedTexture.xml b/doc/classes/AnimatedTexture.xml
index 80b910aaa7..5774842144 100644
--- a/doc/classes/AnimatedTexture.xml
+++ b/doc/classes/AnimatedTexture.xml
@@ -6,7 +6,8 @@
<description>
[AnimatedTexture] is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike [AnimationPlayer] or [AnimatedSprite2D], it isn't a [Node], but has the advantage of being usable anywhere a [Texture2D] resource can be used, e.g. in a [TileSet].
The playback of the animation is controlled by the [member fps] property as well as each frame's optional delay (see [method set_frame_delay]). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame.
- [AnimatedTexture] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one. Also, it doesn't support [AtlasTexture]. Each frame needs to be separate image.
+ [AnimatedTexture] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one.
+ [b]Note:[/b] AnimatedTexture doesn't support using [AtlasTexture]s. Each frame needs to be a separate [Texture2D].
</description>
<tutorials>
</tutorials>
@@ -61,6 +62,9 @@
</method>
</methods>
<members>
+ <member name="current_frame" type="int" setter="set_current_frame" getter="get_current_frame">
+ Sets the currently visible frame of the texture.
+ </member>
<member name="fps" type="float" setter="set_fps" getter="get_fps" default="4.0">
Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the [member frames] property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see [method set_frame_delay]).
For example, an animation with 8 frames, no frame delay and a [code]fps[/code] value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds.
@@ -68,6 +72,12 @@
<member name="frames" type="int" setter="set_frames" getter="get_frames" default="1">
Number of frames to use in the animation. While you can create the frames independently with [method set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [constant MAX_FRAMES].
</member>
+ <member name="oneshot" type="bool" setter="set_oneshot" getter="get_oneshot" default="false">
+ If [code]true[/code], the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set [member pause] to [code]true[/code].
+ </member>
+ <member name="pause" type="bool" setter="set_pause" getter="get_pause" default="false">
+ If [code]true[/code], the animation will pause where it currently is (i.e. at [member current_frame]). The animation will continue from where it was paused when changing this property to [code]false[/code].
+ </member>
</members>
<constants>
<constant name="MAX_FRAMES" value="256">
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml
index 09811d5617..d34308501c 100644
--- a/doc/classes/Animation.xml
+++ b/doc/classes/Animation.xml
@@ -5,19 +5,30 @@
</brief_description>
<description>
An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track.
- [codeblock]
+ [codeblocks]
+ [gdscript]
# This creates an animation that makes the node "Enemy" move to the right by
- # 100 pixels in 1 second.
+ # 100 pixels in 0.5 seconds.
var animation = Animation.new()
var track_index = animation.add_track(Animation.TYPE_VALUE)
- animation.track_set_path(track_index, "Enemy:position.x")
+ animation.track_set_path(track_index, "Enemy:position:x")
animation.track_insert_key(track_index, 0.0, 0)
animation.track_insert_key(track_index, 0.5, 100)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // This creates an animation that makes the node "Enemy" move to the right by
+ // 100 pixels in 0.5 seconds.
+ var animation = new Animation();
+ int trackIndex = animation.AddTrack(Animation.TrackType.Value);
+ animation.TrackSetPath(trackIndex, "Enemy:position:x");
+ animation.TrackInsertKey(trackIndex, 0.0f, 0);
+ animation.TrackInsertKey(trackIndex, 0.5f, 100);
+ [/csharp]
+ [/codeblocks]
Animations are just data containers, and must be added to nodes such as an [AnimationPlayer] to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check [enum TrackType] to see available types.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link>
+ <link title="Animation tutorial index">https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link>
</tutorials>
<methods>
<method name="add_track">
@@ -670,6 +681,17 @@
Returns the update mode of a value track.
</description>
</method>
+ <method name="value_track_interpolate" qualifiers="const">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="track_idx" type="int">
+ </argument>
+ <argument index="1" name="time_sec" type="float">
+ </argument>
+ <description>
+ Returns the interpolated value at the given time (in seconds). The [code]track_idx[/code] must be the index of a value track.
+ </description>
+ </method>
<method name="value_track_set_update_mode">
<return type="void">
</return>
diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml
index 3d6ebd5934..8204b456d9 100644
--- a/doc/classes/AnimationNode.xml
+++ b/doc/classes/AnimationNode.xml
@@ -8,7 +8,7 @@
Inherit this when creating nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
<method name="add_input">
diff --git a/doc/classes/AnimationNodeAdd2.xml b/doc/classes/AnimationNodeAdd2.xml
index 48983a624e..63127ade9a 100644
--- a/doc/classes/AnimationNodeAdd2.xml
+++ b/doc/classes/AnimationNodeAdd2.xml
@@ -7,7 +7,7 @@
A resource to add to an [AnimationNodeBlendTree]. Blends two animations additively based on an amount value in the [code][0.0, 1.0][/code] range.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeAdd3.xml b/doc/classes/AnimationNodeAdd3.xml
index 1bfebc91fc..0e49ac7bbf 100644
--- a/doc/classes/AnimationNodeAdd3.xml
+++ b/doc/classes/AnimationNodeAdd3.xml
@@ -11,7 +11,8 @@
- A +add animation to blend with when the blend amount is in the [code][0.0, 1.0][/code] range
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeAnimation.xml b/doc/classes/AnimationNodeAnimation.xml
index ab44148c15..3f0843c112 100644
--- a/doc/classes/AnimationNodeAnimation.xml
+++ b/doc/classes/AnimationNodeAnimation.xml
@@ -7,7 +7,9 @@
A resource to add to an [AnimationNodeBlendTree]. Only features one output set using the [member animation] property. Use it as an input for [AnimationNode] that blend animations together.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeBlend2.xml b/doc/classes/AnimationNodeBlend2.xml
index 2b56167225..e509a2df6c 100644
--- a/doc/classes/AnimationNodeBlend2.xml
+++ b/doc/classes/AnimationNodeBlend2.xml
@@ -7,7 +7,9 @@
A resource to add to an [AnimationNodeBlendTree]. Blends two animations linearly based on an amount value in the [code][0.0, 1.0][/code] range.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeBlend3.xml b/doc/classes/AnimationNodeBlend3.xml
index 5a306a225d..7c81b37663 100644
--- a/doc/classes/AnimationNodeBlend3.xml
+++ b/doc/classes/AnimationNodeBlend3.xml
@@ -11,7 +11,7 @@
- A +blend animation to blend with when the blend amount is in the [code][0.0, 1.0][/code] range
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeBlendSpace1D.xml b/doc/classes/AnimationNodeBlendSpace1D.xml
index 6e82f0afb7..263b59910b 100644
--- a/doc/classes/AnimationNodeBlendSpace1D.xml
+++ b/doc/classes/AnimationNodeBlendSpace1D.xml
@@ -10,7 +10,7 @@
You can set the extents of the axis using the [member min_space] and [member max_space].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
<method name="add_blend_point">
diff --git a/doc/classes/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml
index f8680ba8ec..abbc8cb2e6 100644
--- a/doc/classes/AnimationNodeBlendSpace2D.xml
+++ b/doc/classes/AnimationNodeBlendSpace2D.xml
@@ -9,7 +9,8 @@
You can add vertices to the blend space with [method add_blend_point] and automatically triangulate it by setting [member auto_triangles] to [code]true[/code]. Otherwise, use [method add_triangle] and [method remove_triangle] to create up the blend space by hand.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="add_blend_point">
diff --git a/doc/classes/AnimationNodeBlendTree.xml b/doc/classes/AnimationNodeBlendTree.xml
index 4a34d75ff9..8f87ce453f 100644
--- a/doc/classes/AnimationNodeBlendTree.xml
+++ b/doc/classes/AnimationNodeBlendTree.xml
@@ -7,7 +7,7 @@
This node may contain a sub-tree of any other blend type nodes, such as mix, blend2, blend3, one shot, etc. This is one of the most commonly used roots.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
<method name="add_node">
diff --git a/doc/classes/AnimationNodeOneShot.xml b/doc/classes/AnimationNodeOneShot.xml
index 4ba0b82df6..65ab363e1f 100644
--- a/doc/classes/AnimationNodeOneShot.xml
+++ b/doc/classes/AnimationNodeOneShot.xml
@@ -7,7 +7,8 @@
A resource to add to an [AnimationNodeBlendTree]. This node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="get_mix_mode" qualifiers="const">
diff --git a/doc/classes/AnimationNodeOutput.xml b/doc/classes/AnimationNodeOutput.xml
index 38b05eb650..c4150d7e82 100644
--- a/doc/classes/AnimationNodeOutput.xml
+++ b/doc/classes/AnimationNodeOutput.xml
@@ -6,7 +6,9 @@
<description>
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeStateMachine.xml b/doc/classes/AnimationNodeStateMachine.xml
index 3b351a3345..e08e288c59 100644
--- a/doc/classes/AnimationNodeStateMachine.xml
+++ b/doc/classes/AnimationNodeStateMachine.xml
@@ -6,13 +6,19 @@
<description>
Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the [AnimationNodeStateMachinePlayback] object from the [AnimationTree] node to control it programmatically.
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var stateMachine = GetNode&lt;AnimationTree&gt;("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback;
+ stateMachine.Travel("some_state");
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
<method name="add_node">
diff --git a/doc/classes/AnimationNodeStateMachinePlayback.xml b/doc/classes/AnimationNodeStateMachinePlayback.xml
index f4b89a5086..60ff425cdb 100644
--- a/doc/classes/AnimationNodeStateMachinePlayback.xml
+++ b/doc/classes/AnimationNodeStateMachinePlayback.xml
@@ -6,13 +6,19 @@
<description>
Allows control of [AnimationTree] state machines created with [AnimationNodeStateMachine]. Retrieve with [code]$AnimationTree.get("parameters/playback")[/code].
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var stateMachine = GetNode&lt;AnimationTree&gt;("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback;
+ stateMachine.Travel("some_state");
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
<method name="get_current_node" qualifiers="const">
diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml
index f0b7cc4099..2f0ebd7de6 100644
--- a/doc/classes/AnimationNodeStateMachineTransition.xml
+++ b/doc/classes/AnimationNodeStateMachineTransition.xml
@@ -5,16 +5,21 @@
<description>
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
</methods>
<members>
<member name="advance_condition" type="StringName" setter="set_advance_condition" getter="get_advance_condition" default="@&quot;&quot;">
Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the [AnimationTree] that can be controlled from code (see [url=https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html#controlling-from-code][/url]). For example, if [member AnimationTree.tree_root] is an [AnimationNodeStateMachine] and [member advance_condition] is set to [code]"idle"[/code]:
- [codeblock]
- $animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0)
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ $animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0))
+ [/gdscript]
+ [csharp]
+ GetNode&lt;AnimationTree&gt;("animation_tree").Set("parameters/conditions/idle", IsOnFloor &amp;&amp; (LinearVelocity.x == 0));
+ [/csharp]
+ [/codeblocks]
</member>
<member name="auto_advance" type="bool" setter="set_auto_advance" getter="has_auto_advance" default="false">
Turn on the transition automatically when this state is reached. This works best with [constant SWITCH_MODE_AT_END].
diff --git a/doc/classes/AnimationNodeTimeScale.xml b/doc/classes/AnimationNodeTimeScale.xml
index 5c2e6cb692..2ce8309418 100644
--- a/doc/classes/AnimationNodeTimeScale.xml
+++ b/doc/classes/AnimationNodeTimeScale.xml
@@ -7,7 +7,8 @@
Allows scaling the speed of the animation (or reversing it) in any children nodes. Setting it to 0 will pause the animation.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeTimeSeek.xml b/doc/classes/AnimationNodeTimeSeek.xml
index 0fef106da5..eb5335c792 100644
--- a/doc/classes/AnimationNodeTimeSeek.xml
+++ b/doc/classes/AnimationNodeTimeSeek.xml
@@ -7,7 +7,7 @@
This node can be used to cause a seek command to happen to any sub-children of the graph. After setting the time, this value returns to -1.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml
index 11250c5b17..73c7006768 100644
--- a/doc/classes/AnimationNodeTransition.xml
+++ b/doc/classes/AnimationNodeTransition.xml
@@ -7,7 +7,9 @@
Simple state machine for cases which don't require a more advanced [AnimationNodeStateMachine]. Animations can be connected to the inputs and transition times can be specified.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="get_input_caption" qualifiers="const">
diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml
index 1420b1bf64..de2087d930 100644
--- a/doc/classes/AnimationPlayer.xml
+++ b/doc/classes/AnimationPlayer.xml
@@ -9,8 +9,9 @@
Updating the target properties of animations occurs at process time.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/animations.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link>
+ <link title="2D Sprite animation">https://docs.godotengine.org/en/latest/tutorials/2d/2d_sprite_animation.html</link>
+ <link title="Animation tutorial index">https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="add_animation">
@@ -235,7 +236,8 @@
The name of the animation to play when the scene loads.
</member>
<member name="current_animation" type="String" setter="set_current_animation" getter="get_current_animation" default="&quot;&quot;">
- The name of the current animation, "" if not playing anything. When being set, does not restart the animation. See also [method play].
+ The name of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See [method play] for more information on playing animations.
+ [b]Note[/b]: while this property appears in the inspector, it's not meant to be edited and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see [Animation].
</member>
<member name="current_animation_length" type="float" setter="" getter="get_current_animation_length">
The length (in seconds) of the currently being played animation.
diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml
index 9642dd1c70..262b5addb7 100644
--- a/doc/classes/AnimationTree.xml
+++ b/doc/classes/AnimationTree.xml
@@ -4,10 +4,11 @@
A node to be used for advanced animation transitions in an [AnimationPlayer].
</brief_description>
<description>
+ Note: When linked with an [AnimationPlayer], several properties and methods of the corresponding [AnimationPlayer] will not function as expected. Playback and transitions should be handled using only the [AnimationTree] and its constituent [AnimationNode](s). The [AnimationPlayer] node should be used solely for adding, deleting, and editing animations.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
- <link>https://github.com/godotengine/tps-demo</link>
+ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="advance">
@@ -23,6 +24,7 @@
<return type="Transform">
</return>
<description>
+ Retrieve the motion of the [member root_motion_track] as a [Transform] that can be used elsewhere. If [member root_motion_track] is not a path to a track of type [constant Animation.TYPE_TRANSFORM], returns an identity transformation.
</description>
</method>
<method name="rename_parameter">
@@ -47,6 +49,8 @@
The process mode of this [AnimationTree]. See [enum AnimationProcessMode] for available modes.
</member>
<member name="root_motion_track" type="NodePath" setter="set_root_motion_track" getter="get_root_motion_track" default="NodePath(&quot;&quot;)">
+ The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by [code]":"[/code]. For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code].
+ If the track has type [constant Animation.TYPE_TRANSFORM], the transformation will be cancelled visually, and the animation will appear to stay in place.
</member>
<member name="tree_root" type="AnimationNode" setter="set_tree_root" getter="get_tree_root">
The root animation node of this [AnimationTree]. See [AnimationNode].
diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml
index 4190cbe6b9..72c40478bb 100644
--- a/doc/classes/Area2D.xml
+++ b/doc/classes/Area2D.xml
@@ -7,7 +7,10 @@
2D area that detects [CollisionObject2D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/using_area_2d.html</link>
+ <link title="Using Area2D">https://docs.godotengine.org/en/latest/tutorials/physics/using_area_2d.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/121</link>
+ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
</tutorials>
<methods>
<method name="get_collision_layer_bit" qualifiers="const">
@@ -88,7 +91,8 @@
</methods>
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="1.0">
- The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
+ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
+ See [member ProjectSettings.physics/2d/default_angular_damp] for more details about damping.
</member>
<member name="audio_bus_name" type="StringName" setter="set_audio_bus_name" getter="get_audio_bus_name" default="@&quot;Master&quot;">
The name of the area's audio bus.
@@ -97,10 +101,10 @@
If [code]true[/code], the area's audio bus overrides the default audio bus.
</member>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
- The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask].
+ The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The physics layers this area scans to determine collision detection.
+ The physics layers this area scans to determine collision detection. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="gravity" type="float" setter="set_gravity" getter="get_gravity" default="98.0">
The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
@@ -115,7 +119,8 @@
The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction.
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="0.1">
- The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
+ The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
+ See [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping.
</member>
<member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" default="true">
If [code]true[/code], other monitoring areas can detect this area.
diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml
index a94cecd879..92a8465762 100644
--- a/doc/classes/Area3D.xml
+++ b/doc/classes/Area3D.xml
@@ -7,6 +7,8 @@
3D area that detects [CollisionObject3D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).
</description>
<tutorials>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
</tutorials>
<methods>
<method name="get_collision_layer_bit" qualifiers="const">
@@ -87,7 +89,8 @@
</methods>
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="0.1">
- The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
+ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
+ See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping.
</member>
<member name="audio_bus_name" type="StringName" setter="set_audio_bus" getter="get_audio_bus" default="@&quot;Master&quot;">
The name of the area's audio bus.
@@ -96,10 +99,10 @@
If [code]true[/code], the area's audio bus overrides the default audio bus.
</member>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
- The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask].
+ The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The physics layers this area scans to determine collision detection.
+ The physics layers this area scans to determine collision detection. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="gravity" type="float" setter="set_gravity" getter="get_gravity" default="9.8">
The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
@@ -114,7 +117,8 @@
The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction.
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="0.1">
- The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
+ The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
+ See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping.
</member>
<member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" default="true">
If [code]true[/code], other monitoring areas can detect this area.
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index 20296bbf45..6a9eb89602 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -6,62 +6,89 @@
<description>
Generic array which can contain several elements of any type, accessible by a numerical index starting at 0. Negative indices can be used to count from the back, like in Python (-1 is the last element, -2 the second to last, etc.).
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
var array = ["One", 2, 3, "Four"]
print(array[0]) # One.
print(array[2]) # 3.
print(array[-1]) # Four.
array[2] = "Three"
print(array[-2]) # Three.
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var array = new Godot.Collections.Array{"One", 2, 3, "Four"};
+ GD.Print(array[0]); // One.
+ GD.Print(array[2]); // 3.
+ GD.Print(array[array.Count - 1]); // Four.
+ array[2] = "Three";
+ GD.Print(array[array.Count - 2]); // Three.
+ [/csharp]
+ [/codeblocks]
Arrays can be concatenated using the [code]+[/code] operator:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var array1 = ["One", 2]
var array2 = [3, "Four"]
print(array1 + array2) # ["One", 2, 3, "Four"]
- [/codeblock]
- Arrays are always passed by reference.
+ [/gdscript]
+ [csharp]
+ // Array concatenation is not possible with C# arrays, but is with Godot.Collections.Array.
+ var array1 = new Godot.Collections.Array("One", 2);
+ var array2 = new Godot.Collections.Array(3, "Four");
+ GD.Print(array1 + array2); // Prints [One, 2, 3, Four]
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] Concatenating with the [code]+=[/code] operator will create a new array, which has a cost. If you want to append another array to an existing array, [method append_array] is more efficient.
+ [b]Note:[/b] Arrays are always passed by reference. To get a copy of an array which can be modified independently of the original array, use [method duplicate].
+ [b]Note:[/b] When declaring an array with [code]const[/code], the array itself can still be mutated by defining the values at individual indices or pushing/removing elements. Using [code]const[/code] will only prevent assigning the constant with another value after it was initialized.
</description>
<tutorials>
</tutorials>
<methods>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedColorArray">
+ <description>
+ Constructs an empty [Array].
+ </description>
+ </method>
+ <method name="Array" qualifiers="constructor">
+ <return type="Array">
+ </return>
+ <argument index="0" name="from" type="Array">
</argument>
<description>
- Constructs an array from a [PackedColorArray].
+ Constructs an [Array] as a copy of the given [Array].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedVector3Array">
+ <argument index="0" name="from" type="PackedByteArray">
</argument>
<description>
- Constructs an array from a [PackedVector3Array].
+ Constructs an array from a [PackedByteArray].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedVector2Array">
+ <argument index="0" name="from" type="PackedColorArray">
</argument>
<description>
- Constructs an array from a [PackedVector2Array].
+ Constructs an array from a [PackedColorArray].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedStringArray">
+ <argument index="0" name="from" type="PackedFloat32Array">
</argument>
<description>
- Constructs an array from a [PackedStringArray].
+ Constructs an array from a [PackedFloat32Array].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
<argument index="0" name="from" type="PackedFloat64Array">
@@ -70,16 +97,16 @@
Constructs an array from a [PackedFloat64Array].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedFloat32Array">
+ <argument index="0" name="from" type="PackedInt32Array">
</argument>
<description>
- Constructs an array from a [PackedFloat32Array].
+ Constructs an array from a [PackedInt32Array].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
<argument index="0" name="from" type="PackedInt64Array">
@@ -88,22 +115,31 @@
Constructs an array from a [PackedInt64Array].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedInt32Array">
+ <argument index="0" name="from" type="PackedStringArray">
</argument>
<description>
- Constructs an array from a [PackedInt32Array].
+ Constructs an array from a [PackedStringArray].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedByteArray">
+ <argument index="0" name="from" type="PackedVector2Array">
</argument>
<description>
- Constructs an array from a [PackedByteArray].
+ Constructs an array from a [PackedVector2Array].
+ </description>
+ </method>
+ <method name="Array" qualifiers="constructor">
+ <return type="Array">
+ </return>
+ <argument index="0" name="from" type="PackedVector3Array">
+ </argument>
+ <description>
+ Constructs an array from a [PackedVector3Array].
</description>
</method>
<method name="append">
@@ -115,11 +151,27 @@
Appends an element at the end of the array (alias of [method push_back]).
</description>
</method>
+ <method name="append_array">
+ <return type="void">
+ </return>
+ <argument index="0" name="array" type="Array">
+ </argument>
+ <description>
+ Appends another array at the end of this array.
+ [codeblock]
+ var array1 = [1, 2, 3]
+ var array2 = [4, 5, 6]
+ array1.append_array(array2)
+ print(array1) # Prints [1, 2, 3, 4, 5, 6].
+ [/codeblock]
+ </description>
+ </method>
<method name="back">
<return type="Variant">
</return>
<description>
- Returns the last element of the array, or [code]null[/code] if the array is empty.
+ Returns the last element of the array. Prints an error and returns [code]null[/code] if the array is empty.
+ [b]Note:[/b] Calling this function is not the same as writing [code]array[-1][/code]. If the array is empty, accessing by index will pause project execution when running from the editor.
</description>
</method>
<method name="bsearch">
@@ -141,7 +193,7 @@
</argument>
<argument index="1" name="obj" type="Object">
</argument>
- <argument index="2" name="func" type="String">
+ <argument index="2" name="func" type="StringName">
</argument>
<argument index="3" name="before" type="bool" default="true">
</argument>
@@ -200,7 +252,7 @@
<argument index="1" name="from" type="int" default="0">
</argument>
<description>
- Searches the array for a value and returns its index or -1 if not found. Optionally, the initial search index can be passed.
+ Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
</description>
</method>
<method name="find_last">
@@ -209,14 +261,15 @@
<argument index="0" name="value" type="Variant">
</argument>
<description>
- Searches the array in reverse order for a value and returns its index or -1 if not found.
+ Searches the array in reverse order for a value and returns its index or [code]-1[/code] if not found.
</description>
</method>
<method name="front">
<return type="Variant">
</return>
<description>
- Returns the first element of the array, or [code]null[/code] if the array is empty.
+ Returns the first element of the array. Prints an error and returns [code]null[/code] if the array is empty.
+ [b]Note:[/b] Calling this function is not the same as writing [code]array[0][/code]. If the array is empty, accessing by index will pause project execution when running from the editor.
</description>
</method>
<method name="has">
@@ -226,12 +279,39 @@
</argument>
<description>
Returns [code]true[/code] if the array contains the given value.
- [codeblock]
- ["inside", 7].has("inside") == true
- ["inside", 7].has("outside") == false
- ["inside", 7].has(7) == true
- ["inside", 7].has("7") == false
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ print(["inside", 7].has("inside")) # True
+ print(["inside", 7].has("outside")) # False
+ print(["inside", 7].has(7)) # True
+ print(["inside", 7].has("7")) # False
+ [/gdscript]
+ [csharp]
+ var arr = new Godot.Collections.Array{"inside", 7};
+ // has is renamed to Contains
+ GD.Print(arr.Contains("inside")); // True
+ GD.Print(arr.Contains("outside")); // False
+ GD.Print(arr.Contains(7)); // True
+ GD.Print(arr.Contains("7")); // False
+ [/csharp]
+ [/codeblocks]
+
+ [b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows:
+ [codeblocks]
+ [gdscript]
+ # Will evaluate to `true`.
+ if 2 in [2, 4, 6, 8]:
+ print("Containes!")
+ [/gdscript]
+ [csharp]
+ // As there is no "in" keyword in C#, you have to use Contains
+ var array = new Godot.Collections.Array{2, 4, 6, 8};
+ if (array.Contains(2))
+ {
+ GD.Print("Containes!");
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="hash">
@@ -273,18 +353,82 @@
Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Array">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="void">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="pop_back">
<return type="Variant">
</return>
<description>
- Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty.
+ Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty, without printing an error message.
</description>
</method>
<method name="pop_front">
<return type="Variant">
</return>
<description>
- Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty.
+ Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty, without printing an error message.
</description>
</method>
<method name="push_back">
@@ -311,11 +455,11 @@
<argument index="0" name="position" type="int">
</argument>
<description>
- Removes an element from the array by index.
+ Removes an element from the array by index. If the index does not exist in the array, nothing happens.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
<argument index="0" name="size" type="int">
</argument>
@@ -369,11 +513,16 @@
<description>
Sorts the array.
[b]Note:[/b] Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var strings = ["string1", "string2", "string10", "string11"]
strings.sort()
print(strings) # Prints [string1, string10, string11, string2]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // There is no sort support for Godot.Collections.Array
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="sort_custom">
@@ -381,12 +530,13 @@
</return>
<argument index="0" name="obj" type="Object">
</argument>
- <argument index="1" name="func" type="String">
+ <argument index="1" name="func" type="StringName">
</argument>
<description>
Sorts the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return either [code]true[/code] or [code]false[/code].
[b]Note:[/b] you cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior.
- [codeblock]
+ [codeblocks]
+ [gdscript]
class MyCustomSorter:
static func sort_ascending(a, b):
if a[0] &lt; b[0]:
@@ -396,7 +546,11 @@
var my_items = [[5, "Potato"], [9, "Rice"], [4, "Tomato"]]
my_items.sort_custom(MyCustomSorter, "sort_ascending")
print(my_items) # Prints [[4, Tomato], [5, Potato], [9, Rice]].
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // There is no custom sort support for Godot.Collections.Array
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml
index b45716544a..dc834474ad 100644
--- a/doc/classes/ArrayMesh.xml
+++ b/doc/classes/ArrayMesh.xml
@@ -6,27 +6,48 @@
<description>
The [ArrayMesh] is used to construct a [Mesh] by specifying the attributes as arrays.
The most basic example is the creation of a single triangle:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var vertices = PackedVector3Array()
vertices.push_back(Vector3(0, 1, 0))
vertices.push_back(Vector3(1, 0, 0))
vertices.push_back(Vector3(0, 0, 1))
+
# Initialize the ArrayMesh.
var arr_mesh = ArrayMesh.new()
var arrays = []
arrays.resize(ArrayMesh.ARRAY_MAX)
arrays[ArrayMesh.ARRAY_VERTEX] = vertices
+
# Create the Mesh.
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
var m = MeshInstance3D.new()
m.mesh = arr_mesh
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var vertices = new Godot.Collections.Array&lt;Vector3&gt;();
+ vertices.Add(new Vector3(0, 1, 0));
+ vertices.Add(new Vector3(1, 0, 0));
+ vertices.Add(new Vector3(0, 0, 1));
+
+ // Initialize the ArrayMesh.
+ var arrMesh = new ArrayMesh();
+ var arrays = new Godot.Collections.Array();
+ arrays.Resize((int)ArrayMesh.ArrayType.Max);
+ arrays[(int)ArrayMesh.ArrayType.Vertex] = vertices;
+
+ // Create the Mesh.
+ arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, arrays);
+ var m = new MeshInstance();
+ m.Mesh = arrMesh;
+ [/csharp]
+ [/codeblocks]
The [MeshInstance3D] is ready to be added to the [SceneTree] to be shown.
See also [ImmediateGeometry3D], [MeshDataTool] and [SurfaceTool] for procedural geometry generation.
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/content/procedural_geometry/arraymesh.html</link>
+ <link title="Procedural geometry using the ArrayMesh">https://docs.godotengine.org/en/latest/tutorials/content/procedural_geometry/arraymesh.html</link>
</tutorials>
<methods>
<method name="add_blend_shape">
@@ -48,7 +69,6 @@
<argument index="2" name="blend_shapes" type="Array" default="[ ]">
</argument>
<argument index="3" name="lods" type="Dictionary" default="{
-
}">
</argument>
<argument index="4" name="compress_flags" type="int" default="31744">
diff --git a/doc/classes/AudioEffect.xml b/doc/classes/AudioEffect.xml
index 60bf15ce57..955285bd2e 100644
--- a/doc/classes/AudioEffect.xml
+++ b/doc/classes/AudioEffect.xml
@@ -7,6 +7,7 @@
Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on.
</description>
<tutorials>
+ <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioEffectDistortion.xml b/doc/classes/AudioEffectDistortion.xml
index 3cfeaadb23..24a145b0f3 100644
--- a/doc/classes/AudioEffectDistortion.xml
+++ b/doc/classes/AudioEffectDistortion.xml
@@ -2,13 +2,14 @@
<class name="AudioEffectDistortion" inherits="AudioEffect" version="4.0">
<brief_description>
Adds a distortion audio effect to an Audio bus.
- Modify the sound to make it dirty.
+ Modify the sound to make it distorted.
</brief_description>
<description>
- Modify the sound and make it dirty. Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape.
+ Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape.
By distorting the waveform the frequency content change, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently.
</description>
<tutorials>
+ <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioEffectFilter.xml b/doc/classes/AudioEffectFilter.xml
index f548fb49cc..293848d204 100644
--- a/doc/classes/AudioEffectFilter.xml
+++ b/doc/classes/AudioEffectFilter.xml
@@ -7,6 +7,7 @@
Allows frequencies other than the [member cutoff_hz] to pass.
</description>
<tutorials>
+ <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link>
</tutorials>
<methods>
</methods>
@@ -20,7 +21,7 @@
Gain amount of the frequencies after the filter.
</member>
<member name="resonance" type="float" setter="set_resonance" getter="get_resonance" default="0.5">
- Amount of boost in the overtones near the cutoff frequency.
+ Amount of boost in the frequency range near the cutoff frequency.
</member>
</members>
<constants>
diff --git a/doc/classes/AudioEffectHighShelfFilter.xml b/doc/classes/AudioEffectHighShelfFilter.xml
index cf620e4417..4ba31f9fc8 100644
--- a/doc/classes/AudioEffectHighShelfFilter.xml
+++ b/doc/classes/AudioEffectHighShelfFilter.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectHighShelfFilter" inherits="AudioEffectFilter" version="4.0">
<brief_description>
+ Reduces all frequencies above the [member AudioEffectFilter.cutoff_hz].
</brief_description>
<description>
</description>
<tutorials>
+ <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioEffectLowShelfFilter.xml b/doc/classes/AudioEffectLowShelfFilter.xml
index 7cf09b0f05..078e7bf1a1 100644
--- a/doc/classes/AudioEffectLowShelfFilter.xml
+++ b/doc/classes/AudioEffectLowShelfFilter.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectLowShelfFilter" inherits="AudioEffectFilter" version="4.0">
<brief_description>
+ Reduces all frequencies below the [member AudioEffectFilter.cutoff_hz].
</brief_description>
<description>
</description>
<tutorials>
+ <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioEffectRecord.xml b/doc/classes/AudioEffectRecord.xml
index 4dac81322f..872ddf3b0f 100644
--- a/doc/classes/AudioEffectRecord.xml
+++ b/doc/classes/AudioEffectRecord.xml
@@ -4,9 +4,11 @@
Audio effect used for recording sound from a microphone.
</brief_description>
<description>
+ Allows the user to record sound from a microphone. It sets and gets the format in which the audio file will be recorded (8-bit, 16-bit, or compressed). It checks whether or not the recording is active, and if it is, records the sound. It then returns the recorded sample.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/audio/recording_with_microphone.html</link>
+ <link title="Recording with microphone">https://docs.godotengine.org/en/latest/tutorials/audio/recording_with_microphone.html</link>
+ <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
</tutorials>
<methods>
<method name="get_recording" qualifiers="const">
diff --git a/doc/classes/AudioEffectReverb.xml b/doc/classes/AudioEffectReverb.xml
index 26eb2be753..fbe68cde0e 100644
--- a/doc/classes/AudioEffectReverb.xml
+++ b/doc/classes/AudioEffectReverb.xml
@@ -8,6 +8,7 @@
Simulates rooms of different sizes. Its parameters can be adjusted to simulate the sound of a specific room.
</description>
<tutorials>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml
index 49c6f5bb34..dafc0065f6 100644
--- a/doc/classes/AudioServer.xml
+++ b/doc/classes/AudioServer.xml
@@ -7,7 +7,10 @@
[AudioServer] is a low-level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link>
+ <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link>
+ <link title="Audio Device Changer Demo">https://godotengine.org/asset-library/asset/525</link>
+ <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
+ <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link>
</tutorials>
<methods>
<method name="add_bus">
diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml
index d5c8e42515..bbfec579bb 100644
--- a/doc/classes/AudioStream.xml
+++ b/doc/classes/AudioStream.xml
@@ -7,7 +7,10 @@
Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via [AudioStreamSample]) and OGG (via [AudioStreamOGGVorbis]) file formats.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
+ <link title="Audio streams">https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
+ <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
+ <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
+ <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link>
</tutorials>
<methods>
<method name="get_length" qualifiers="const">
diff --git a/doc/classes/AudioStreamGenerator.xml b/doc/classes/AudioStreamGenerator.xml
index e93da411cd..a273beb5af 100644
--- a/doc/classes/AudioStreamGenerator.xml
+++ b/doc/classes/AudioStreamGenerator.xml
@@ -5,7 +5,7 @@
<description>
</description>
<tutorials>
- <link>https://github.com/godotengine/godot-demo-projects/tree/master/audio/generator</link>
+ <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioStreamGeneratorPlayback.xml b/doc/classes/AudioStreamGeneratorPlayback.xml
index e3e17b8a93..cd8e8735b6 100644
--- a/doc/classes/AudioStreamGeneratorPlayback.xml
+++ b/doc/classes/AudioStreamGeneratorPlayback.xml
@@ -5,7 +5,7 @@
<description>
</description>
<tutorials>
- <link>https://github.com/godotengine/godot-demo-projects/tree/master/audio/generator</link>
+ <link title="Audio generator demo project">https://github.com/godotengine/godot-demo-projects/tree/master/audio/generator</link>
</tutorials>
<methods>
<method name="can_push_buffer" qualifiers="const">
diff --git a/doc/classes/AudioStreamPlayback.xml b/doc/classes/AudioStreamPlayback.xml
index f928d54526..da75ff206c 100644
--- a/doc/classes/AudioStreamPlayback.xml
+++ b/doc/classes/AudioStreamPlayback.xml
@@ -7,6 +7,7 @@
Can play, loop, pause a scroll through audio. See [AudioStream] and [AudioStreamOGGVorbis] for usage.
</description>
<tutorials>
+ <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml
index eab6505734..55190c5f9f 100644
--- a/doc/classes/AudioStreamPlayer.xml
+++ b/doc/classes/AudioStreamPlayer.xml
@@ -7,7 +7,12 @@
Plays an audio stream non-positionally.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
+ <link title="Audio streams">https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="Audio Device Changer Demo">https://godotengine.org/asset-library/asset/525</link>
+ <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
+ <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
+ <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link>
</tutorials>
<methods>
<method name="get_playback_position">
@@ -61,7 +66,7 @@
If the audio configuration has more than two speakers, this sets the target channels. See [enum MixTarget] constants.
</member>
<member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0">
- Changes the pitch and the tempo of the audio.
+ The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
</member>
<member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false">
If [code]true[/code], audio is playing.
diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml
index fdbef1b89e..d8b9385736 100644
--- a/doc/classes/AudioStreamPlayer2D.xml
+++ b/doc/classes/AudioStreamPlayer2D.xml
@@ -7,7 +7,7 @@
Plays audio that dampens with distance from screen center.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
+ <link title="Audio streams">https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
</tutorials>
<methods>
<method name="get_playback_position">
@@ -67,7 +67,7 @@
Maximum distance from which audio is still hearable.
</member>
<member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0">
- Changes the pitch and the tempo of the audio.
+ The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
</member>
<member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false">
If [code]true[/code], audio is playing.
diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml
index 3eeb524e9c..aadbc865bb 100644
--- a/doc/classes/AudioStreamPlayer3D.xml
+++ b/doc/classes/AudioStreamPlayer3D.xml
@@ -5,9 +5,10 @@
</brief_description>
<description>
Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space.
+ By default, audio is heard from the camera position. This can be changed by adding a [Listener3D] node to the scene and enabling it by calling [method Listener3D.make_current] on it.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
+ <link title="Audio streams">https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
</tutorials>
<methods>
<method name="get_playback_position">
@@ -91,7 +92,7 @@
Decides if audio should pause when source is outside of [member max_distance] range.
</member>
<member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0">
- Changes the pitch and the tempo of the audio.
+ The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
</member>
<member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false">
If [code]true[/code], audio is playing.
diff --git a/doc/classes/BakedLightmap.xml b/doc/classes/BakedLightmap.xml
new file mode 100644
index 0000000000..6fd08fc4e4
--- /dev/null
+++ b/doc/classes/BakedLightmap.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="BakedLightmap" inherits="VisualInstance3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="bias" type="float" setter="set_bias" getter="get_bias" default="0.0005">
+ </member>
+ <member name="bounces" type="int" setter="set_bounces" getter="get_bounces" default="1">
+ </member>
+ <member name="directional" type="bool" setter="set_directional" getter="is_directional" default="false">
+ </member>
+ <member name="environment_custom_color" type="Color" setter="set_environment_custom_color" getter="get_environment_custom_color">
+ </member>
+ <member name="environment_custom_energy" type="float" setter="set_environment_custom_energy" getter="get_environment_custom_energy">
+ </member>
+ <member name="environment_custom_sky" type="Sky" setter="set_environment_custom_sky" getter="get_environment_custom_sky">
+ </member>
+ <member name="environment_mode" type="int" setter="set_environment_mode" getter="get_environment_mode" enum="BakedLightmap.EnvironmentMode" default="0">
+ </member>
+ <member name="generate_probes_subdiv" type="int" setter="set_generate_probes" getter="get_generate_probes" enum="BakedLightmap.GenerateProbes" default="0">
+ </member>
+ <member name="interior" type="bool" setter="set_interior" getter="is_interior" default="false">
+ </member>
+ <member name="light_data" type="BakedLightmapData" setter="set_light_data" getter="get_light_data">
+ </member>
+ <member name="max_texture_size" type="int" setter="set_max_texture_size" getter="get_max_texture_size" default="16384">
+ </member>
+ <member name="quality" type="int" setter="set_bake_quality" getter="get_bake_quality" enum="BakedLightmap.BakeQuality" default="1">
+ </member>
+ <member name="use_denoiser" type="bool" setter="set_use_denoiser" getter="is_using_denoiser" default="true">
+ </member>
+ </members>
+ <constants>
+ <constant name="BAKE_QUALITY_LOW" value="0" enum="BakeQuality">
+ </constant>
+ <constant name="BAKE_QUALITY_MEDIUM" value="1" enum="BakeQuality">
+ </constant>
+ <constant name="BAKE_QUALITY_HIGH" value="2" enum="BakeQuality">
+ </constant>
+ <constant name="BAKE_QUALITY_ULTRA" value="3" enum="BakeQuality">
+ </constant>
+ <constant name="GENERATE_PROBES_DISABLED" value="0" enum="GenerateProbes">
+ </constant>
+ <constant name="GENERATE_PROBES_SUBDIV_4" value="1" enum="GenerateProbes">
+ </constant>
+ <constant name="GENERATE_PROBES_SUBDIV_8" value="2" enum="GenerateProbes">
+ </constant>
+ <constant name="GENERATE_PROBES_SUBDIV_16" value="3" enum="GenerateProbes">
+ </constant>
+ <constant name="GENERATE_PROBES_SUBDIV_32" value="4" enum="GenerateProbes">
+ </constant>
+ <constant name="BAKE_ERROR_OK" value="0" enum="BakeError">
+ </constant>
+ <constant name="BAKE_ERROR_NO_LIGHTMAPPER" value="1" enum="BakeError">
+ </constant>
+ <constant name="BAKE_ERROR_NO_SAVE_PATH" value="2" enum="BakeError">
+ </constant>
+ <constant name="BAKE_ERROR_NO_MESHES" value="3" enum="BakeError">
+ </constant>
+ <constant name="BAKE_ERROR_MESHES_INVALID" value="4" enum="BakeError">
+ </constant>
+ <constant name="BAKE_ERROR_CANT_CREATE_IMAGE" value="5" enum="BakeError">
+ </constant>
+ <constant name="BAKE_ERROR_USER_ABORTED" value="6" enum="BakeError">
+ </constant>
+ <constant name="ENVIRONMENT_MODE_DISABLED" value="0" enum="EnvironmentMode">
+ </constant>
+ <constant name="ENVIRONMENT_MODE_SCENE" value="1" enum="EnvironmentMode">
+ </constant>
+ <constant name="ENVIRONMENT_MODE_CUSTOM_SKY" value="2" enum="EnvironmentMode">
+ </constant>
+ <constant name="ENVIRONMENT_MODE_CUSTOM_COLOR" value="3" enum="EnvironmentMode">
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/BakedLightmapData.xml b/doc/classes/BakedLightmapData.xml
new file mode 100644
index 0000000000..026477782a
--- /dev/null
+++ b/doc/classes/BakedLightmapData.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="BakedLightmapData" inherits="Resource" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_user">
+ <return type="void">
+ </return>
+ <argument index="0" name="path" type="NodePath">
+ </argument>
+ <argument index="1" name="lightmap" type="Rect2">
+ </argument>
+ <argument index="2" name="offset" type="int">
+ </argument>
+ <argument index="3" name="arg3" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="clear_users">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_user_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_user_path" qualifiers="const">
+ <return type="NodePath">
+ </return>
+ <argument index="0" name="user_idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_using_spherical_harmonics" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_uses_spherical_harmonics">
+ <return type="void">
+ </return>
+ <argument index="0" name="uses_spherical_harmonics" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="light_texture" type="TextureLayered" setter="set_light_texture" getter="get_light_texture">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml
index 5e908b0e53..378df1ce65 100644
--- a/doc/classes/BaseButton.xml
+++ b/doc/classes/BaseButton.xml
@@ -13,7 +13,7 @@
<return type="void">
</return>
<description>
- Called when the button is pressed.
+ Called when the button is pressed. If you need to know the button's pressed state (and [member toggle_mode] is active), use [method _toggled] instead.
</description>
</method>
<method name="_toggled" qualifiers="virtual">
@@ -44,6 +44,9 @@
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" enum="BaseButton.ActionMode" default="1">
Determines when the button is considered clicked, one of the [enum ActionMode] constants.
</member>
+ <member name="button_group" type="ButtonGroup" setter="set_button_group" getter="get_button_group">
+ The [ButtonGroup] associated with the button. Not to be confused with node groups.
+ </member>
<member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" default="1">
Binary mask to choose which mouse buttons this button will respond to.
To allow both left-click and right-click, use [code]BUTTON_MASK_LEFT | BUTTON_MASK_RIGHT[/code].
@@ -51,13 +54,7 @@
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false">
If [code]true[/code], the button is in disabled state and can't be clicked or toggled.
</member>
- <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" enum="Control.FocusMode" default="2">
- Focus access mode to use when switching between enabled/disabled (see [member Control.focus_mode] and [member disabled]).
- </member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" />
- <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group">
- [ButtonGroup] associated to the button.
- </member>
<member name="keep_pressed_outside" type="bool" setter="set_keep_pressed_outside" getter="is_keep_pressed_outside" default="false">
If [code]true[/code], the button stays pressed when moving the cursor outside the button while pressing it.
[b]Note:[/b] This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value.
@@ -65,8 +62,8 @@
<member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false">
If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if [member toggle_mode] is active).
</member>
- <member name="shortcut" type="ShortCut" setter="set_shortcut" getter="get_shortcut">
- [ShortCut] associated to the button.
+ <member name="shortcut" type="Shortcut" setter="set_shortcut" getter="get_shortcut">
+ [Shortcut] associated to the button.
</member>
<member name="shortcut_in_tooltip" type="bool" setter="set_shortcut_in_tooltip" getter="is_shortcut_in_tooltip_enabled" default="true">
If [code]true[/code], the button will add information about its shortcut in the tooltip.
@@ -89,6 +86,7 @@
<signal name="pressed">
<description>
Emitted when the button is toggled or pressed. This is on [signal button_down] if [member action_mode] is [constant ACTION_MODE_BUTTON_PRESS] and on [signal button_up] otherwise.
+ If you need to know the button's pressed state (and [member toggle_mode] is active), use [signal toggled] instead.
</description>
</signal>
<signal name="toggled">
diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml
index 76abc31451..31e6ea5e54 100644
--- a/doc/classes/BaseMaterial3D.xml
+++ b/doc/classes/BaseMaterial3D.xml
@@ -7,7 +7,7 @@
This provides a default material with a wide variety of rendering features and properties without the need to write shader code. See the tutorial below for details.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/spatial_material.html</link>
+ <link title="Spatial material">https://docs.godotengine.org/en/latest/tutorials/3d/spatial_material.html</link>
</tutorials>
<methods>
<method name="get_feature" qualifiers="const">
@@ -81,6 +81,15 @@
<member name="albedo_texture" type="Texture2D" setter="set_texture" getter="get_texture">
Texture to multiply by [member albedo_color]. Used for basic texturing of objects.
</member>
+ <member name="alpha_antialiasing_edge" type="float" setter="set_alpha_antialiasing_edge" getter="get_alpha_antialiasing_edge">
+ Threshold at which antialiasing will by applied on the alpha channel.
+ </member>
+ <member name="alpha_antialiasing_mode" type="int" setter="set_alpha_antialiasing" getter="get_alpha_antialiasing" enum="BaseMaterial3D.AlphaAntiAliasing">
+ The type of alpha antialiasing to apply. See [enum AlphaAntiAliasing].
+ </member>
+ <member name="alpha_hash_scale" type="float" setter="set_alpha_hash_scale" getter="get_alpha_hash_scale">
+ The hashing scale for Alpha Hash. Recommended values between [code]0[/code] and [code]2[/code].
+ </member>
<member name="alpha_scissor_threshold" type="float" setter="set_alpha_scissor_threshold" getter="get_alpha_scissor_threshold">
Threshold at which the alpha scissor will discard values.
</member>
@@ -122,6 +131,7 @@
</member>
<member name="billboard_mode" type="int" setter="set_billboard_mode" getter="get_billboard_mode" enum="BaseMaterial3D.BillboardMode" default="0">
Controls how the object faces the camera. See [enum BillboardMode].
+ [b]Note:[/b] Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See [url=https://github.com/godotengine/godot/issues/41567]GitHub issue #41567[/url] for details.
</member>
<member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="BaseMaterial3D.BlendMode" default="0">
The material's blend mode.
@@ -159,6 +169,7 @@
</member>
<member name="detail_normal" type="Texture2D" setter="set_texture" getter="get_texture">
Texture that specifies the per-pixel normal of the detail overlay.
+ [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
</member>
<member name="detail_uv_layer" type="int" setter="set_detail_uv" getter="get_detail_uv" enum="BaseMaterial3D.DetailUV">
Specifies whether to use [code]UV[/code] or [code]UV2[/code] for the detail layer. See [enum DetailUV] for options.
@@ -173,10 +184,12 @@
If [code]true[/code], the object receives no shadow that would otherwise be cast onto it.
</member>
<member name="distance_fade_max_distance" type="float" setter="set_distance_fade_max_distance" getter="get_distance_fade_max_distance">
- Distance at which the object fades fully and is no longer visible.
+ Distance at which the object appears fully opaque.
+ [b]Note:[/b] If [code]distance_fade_max_distance[/code] is less than [code]distance_fade_min_distance[/code], the behavior will be reversed. The object will start to fade away at [code]distance_fade_max_distance[/code] and will fully disappear once it reaches [code]distance_fade_min_distance[/code].
</member>
<member name="distance_fade_min_distance" type="float" setter="set_distance_fade_min_distance" getter="get_distance_fade_min_distance">
- Distance at which the object starts to fade. If the object is less than this distance away it will appear normal.
+ Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible.
+ [b]Note:[/b] If [code]distance_fade_min_distance[/code] is greater than [code]distance_fade_max_distance[/code], the behavior will be reversed. The object will start to fade away at [code]distance_fade_max_distance[/code] and will fully disappear once it reaches [code]distance_fade_min_distance[/code].
</member>
<member name="distance_fade_mode" type="int" setter="set_distance_fade" getter="get_distance_fade" enum="BaseMaterial3D.DistanceFadeMode" default="0">
Specifies which type of fade to use. Can be any of the [enum DistanceFadeMode]s.
@@ -250,6 +263,7 @@
</member>
<member name="normal_texture" type="Texture2D" setter="set_texture" getter="get_texture">
Texture used to specify the normal at a given pixel. The [code]normal_texture[/code] only uses the red and green channels. The normal read from [code]normal_texture[/code] is oriented around the surface normal provided by the [Mesh].
+ [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
</member>
<member name="orm_texture" type="Texture2D" setter="set_texture" getter="get_texture">
</member>
@@ -481,10 +495,13 @@
<constant name="TRANSPARENCY_ALPHA_SCISSOR" value="2" enum="Transparency">
The material will cut off all values below a threshold, the rest will remain opaque.
</constant>
- <constant name="TRANSPARENCY_ALPHA_DEPTH_PRE_PASS" value="3" enum="Transparency">
+ <constant name="TRANSPARENCY_ALPHA_HASH" value="3" enum="Transparency">
+ The material will cut off all values below a spatially-deterministic threshold, the rest will remain opaque.
+ </constant>
+ <constant name="TRANSPARENCY_ALPHA_DEPTH_PRE_PASS" value="4" enum="Transparency">
The material will use the texture's alpha value for transparency, but will still be rendered in the pre-pass.
</constant>
- <constant name="TRANSPARENCY_MAX" value="4" enum="Transparency">
+ <constant name="TRANSPARENCY_MAX" value="5" enum="Transparency">
Represents the size of the [enum Transparency] enum.
</constant>
<constant name="SHADING_MODE_UNSHADED" value="0" enum="ShadingMode">
@@ -550,6 +567,15 @@
<constant name="BLEND_MODE_MUL" value="3" enum="BlendMode">
The color of the object is multiplied by the background.
</constant>
+ <constant name="ALPHA_ANTIALIASING_OFF" value="0" enum="AlphaAntiAliasing">
+ Disables Alpha AntiAliasing for the material.
+ </constant>
+ <constant name="ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE" value="1" enum="AlphaAntiAliasing">
+ Enables AlphaToCoverage. Alpha values in the material are passed to the AntiAliasing sample mask.
+ </constant>
+ <constant name="ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE_AND_TO_ONE" value="2" enum="AlphaAntiAliasing">
+ Enables AlphaToCoverage and forces all non-zero alpha values to [code]1[/code]. Alpha values in the material are passed to the AntiAliasing sample mask.
+ </constant>
<constant name="DEPTH_DRAW_OPAQUE_ONLY" value="0" enum="DepthDrawMode">
Default depth draw mode. Depth is drawn only for opaque objects.
</constant>
diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml
index 3952ea2d27..877d3ca85a 100644
--- a/doc/classes/Basis.xml
+++ b/doc/classes/Basis.xml
@@ -4,32 +4,38 @@
3×3 matrix datatype.
</brief_description>
<description>
- 3×3 matrix used for 3D rotation and scale. Contains 3 vector fields X, Y and Z as its columns, which can be interpreted as the local basis vectors of a transformation. Can also be accessed as array of 3D vectors. These vectors are orthogonal to each other, but are not necessarily normalized (due to scaling). Almost always used as an orthogonal basis for a [Transform].
- For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S).
+ 3×3 matrix used for 3D rotation and scale. Almost always used as an orthogonal basis for a Transform.
+ Contains 3 vector fields X, Y and Z as its columns, which are typically interpreted as the local basis vectors of a transformation. For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S).
+ Can also be accessed as array of 3D vectors. These vectors are normally orthogonal to each other, but are not necessarily normalized (due to scaling).
+ For more information, read the "Matrices and transforms" documentation article.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Matrices and transforms">https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link>
+ <link title="Using 3D transforms">https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
+ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link>
</tutorials>
<methods>
- <method name="Basis">
+ <method name="Basis" qualifiers="constructor">
<return type="Basis">
</return>
- <argument index="0" name="from" type="Quat">
- </argument>
<description>
- Create a rotation matrix from the given quaternion.
+ Constructs a default-initialized [Basis] set to [constant IDENTITY].
</description>
</method>
- <method name="Basis">
+ <method name="Basis" qualifiers="constructor">
<return type="Basis">
</return>
- <argument index="0" name="from" type="Vector3">
+ <argument index="0" name="from" type="Basis">
</argument>
<description>
- Create a rotation matrix (in the YXZ convention: first Z, then X, and Y last) from the specified Euler angles, given in the vector format as (X angle, Y angle, Z angle).
+ Constructs a [Basis] as a copy of the given [Basis].
</description>
</method>
- <method name="Basis">
+ <method name="Basis" qualifiers="constructor">
<return type="Basis">
</return>
<argument index="0" name="axis" type="Vector3">
@@ -37,10 +43,29 @@
<argument index="1" name="phi" type="float">
</argument>
<description>
- Create a rotation matrix which rotates around the given axis by the specified angle, in radians. The axis must be a normalized vector.
+ Constructs a pure rotation basis matrix, rotated around the given [code]axis[/code] by [code]phi[/code], in radians. The axis must be a normalized vector.
+ </description>
+ </method>
+ <method name="Basis" qualifiers="constructor">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="euler" type="Vector3">
+ </argument>
+ <description>
+ Constructs a pure rotation basis matrix from the given Euler angles (in the YXZ convention: when *composing*, first Y, then X, and Z last), given in the vector format as (X angle, Y angle, Z angle).
+ Consider using the [Quat] constructor instead, which uses a quaternion instead of Euler angles.
+ </description>
+ </method>
+ <method name="Basis" qualifiers="constructor">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="from" type="Quat">
+ </argument>
+ <description>
+ Constructs a pure rotation basis matrix from the given quaternion.
</description>
</method>
- <method name="Basis">
+ <method name="Basis" qualifiers="constructor">
<return type="Basis">
</return>
<argument index="0" name="x_axis" type="Vector3">
@@ -50,28 +75,30 @@
<argument index="2" name="z_axis" type="Vector3">
</argument>
<description>
- Create a matrix from 3 axis vectors.
+ Constructs a basis matrix from 3 axis vectors (matrix columns).
</description>
</method>
<method name="determinant">
<return type="float">
</return>
<description>
- Returns the determinant of the matrix.
+ Returns the determinant of the basis matrix. If the basis is uniformly scaled, its determinant is the square of the scale.
+ A negative determinant means the basis has a negative scale. A zero determinant means the basis isn't invertible, and is usually considered invalid.
</description>
</method>
<method name="get_euler">
<return type="Vector3">
</return>
<description>
- Returns the basis's rotation in the form of Euler angles (in the YXZ convention: first Z, then X, and Y last). The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). See [method get_rotation_quat] if you need a quaternion instead.
+ Returns the basis's rotation in the form of Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last). The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle).
+ Consider using the [method get_rotation_quat] method instead, which returns a [Quat] quaternion instead of Euler angles.
</description>
</method>
<method name="get_orthogonal_index">
<return type="int">
</return>
<description>
- This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x,y,z) with each component being either -1, 0, or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the grid map editor. For further details, refer to the Godot source code.
+ This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x,y,z) with each component being either -1, 0, or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the [GridMap] editor. For further details, refer to the Godot source code.
</description>
</method>
<method name="get_rotation_quat">
@@ -100,12 +127,50 @@
</return>
<argument index="0" name="b" type="Basis">
</argument>
- <argument index="1" name="epsilon" type="float" default="1e-05">
- </argument>
<description>
Returns [code]true[/code] if this basis and [code]b[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Basis">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="right" type="Basis">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Basis">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="orthonormalized">
<return type="Basis">
</return>
@@ -178,40 +243,22 @@
Returns the transposed version of the matrix.
</description>
</method>
- <method name="xform">
- <return type="Vector3">
- </return>
- <argument index="0" name="v" type="Vector3">
- </argument>
- <description>
- Returns a vector transformed (multiplied) by the matrix.
- </description>
- </method>
- <method name="xform_inv">
- <return type="Vector3">
- </return>
- <argument index="0" name="v" type="Vector3">
- </argument>
- <description>
- Returns a vector transformed (multiplied) by the transposed matrix.
- [b]Note:[/b] This results in a multiplication by the inverse of the matrix only if it represents a rotation-reflection.
- </description>
- </method>
</methods>
<members>
<member name="x" type="Vector3" setter="" getter="" default="Vector3( 1, 0, 0 )">
- The basis matrix's X vector.
+ The basis matrix's X vector (column 0). Equivalent to array index [code]0[/code].
</member>
<member name="y" type="Vector3" setter="" getter="" default="Vector3( 0, 1, 0 )">
- The basis matrix's Y vector.
+ The basis matrix's Y vector (column 1). Equivalent to array index [code]1[/code].
</member>
<member name="z" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 1 )">
- The basis matrix's Z vector.
+ The basis matrix's Z vector (column 2). Equivalent to array index [code]2[/code].
</member>
</members>
<constants>
<constant name="IDENTITY" value="Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )">
- The identity basis. This is identical to calling [code]Basis()[/code] without any parameters. This constant can be used to make your code clearer.
+ The identity basis, with no rotation or scaling applied.
+ This is identical to calling [code]Basis()[/code] without any parameters. This constant can be used to make your code clearer, and for consistency with C#.
</constant>
<constant name="FLIP_X" value="Basis( -1, 0, 0, 0, 1, 0, 0, 0, 1 )">
The basis that will flip something along the X axis when used in a transformation.
diff --git a/doc/classes/BitMap.xml b/doc/classes/BitMap.xml
index f0ac7d1160..27ead07e6f 100644
--- a/doc/classes/BitMap.xml
+++ b/doc/classes/BitMap.xml
@@ -60,6 +60,7 @@
<argument index="1" name="rect" type="Rect2">
</argument>
<description>
+ Applies morphological dilation to the bitmap. The first argument is the dilation amount, Rect2 is the area where the dilation will be applied.
</description>
</method>
<method name="opaque_to_polygons" qualifiers="const">
diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml
index 421b405808..87cffdaca0 100644
--- a/doc/classes/BitmapFont.xml
+++ b/doc/classes/BitmapFont.xml
@@ -65,17 +65,6 @@
Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code].
</description>
</method>
- <method name="get_char_size" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="char" type="int">
- </argument>
- <argument index="1" name="next" type="int" default="0">
- </argument>
- <description>
- Returns the size of a character, optionally taking kerning into account if the next character is provided.
- </description>
- </method>
<method name="get_kerning_pair" qualifiers="const">
<return type="int">
</return>
diff --git a/doc/classes/BoxShape3D.xml b/doc/classes/BoxShape3D.xml
index fd08da148d..d8cbd8b980 100644
--- a/doc/classes/BoxShape3D.xml
+++ b/doc/classes/BoxShape3D.xml
@@ -7,6 +7,9 @@
3D box shape that can be a child of a [PhysicsBody3D] or [Area3D].
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml
index 675441d842..df47fa8bec 100644
--- a/doc/classes/Button.xml
+++ b/doc/classes/Button.xml
@@ -5,8 +5,39 @@
</brief_description>
<description>
Button is the standard themed button. It can contain text and an icon, and will display them according to the current [Theme].
+ [b]Example of creating a button and assigning an action when pressed by code:[/b]
+ [codeblocks]
+ [gdscript]
+ func _ready():
+ var button = Button.new()
+ button.text = "Click me"
+ button.connect("pressed", self, "_button_pressed")
+ add_child(button)
+
+ func _button_pressed():
+ print("Hello world!")
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ var button = new Button();
+ button.Text = "Click me";
+ button.Connect("pressed", this, nameof(ButtonPressed));
+ AddChild(button);
+ }
+
+ private void ButtonPressed()
+ {
+ GD.Print("Hello world!");
+ }
+ [/csharp]
+ [/codeblocks]
+ Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/ButtonGroup.xml b/doc/classes/ButtonGroup.xml
index b7f3234b36..5aa2d699a8 100644
--- a/doc/classes/ButtonGroup.xml
+++ b/doc/classes/ButtonGroup.xml
@@ -14,7 +14,7 @@
<return type="Array">
</return>
<description>
- Returns an [Array] of [Button]s who have this as their [ButtonGroup] (see [member BaseButton.group]).
+ Returns an [Array] of [Button]s who have this as their [ButtonGroup] (see [member BaseButton.button_group]).
</description>
</method>
<method name="get_pressed_button">
diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml
index c2b821699d..fcf2feb3b9 100644
--- a/doc/classes/CPUParticles2D.xml
+++ b/doc/classes/CPUParticles2D.xml
@@ -8,7 +8,7 @@
See also [GPUParticles2D], which provides the same functionality with hardware acceleration, but may not run on older devices.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/particle_systems_2d.html</link>
+ <link title="Particle systems (2D)">https://docs.godotengine.org/en/latest/tutorials/2d/particle_systems_2d.html</link>
</tutorials>
<methods>
<method name="convert_from_particles">
@@ -238,9 +238,6 @@
<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true">
If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates.
</member>
- <member name="normalmap" type="Texture2D" setter="set_normalmap" getter="get_normalmap">
- Normal map to be used for the [member texture] property.
- </member>
<member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false">
If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end.
</member>
diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml
index 3cc74beb58..f137ede90f 100644
--- a/doc/classes/Callable.xml
+++ b/doc/classes/Callable.xml
@@ -6,28 +6,67 @@
<description>
[Callable] is a first class object which can be held in variables and passed to functions. It represents a given method in an [Object], and is typically used for signal callbacks.
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
var callable = Callable(self, "print_args")
func print_args(arg1, arg2, arg3 = ""):
prints(arg1, arg2, arg3)
+
func test():
callable.call("hello", "world") # Prints "hello world".
callable.call(Vector2.UP, 42, callable) # Prints "(0, -1) 42 Node(Node.gd)::print_args".
callable.call("invalid") # Invalid call, should have at least 2 arguments.
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ Callable callable = new Callable(this, "print_args");
+ public void PrintArgs(object arg1, object arg2, object arg3 = "")
+ {
+ GD.PrintS(arg1, arg2, arg3);
+ }
+
+ public void Test()
+ {
+ callable.Call("hello", "world"); // Prints "hello world".
+ callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.gd)::print_args".
+ callable.Call("invalid"); // Invalid call, should have at least 2 arguments.
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
<methods>
- <method name="Callable">
+ <method name="Callable" qualifiers="constructor">
+ <return type="Callable">
+ </return>
+ <description>
+ Constructs a null [Callable] with no object nor method bound.
+ </description>
+ </method>
+ <method name="Callable" qualifiers="constructor">
+ <return type="Callable">
+ </return>
+ <argument index="0" name="from" type="Callable">
+ </argument>
+ <description>
+ Constructs a [Callable] as a copy of the given [Callable].
+ </description>
+ </method>
+ <method name="Callable" qualifiers="constructor">
<return type="Callable">
</return>
<argument index="0" name="object" type="Object">
</argument>
- <argument index="1" name="method_name" type="StringName">
+ <argument index="1" name="method" type="StringName">
</argument>
<description>
- Creates a new [Callable] for the method called [code]method_name[/code] in the specified [code]object[/code].
+ Creates a new [Callable] for the method called [code]method[/code] in the specified [code]object[/code].
+ </description>
+ </method>
+ <method name="bind" qualifiers="vararg">
+ <return type="Callable">
+ </return>
+ <description>
</description>
</method>
<method name="call" qualifiers="vararg">
@@ -89,6 +128,30 @@
<description>
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Callable">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Callable">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="unbind">
+ <return type="Callable">
+ </return>
+ <argument index="0" name="argcount" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml
index ad49216b34..c7ee915109 100644
--- a/doc/classes/Camera2D.xml
+++ b/doc/classes/Camera2D.xml
@@ -9,6 +9,9 @@
Note that the [Camera2D] node's [code]position[/code] doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [method get_camera_screen_center] to get the real position.
</description>
<tutorials>
+ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
+ <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link>
+ <link title="2D HDR Demo">https://godotengine.org/asset-library/asset/110</link>
</tutorials>
<methods>
<method name="align">
diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml
index bfba23c7ee..b3fe452b12 100644
--- a/doc/classes/Camera3D.xml
+++ b/doc/classes/Camera3D.xml
@@ -7,6 +7,7 @@
[Camera3D] is a special node that displays what is visible from its current location. Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. In other words, a camera just provides 3D display capabilities to a [Viewport], and, without one, a scene registered in that [Viewport] (or higher viewports) can't be displayed.
</description>
<tutorials>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="clear_current">
@@ -162,6 +163,13 @@
</argument>
<description>
Returns the 2D coordinate in the [Viewport] rectangle that maps to the given 3D point in worldspace.
+ [b]Note:[/b] When using this to position GUI elements over a 3D viewport, use [method is_position_behind] to prevent them from appearing if the 3D point is behind the camera:
+ [codeblock]
+ # This code block is part of a script that inherits from Node3D.
+ # `control` is a reference to a node inheriting from Control.
+ control.visible = not get_viewport().get_camera().is_position_behind(global_transform.origin)
+ control.rect_position = get_viewport().get_camera().unproject_position(global_transform.origin)
+ [/codeblock]
</description>
</method>
</methods>
@@ -176,6 +184,7 @@
If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular [code]_process[/code] methods. See [enum DopplerTracking] for possible values.
</member>
<member name="effects" type="CameraEffects" setter="set_effects" getter="get_effects">
+ The [CameraEffects] to use for this camera.
</member>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
The [Environment] to use for this camera.
@@ -183,8 +192,13 @@
<member name="far" type="float" setter="set_zfar" getter="get_zfar" default="100.0">
The distance to the far culling boundary for this camera relative to its local Z axis.
</member>
- <member name="fov" type="float" setter="set_fov" getter="get_fov" default="70.0">
+ <member name="fov" type="float" setter="set_fov" getter="get_fov" default="75.0">
The camera's field of view angle (in degrees). Only applicable in perspective mode. Since [member keep_aspect] locks one axis, [code]fov[/code] sets the other axis' field of view angle.
+ For reference, the default vertical field of view value ([code]75.0[/code]) is equivalent to an horizontal FOV of:
+ - ~91.31 degrees in a 4:3 viewport
+ - ~101.67 degrees in a 16:10 viewport
+ - ~107.51 degrees in a 16:9 viewport
+ - ~121.63 degrees in a 21:9 viewport
</member>
<member name="frustum_offset" type="Vector2" setter="set_frustum_offset" getter="get_frustum_offset" default="Vector2( 0, 0 )">
The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url].
diff --git a/doc/classes/CameraEffects.xml b/doc/classes/CameraEffects.xml
index ea9ab85b80..7a874d31db 100644
--- a/doc/classes/CameraEffects.xml
+++ b/doc/classes/CameraEffects.xml
@@ -34,9 +34,9 @@
The length of the transition between the near blur and no-blur area.
</member>
<member name="override_exposure" type="float" setter="set_override_exposure" getter="get_override_exposure" default="1.0">
- The exposure override value to use. Higher values will result in a brighter scene. Only effective if [member override_exposure_enable] is [code]true[/code].
+ The exposure override value to use. Higher values will result in a brighter scene. Only effective if [member override_exposure_enabled] is [code]true[/code].
</member>
- <member name="override_exposure_enable" type="bool" setter="set_override_exposure_enabled" getter="is_override_exposure_enabled" default="false">
+ <member name="override_exposure_enabled" type="bool" setter="set_override_exposure_enabled" getter="is_override_exposure_enabled" default="false">
If [code]true[/code], overrides the manual or automatic exposure defined in the [Environment] with the value in [member override_exposure].
</member>
</members>
diff --git a/doc/classes/CanvasGroup.xml b/doc/classes/CanvasGroup.xml
new file mode 100644
index 0000000000..ceeda6c3f5
--- /dev/null
+++ b/doc/classes/CanvasGroup.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CanvasGroup" inherits="Node2D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="clear_margin" type="float" setter="set_clear_margin" getter="get_clear_margin" default="10.0">
+ </member>
+ <member name="fit_margin" type="float" setter="set_fit_margin" getter="get_fit_margin" default="10.0">
+ </member>
+ <member name="use_mipmaps" type="bool" setter="set_use_mipmaps" getter="is_using_mipmaps" default="false">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 38e4453cf2..8efa1adae8 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -12,8 +12,9 @@
[b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GDScript.deg2rad].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
+ <link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
+ <link title="Custom drawing in 2D">https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
+ <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link>
</tutorials>
<methods>
<method name="_draw" qualifiers="virtual">
@@ -85,16 +86,6 @@
</argument>
<argument index="3" name="texture" type="Texture2D" default="null">
</argument>
- <argument index="4" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="5" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="7" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="8" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a colored polygon of any amount of points, convex or concave.
</description>
@@ -121,19 +112,9 @@
</argument>
<argument index="1" name="texture" type="Texture2D">
</argument>
- <argument index="2" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="3" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="4" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
+ <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
</argument>
- <argument index="5" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
- </argument>
- <argument index="6" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="7" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="8" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
+ <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
</argument>
<description>
Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for related documentation.
@@ -172,16 +153,6 @@
</argument>
<argument index="1" name="texture" type="Texture2D">
</argument>
- <argument index="2" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="3" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="4" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="5" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="6" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a [MultiMesh] in 2D with the provided texture. See [MultiMeshInstance2D] for related documentation.
</description>
@@ -197,16 +168,6 @@
</argument>
<argument index="3" name="texture" type="Texture2D" default="null">
</argument>
- <argument index="4" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="5" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="7" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="8" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a polygon of any amount of points, convex or concave.
</description>
@@ -250,16 +211,6 @@
</argument>
<argument index="4" name="width" type="float" default="1.0">
</argument>
- <argument index="5" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="7" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="8" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="9" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad.
</description>
@@ -285,9 +236,9 @@
</return>
<argument index="0" name="position" type="Vector2">
</argument>
- <argument index="1" name="rotation" type="float">
+ <argument index="1" name="rotation" type="float" default="0.0">
</argument>
- <argument index="2" name="scale" type="Vector2">
+ <argument index="2" name="scale" type="Vector2" default="Vector2( 1, 1 )">
</argument>
<description>
Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this.
@@ -316,7 +267,25 @@
<argument index="4" name="clip_w" type="int" default="-1">
</argument>
<description>
- Draws a string using a custom font.
+ Draws [code]text[/code] using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width.
+ [b]Example using the default project font:[/b]
+ [codeblocks]
+ [gdscript]
+ # If using this method in a script that redraws constantly, move the
+ # `default_font` declaration to a member variable assigned in `_ready()`
+ # so the Control is only created once.
+ var default_font = Control.new().get_font("font")
+ draw_string(default_font, Vector2(64, 64), "Hello world")
+ [/gdscript]
+ [csharp]
+ // If using this method in a script that redraws constantly, move the
+ // `default_font` declaration to a member variable assigned in `_ready()`
+ // so the Control is only created once.
+ Font defaultFont = new Control().GetFont("font");
+ DrawString(defaultFont, new Vector2(64, 64), "Hello world");
+ [/csharp]
+ [/codeblocks]
+ See also [method Font.draw].
</description>
</method>
<method name="draw_style_box">
@@ -339,16 +308,6 @@
</argument>
<argument index="2" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
</argument>
- <argument index="3" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="4" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="5" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="6" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="7" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a texture at a given position.
</description>
@@ -366,16 +325,6 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
- <argument index="5" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="7" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="8" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="9" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a textured rectangle at a given position, optionally modulated by a color. If [code]transpose[/code] is [code]true[/code], the texture will have its X and Y coordinates swapped.
</description>
@@ -393,17 +342,7 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
- <argument index="5" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="7" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="8" name="clip_uv" type="bool" default="true">
- </argument>
- <argument index="9" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="10" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
+ <argument index="5" name="clip_uv" type="bool" default="true">
</argument>
<description>
Draws a textured rectangle region at a given position, optionally modulated by a color. If [code]transpose[/code] is [code]true[/code], the texture will have its X and Y coordinates swapped.
@@ -507,13 +446,6 @@
Returns [code]true[/code] if local transform notifications are communicated to children.
</description>
</method>
- <method name="is_set_as_toplevel" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Returns [code]true[/code] if the node is set as top-level. See [method set_as_toplevel].
- </description>
- </method>
<method name="is_transform_notification_enabled" qualifiers="const">
<return type="bool">
</return>
@@ -525,7 +457,7 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and its inherited visibility is also [code]true[/code].
+ Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree.
</description>
</method>
<method name="make_canvas_position_local" qualifiers="const">
@@ -546,15 +478,6 @@
Transformations issued by [code]event[/code]'s inputs are applied in local space instead of global space.
</description>
</method>
- <method name="set_as_toplevel">
- <return type="void">
- </return>
- <argument index="0" name="enable" type="bool">
- </argument>
- <description>
- If [code]enable[/code] is [code]true[/code], the node won't inherit its transform from parent canvas items.
- </description>
- </method>
<method name="set_notify_local_transform">
<return type="void">
</return>
@@ -589,6 +512,8 @@
</method>
</methods>
<members>
+ <member name="clip_children" type="bool" setter="set_clip_children" getter="is_clipping_children" default="false">
+ </member>
<member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask" default="1">
The rendering layers in which this [CanvasItem] responds to [Light2D] nodes.
</member>
@@ -608,14 +533,20 @@
If [code]true[/code], the object draws on top of its parent.
</member>
<member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="CanvasItem.TextureFilter" default="0">
+ The texture filtering mode to use on this [CanvasItem].
</member>
<member name="texture_repeat" type="int" setter="set_texture_repeat" getter="get_texture_repeat" enum="CanvasItem.TextureRepeat" default="0">
+ The texture repeating mode to use on this [CanvasItem].
+ </member>
+ <member name="top_level" type="bool" setter="set_as_top_level" getter="is_set_as_top_level" default="false">
+ If [code]true[/code], the node will not inherit its transform from parent [CanvasItem]s.
</member>
<member name="use_parent_material" type="bool" setter="set_use_parent_material" getter="get_use_parent_material" default="false">
If [code]true[/code], the parent [CanvasItem]'s [member material] property is used as this one's material.
</member>
<member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true">
- If [code]true[/code], this [CanvasItem] is drawn. For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead.
+ If [code]true[/code], this [CanvasItem] is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]).
+ [b]Note:[/b] For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead.
</member>
</members>
<signals>
@@ -631,7 +562,7 @@
</signal>
<signal name="item_rect_changed">
<description>
- Emitted when the item rect has changed.
+ Emitted when the item's [Rect2] boundaries (position or size) have changed, or when an action is taking place that may have impacted these boundaries (e.g. changing [member Sprite2D.texture]).
</description>
</signal>
<signal name="visibility_changed">
@@ -666,12 +597,18 @@
The texture filter blends between the nearest four pixels. Use this for most cases where you want to avoid a pixelated style.
</constant>
<constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS" value="3" enum="TextureFilter">
+ The texture filter reads from the nearest pixel in the nearest mipmap. This is the fastest way to read from textures with mipmaps.
</constant>
<constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS" value="4" enum="TextureFilter">
+ The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.
</constant>
<constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC" value="5" enum="TextureFilter">
+ The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera.
+ [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate.
</constant>
<constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC" value="6" enum="TextureFilter">
+ The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing.
+ [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate.
</constant>
<constant name="TEXTURE_FILTER_MAX" value="7" enum="TextureFilter">
Represents the size of the [enum TextureFilter] enum.
diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml
index 8202a29d44..9d952cdba3 100644
--- a/doc/classes/CanvasLayer.xml
+++ b/doc/classes/CanvasLayer.xml
@@ -7,8 +7,9 @@
Canvas drawing layer. [CanvasItem] nodes that are direct or indirect children of a [CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a [CanvasLayer] with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below).
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/canvas_layers.html</link>
+ <link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
+ <link title="Canvas layers">https://docs.godotengine.org/en/latest/tutorials/2d/canvas_layers.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="get_canvas" qualifiers="const">
diff --git a/doc/classes/CanvasTexture.xml b/doc/classes/CanvasTexture.xml
new file mode 100644
index 0000000000..0ca132746b
--- /dev/null
+++ b/doc/classes/CanvasTexture.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CanvasTexture" inherits="Texture2D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="diffuse_texture" type="Texture2D" setter="set_diffuse_texture" getter="get_diffuse_texture">
+ </member>
+ <member name="normal_texture" type="Texture2D" setter="set_normal_texture" getter="get_normal_texture">
+ </member>
+ <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )">
+ </member>
+ <member name="specular_shininess" type="float" setter="set_specular_shininess" getter="get_specular_shininess" default="1.0">
+ </member>
+ <member name="specular_texture" type="Texture2D" setter="set_specular_texture" getter="get_specular_texture">
+ </member>
+ <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="CanvasItem.TextureFilter" default="0">
+ </member>
+ <member name="texture_repeat" type="int" setter="set_texture_repeat" getter="get_texture_repeat" enum="CanvasItem.TextureRepeat" default="0">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/CapsuleShape3D.xml b/doc/classes/CapsuleShape3D.xml
index f56d94dc63..27a6242bc9 100644
--- a/doc/classes/CapsuleShape3D.xml
+++ b/doc/classes/CapsuleShape3D.xml
@@ -7,6 +7,7 @@
Capsule shape for collisions.
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml
index c16e448498..d1759adf30 100644
--- a/doc/classes/CharFXTransform.xml
+++ b/doc/classes/CharFXTransform.xml
@@ -7,8 +7,8 @@
By setting various properties on this object, you can control how individual characters will be displayed in a [RichTextEffect].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link>
- <link>https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
+ <link title="BBCode in RichTextLabel">https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link>
+ <link title="RichTextEffect test project (third-party)">https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
</tutorials>
<methods>
</methods>
@@ -18,11 +18,18 @@
</member>
<member name="character" type="int" setter="set_character" getter="get_character" default="0">
The Unicode codepoint the character will use. This only affects non-whitespace characters. [method @GDScript.ord] can be useful here. For example, the following will replace all characters with asterisks:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`.
# See the RichTextEffect documentation for details.
char_fx.character = ord("*")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`.
+ // See the RichTextEffect documentation for details.
+ charFx.Character = char.GetNumericValue('*');
+ [/csharp]
+ [/codeblocks]
</member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )">
The color the character will be drawn with.
diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml
index 9c42091eb8..f912bb98c9 100644
--- a/doc/classes/CheckBox.xml
+++ b/doc/classes/CheckBox.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to [CheckButton] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has [b]no[/b] immediate effect on something. For instance, it should be used when toggling it will only do something once a confirmation button is pressed.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml
index 514ff9a691..b4f91cf3a8 100644
--- a/doc/classes/CheckButton.xml
+++ b/doc/classes/CheckButton.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
CheckButton is a toggle button displayed as a check field. It's similar to [CheckBox] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an [b]immediate[/b] effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/ClippedCamera3D.xml b/doc/classes/ClippedCamera3D.xml
index 58ecec828d..de90247536 100644
--- a/doc/classes/ClippedCamera3D.xml
+++ b/doc/classes/ClippedCamera3D.xml
@@ -90,7 +90,7 @@
If [code]true[/code], the camera stops on contact with [PhysicsBody3D]s.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected.
+ The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0">
The camera's collision margin. The camera can't get closer than this distance to a colliding object.
diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml
new file mode 100644
index 0000000000..f6bc9e2cca
--- /dev/null
+++ b/doc/classes/CodeEdit.xml
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CodeEdit" inherits="TextEdit" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="clear_bookmarked_lines">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="clear_breakpointed_lines">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="clear_executing_lines">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_bookmarked_lines" qualifiers="const">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_breakpointed_lines" qualifiers="const">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_executing_lines" qualifiers="const">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_line_bookmarked" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_line_breakpointed" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_line_executing" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_line_as_bookmarked">
+ <return type="void">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="bookmarked" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_line_as_breakpoint">
+ <return type="void">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="breakpointed" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_line_as_executing">
+ <return type="void">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="executing" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="draw_bookmarks" type="bool" setter="set_draw_bookmarks_gutter" getter="is_drawing_bookmarks_gutter" default="false">
+ </member>
+ <member name="draw_breakpoints_gutter" type="bool" setter="set_draw_breakpoints_gutter" getter="is_drawing_breakpoints_gutter" default="false">
+ </member>
+ <member name="draw_executing_lines" type="bool" setter="set_draw_executing_lines_gutter" getter="is_drawing_executing_lines_gutter" default="false">
+ </member>
+ <member name="draw_fold_gutter" type="bool" setter="set_draw_fold_gutter" getter="is_drawing_fold_gutter" default="false">
+ </member>
+ <member name="draw_line_numbers" type="bool" setter="set_draw_line_numbers" getter="is_draw_line_numbers_enabled" default="false">
+ </member>
+ <member name="zero_pad_line_numbers" type="bool" setter="set_line_numbers_zero_padded" getter="is_line_numbers_zero_padded" default="false">
+ </member>
+ </members>
+ <signals>
+ <signal name="breakpoint_toggled">
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+ <theme_items>
+ <theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 0 )">
+ </theme_item>
+ <theme_item name="bookmark" type="Texture2D">
+ </theme_item>
+ <theme_item name="bookmark_color" type="Color" default="Color( 0.5, 0.64, 1, 0.8 )">
+ </theme_item>
+ <theme_item name="brace_mismatch_color" type="Color" default="Color( 1, 0.2, 0.2, 1 )">
+ </theme_item>
+ <theme_item name="breakpoint" type="Texture2D">
+ </theme_item>
+ <theme_item name="breakpoint_color" type="Color" default="Color( 0.9, 0.29, 0.3, 1 )">
+ </theme_item>
+ <theme_item name="can_fold" type="Texture2D">
+ </theme_item>
+ <theme_item name="caret_background_color" type="Color" default="Color( 0, 0, 0, 1 )">
+ </theme_item>
+ <theme_item name="caret_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
+ </theme_item>
+ <theme_item name="code_folding_color" type="Color" default="Color( 0.8, 0.8, 0.8, 0.8 )">
+ </theme_item>
+ <theme_item name="completion" type="StyleBox">
+ </theme_item>
+ <theme_item name="completion_background_color" type="Color" default="Color( 0.17, 0.16, 0.2, 1 )">
+ </theme_item>
+ <theme_item name="completion_existing_color" type="Color" default="Color( 0.87, 0.87, 0.87, 0.13 )">
+ </theme_item>
+ <theme_item name="completion_font_color" type="Color" default="Color( 0.67, 0.67, 0.67, 1 )">
+ </theme_item>
+ <theme_item name="completion_lines" type="int" default="7">
+ </theme_item>
+ <theme_item name="completion_max_width" type="int" default="50">
+ </theme_item>
+ <theme_item name="completion_scroll_color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </theme_item>
+ <theme_item name="completion_scroll_width" type="int" default="3">
+ </theme_item>
+ <theme_item name="completion_selected_color" type="Color" default="Color( 0.26, 0.26, 0.27, 1 )">
+ </theme_item>
+ <theme_item name="current_line_color" type="Color" default="Color( 0.25, 0.25, 0.26, 0.8 )">
+ </theme_item>
+ <theme_item name="executing_line" type="Texture2D">
+ </theme_item>
+ <theme_item name="executing_line_color" type="Color" default="Color( 0.98, 0.89, 0.27, 1 )">
+ </theme_item>
+ <theme_item name="focus" type="StyleBox">
+ </theme_item>
+ <theme_item name="folded" type="Texture2D">
+ </theme_item>
+ <theme_item name="font" type="Font">
+ </theme_item>
+ <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
+ </theme_item>
+ <theme_item name="font_color_readonly" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )">
+ </theme_item>
+ <theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )">
+ </theme_item>
+ <theme_item name="line_number_color" type="Color" default="Color( 0.67, 0.67, 0.67, 0.4 )">
+ </theme_item>
+ <theme_item name="line_spacing" type="int" default="4">
+ </theme_item>
+ <theme_item name="mark_color" type="Color" default="Color( 1, 0.4, 0.4, 0.4 )">
+ </theme_item>
+ <theme_item name="normal" type="StyleBox">
+ </theme_item>
+ <theme_item name="read_only" type="StyleBox">
+ </theme_item>
+ <theme_item name="safe_line_number_color" type="Color" default="Color( 0.67, 0.78, 0.67, 0.6 )">
+ </theme_item>
+ <theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )">
+ </theme_item>
+ <theme_item name="space" type="Texture2D">
+ </theme_item>
+ <theme_item name="tab" type="Texture2D">
+ </theme_item>
+ <theme_item name="word_highlighted_color" type="Color" default="Color( 0.8, 0.9, 0.9, 0.15 )">
+ </theme_item>
+ </theme_items>
+</class>
diff --git a/doc/classes/CodeHighlighter.xml b/doc/classes/CodeHighlighter.xml
new file mode 100644
index 0000000000..7a1dad547b
--- /dev/null
+++ b/doc/classes/CodeHighlighter.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CodeHighlighter" inherits="SyntaxHighlighter" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_color_region">
+ <return type="void">
+ </return>
+ <argument index="0" name="p_start_key" type="String">
+ </argument>
+ <argument index="1" name="p_end_key" type="String">
+ </argument>
+ <argument index="2" name="p_color" type="Color">
+ </argument>
+ <argument index="3" name="p_line_only" type="bool" default="false">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="add_keyword_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="keyword" type="String">
+ </argument>
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="add_member_keyword_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="member_keyword" type="String">
+ </argument>
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="clear_color_regions">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="clear_keyword_colors">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="clear_member_keyword_colors">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_keyword_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <argument index="0" name="keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_member_keyword_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <argument index="0" name="member_keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_color_region" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="p_start_key" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_keyword_color" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_member_keyword_color" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="member_keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="remove_color_region">
+ <return type="void">
+ </return>
+ <argument index="0" name="p_start_key" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="remove_keyword_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="remove_member_keyword_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="member_keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="color_regions" type="Dictionary" setter="set_color_regions" getter="get_color_regions" default="{}">
+ </member>
+ <member name="function_color" type="Color" setter="set_function_color" getter="get_function_color" default="Color( 0, 0, 0, 1 )">
+ </member>
+ <member name="keyword_colors" type="Dictionary" setter="set_keyword_colors" getter="get_keyword_colors" default="{}">
+ </member>
+ <member name="member_keyword_colors" type="Dictionary" setter="set_member_keyword_colors" getter="get_member_keyword_colors" default="{}">
+ </member>
+ <member name="member_variable_color" type="Color" setter="set_member_variable_color" getter="get_member_variable_color" default="Color( 0, 0, 0, 1 )">
+ </member>
+ <member name="number_color" type="Color" setter="set_number_color" getter="get_number_color" default="Color( 0, 0, 0, 1 )">
+ </member>
+ <member name="symbol_color" type="Color" setter="set_symbol_color" getter="get_symbol_color" default="Color( 0, 0, 0, 1 )">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml
index e32ce9c9f9..c03eba82ff 100644
--- a/doc/classes/CollisionShape2D.xml
+++ b/doc/classes/CollisionShape2D.xml
@@ -7,13 +7,16 @@
Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area2D] to give it a detection shape, or add it to a [PhysicsBody2D] to create a solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject2D.shape_owner_get_shape] to get the actual shape.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/121</link>
+ <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
</methods>
<members>
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false">
- A disabled collision shape has no effect in the world.
+ A disabled collision shape has no effect in the world. This property should be changed with [method Object.set_deferred].
</member>
<member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" default="false">
Sets whether this collision shape should only detect collision on one side (top or bottom).
diff --git a/doc/classes/CollisionShape3D.xml b/doc/classes/CollisionShape3D.xml
index 76515a65a7..5590947a4f 100644
--- a/doc/classes/CollisionShape3D.xml
+++ b/doc/classes/CollisionShape3D.xml
@@ -7,10 +7,13 @@
Editor facility for creating and editing collision shapes in 3D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area3D] to give it a detection shape, or add it to a [PhysicsBody3D] to create a solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject3D.shape_owner_get_shape] to get the actual shape.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
- <method name="make_convex_from_brothers">
+ <method name="make_convex_from_siblings">
<return type="void">
</return>
<description>
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index d495be2ffd..9705a196ed 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -1,45 +1,57 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Color" version="4.0">
<brief_description>
- Color in RGBA format with some support for ARGB format.
+ Color in RGBA format using floats on the range of 0 to 1.
</brief_description>
<description>
- A color is represented by red, green, and blue [code](r, g, b)[/code] components. Additionally, [code]a[/code] represents the alpha component, often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as [member CanvasItem.modulate]) may accept values greater than 1.
- You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url].
+ A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors).
+ You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url].
If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8].
+ [b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it's equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code].
+ [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/color_constants.png]Color constants cheatsheet[/url]
</description>
<tutorials>
+ <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/517</link>
+ <link title="Tween Demo">https://godotengine.org/asset-library/asset/146</link>
+ <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/133</link>
</tutorials>
<methods>
- <method name="Color">
+ <method name="Color" qualifiers="constructor">
<return type="Color">
</return>
- <argument index="0" name="from" type="String">
+ <description>
+ Constructs a default-initialized [Color] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Color" qualifiers="constructor">
+ <return type="Color">
+ </return>
+ <argument index="0" name="from" type="Color">
</argument>
<description>
- Constructs a color from an HTML hexadecimal color string in ARGB or RGB format. See also [method @GDScript.ColorN].
- [codeblock]
- # Each of the following creates the same color RGBA(178, 217, 10, 255).
- var c1 = Color("#ffb2d90a") # ARGB format with "#".
- var c2 = Color("ffb2d90a") # ARGB format.
- var c3 = Color("#b2d90a") # RGB format with "#".
- var c4 = Color("b2d90a") # RGB format.
- [/codeblock]
+ Constructs a [Color] as a copy of the given [Color].
</description>
</method>
- <method name="Color">
+ <method name="Color" qualifiers="constructor">
<return type="Color">
</return>
- <argument index="0" name="from" type="int">
+ <argument index="0" name="from" type="Color">
+ </argument>
+ <argument index="1" name="alpha" type="float">
</argument>
<description>
- Constructs a color from a 32-bit integer (each byte represents a component of the RGBA profile).
- [codeblock]
- var c = Color(274) # Equivalent to RGBA(0, 0, 1, 18)
- [/codeblock]
+ Constructs a [Color] from an existing color, but with a custom alpha value.
+ [codeblocks]
+ [gdscript]
+ var red = Color(Color.red, 0.5) # 50% transparent red.
+ [/gdscript]
+ [csharp]
+ var red = new Color(Colors.Red, 0.5f); // 50% transparent red.
+ [/csharp]
+ [/codeblocks]
</description>
</method>
- <method name="Color">
+ <method name="Color" qualifiers="constructor">
<return type="Color">
</return>
<argument index="0" name="r" type="float">
@@ -48,14 +60,21 @@
</argument>
<argument index="2" name="b" type="float">
</argument>
+ <argument index="3" name="a" type="float">
+ </argument>
<description>
- Constructs a color from an RGB profile using values between 0 and 1. Alpha will always be 1.
- [codeblock]
- var c = Color(0.2, 1.0, 0.7) # Equivalent to RGBA(51, 255, 178, 255)
- [/codeblock]
+ Constructs a [Color] from RGBA values, typically between 0 and 1.
+ [codeblocks]
+ [gdscript]
+ var color = Color(0.2, 1.0, 0.7, 0.8) # Similar to `Color8(51, 255, 178, 204)`
+ [/gdscript]
+ [csharp]
+ var color = new Color(0.2f, 1.0f, 0.7f, 0.8f); // Similar to `Color.Color8(51, 255, 178, 255, 204)`
+ [/csharp]
+ [/codeblocks]
</description>
</method>
- <method name="Color">
+ <method name="Color" qualifiers="constructor">
<return type="Color">
</return>
<argument index="0" name="r" type="float">
@@ -64,13 +83,16 @@
</argument>
<argument index="2" name="b" type="float">
</argument>
- <argument index="3" name="a" type="float">
- </argument>
<description>
- Constructs a color from an RGBA profile using values between 0 and 1.
- [codeblock]
- var c = Color(0.2, 1.0, 0.7, 0.8) # Equivalent to RGBA(51, 255, 178, 204)
- [/codeblock]
+ Constructs a [Color] from RGB values, typically between 0 and 1. Alpha will be 1.
+ [codeblocks]
+ [gdscript]
+ var color = Color(0.2, 1.0, 0.7) # Similar to `Color8(51, 255, 178, 255)`
+ [/gdscript]
+ [csharp]
+ var color = new Color(0.2f, 1.0f, 0.7f); // Similar to `Color.Color8(51, 255, 178, 255)`
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="blend">
@@ -80,146 +102,265 @@
</argument>
<description>
Returns a new color resulting from blending this color over another. If the color is opaque, the result is also opaque. The second color may have a range of alpha values.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50%
var fg = Color(1.0, 0.0, 0.0, 0.5) # Red with alpha of 50%
var blended_color = bg.blend(fg) # Brown with alpha of 75%
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var bg = new Color(0.0f, 1.0f, 0.0f, 0.5f); // Green with alpha of 50%
+ var fg = new Color(1.0f, 0.0f, 0.0f, 0.5f); // Red with alpha of 50%
+ Color blendedColor = bg.Blend(fg); // Brown with alpha of 75%
+ [/csharp]
+ [/codeblocks]
</description>
</method>
- <method name="contrasted">
+ <method name="darkened">
<return type="Color">
</return>
+ <argument index="0" name="amount" type="float">
+ </argument>
<description>
- Returns the most contrasting color.
- [codeblock]
- var c = Color(0.3, 0.4, 0.9)
- var contrasted_color = c.contrasted() # Equivalent to RGBA(204, 229, 102, 255)
- [/codeblock]
+ Returns a new color resulting from making this color darker by the specified percentage (ratio from 0 to 1).
+ [codeblocks]
+ [gdscript]
+ var green = Color(0.0, 1.0, 0.0)
+ var darkgreen = green.darkened(0.2) # 20% darker than regular green
+ [/gdscript]
+ [csharp]
+ var green = new Color(0.0f, 1.0f, 0.0f);
+ Color darkgreen = green.Darkened(0.2f); // 20% darker than regular green
+ [/csharp]
+ [/codeblocks]
</description>
</method>
- <method name="darkened">
+ <method name="inverted">
+ <return type="Color">
+ </return>
+ <description>
+ Returns the inverted color [code](1 - r, 1 - g, 1 - b, a)[/code].
+ [codeblocks]
+ [gdscript]
+ var color = Color(0.3, 0.4, 0.9)
+ var inverted_color = color.inverted() # Equivalent to `Color(0.7, 0.6, 0.1)`
+ [/gdscript]
+ [csharp]
+ var color = new Color(0.3f, 0.4f, 0.9f);
+ Color invertedColor = color.Inverted(); // Equivalent to `new Color(0.7f, 0.6f, 0.1f)`
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="is_equal_approx">
+ <return type="bool">
+ </return>
+ <argument index="0" name="to" type="Color">
+ </argument>
+ <description>
+ Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
+ </description>
+ </method>
+ <method name="lerp">
+ <return type="Color">
+ </return>
+ <argument index="0" name="b" type="Color">
+ </argument>
+ <argument index="1" name="t" type="float">
+ </argument>
+ <description>
+ Returns the linear interpolation with another color. The interpolation factor [code]t[/code] is between 0 and 1.
+ [codeblocks]
+ [gdscript]
+ var c1 = Color(1.0, 0.0, 0.0)
+ var c2 = Color(0.0, 1.0, 0.0)
+ var lerp_color = c1.lerp(c2, 0.5) # Equivalent to `Color(0.5, 0.5, 0.0)`
+ [/gdscript]
+ [csharp]
+ var c1 = new Color(1.0f, 0.0f, 0.0f);
+ var c2 = new Color(0.0f, 1.0f, 0.0f);
+ Color lerpColor = c1.Lerp(c2, 0.5f); // Equivalent to `new Color(0.5f, 0.5f, 0.0f)`
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="lightened">
<return type="Color">
</return>
<argument index="0" name="amount" type="float">
</argument>
<description>
- Returns a new color resulting from making this color darker by the specified percentage (ratio from 0 to 1).
- [codeblock]
+ Returns a new color resulting from making this color lighter by the specified percentage (ratio from 0 to 1).
+ [codeblocks]
+ [gdscript]
var green = Color(0.0, 1.0, 0.0)
- var darkgreen = green.darkened(0.2) # 20% darker than regular green
- [/codeblock]
+ var lightgreen = green.lightened(0.2) # 20% lighter than regular green
+ [/gdscript]
+ [csharp]
+ var green = new Color(0.0f, 1.0f, 0.0f);
+ Color lightgreen = green.Lightened(0.2f); // 20% lighter than regular green
+ [/csharp]
+ [/codeblocks]
</description>
</method>
- <method name="from_hsv">
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
<return type="Color">
</return>
- <argument index="0" name="h" type="float">
+ <argument index="0" name="right" type="Color">
</argument>
- <argument index="1" name="s" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="float">
</argument>
- <argument index="2" name="v" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="int">
</argument>
- <argument index="3" name="a" type="float" default="1.0">
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="Color">
</argument>
<description>
- Constructs a color from an HSV profile. [code]h[/code], [code]s[/code], and [code]v[/code] are values between 0 and 1.
- [codeblock]
- var c = Color.from_hsv(0.58, 0.5, 0.79, 0.8) # Equivalent to HSV(210, 50, 79, 0.8) or Color8(100, 151, 201, 0.8)
- [/codeblock]
</description>
</method>
- <method name="inverted">
+ <method name="operator -" qualifiers="operator">
<return type="Color">
</return>
<description>
- Returns the inverted color [code](1 - r, 1 - g, 1 - b, a)[/code].
- [codeblock]
- var c = Color(0.3, 0.4, 0.9)
- var inverted_color = c.inverted() # A color of an RGBA(178, 153, 26, 255)
- [/codeblock]
</description>
</method>
- <method name="is_equal_approx">
- <return type="bool">
+ <method name="operator /" qualifiers="operator">
+ <return type="Color">
</return>
- <argument index="0" name="color" type="Color">
+ <argument index="0" name="right" type="Color">
</argument>
<description>
- Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
</description>
</method>
- <method name="lightened">
+ <method name="operator /" qualifiers="operator">
<return type="Color">
</return>
- <argument index="0" name="amount" type="float">
+ <argument index="0" name="right" type="float">
</argument>
<description>
- Returns a new color resulting from making this color lighter by the specified percentage (ratio from 0 to 1).
- [codeblock]
- var green = Color(0.0, 1.0, 0.0)
- var lightgreen = green.lightened(0.2) # 20% lighter than regular green
- [/codeblock]
</description>
</method>
- <method name="linear_interpolate">
+ <method name="operator /" qualifiers="operator">
<return type="Color">
</return>
- <argument index="0" name="b" type="Color">
+ <argument index="0" name="right" type="int">
</argument>
- <argument index="1" name="t" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
</argument>
<description>
- Returns the linear interpolation with another color. The interpolation factor [code]t[/code] is between 0 and 1.
- [codeblock]
- var c1 = Color(1.0, 0.0, 0.0)
- var c2 = Color(0.0, 1.0, 0.0)
- var li_c = c1.linear_interpolate(c2, 0.5) # A color of an RGBA(128, 128, 0, 255)
- [/codeblock]
</description>
</method>
<method name="to_abgr32">
<return type="int">
</return>
<description>
- Returns the color's 32-bit integer in ABGR format (each byte represents a component of the ABGR profile). ABGR is the reversed version of the default format.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_abgr32()) # Prints 4281565439
- [/codeblock]
+ Returns the color converted to a 32-bit integer in ABGR format (each byte represents a color channel). ABGR is the reversed version of the default format.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_abgr32()) # Prints 4281565439
+ [/gdscript]
+ [csharp]
+ var color = new Color(1.0f, 0.5f, 0.2f);
+ GD.Print(color.ToAbgr32()); // Prints 4281565439
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_abgr64">
<return type="int">
</return>
<description>
- Returns the color's 64-bit integer in ABGR format (each word represents a component of the ABGR profile). ABGR is the reversed version of the default format.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_abgr64()) # Prints -225178692812801
- [/codeblock]
+ Returns the color converted to a 64-bit integer in ABGR format (each word represents a color channel). ABGR is the reversed version of the default format.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_abgr64()) # Prints -225178692812801
+ [/gdscript]
+ [csharp]
+ var color = new Color(1.0f, 0.5f, 0.2f);
+ GD.Print(color.ToAbgr64()); // Prints -225178692812801
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_argb32">
<return type="int">
</return>
<description>
- Returns the color's 32-bit integer in ARGB format (each byte represents a component of the ARGB profile). ARGB is more compatible with DirectX.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_argb32()) # Prints 4294934323
- [/codeblock]
+ Returns the color converted to a 32-bit integer in ARGB format (each byte represents a color channel). ARGB is more compatible with DirectX.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_argb32()) # Prints 4294934323
+ [/gdscript]
+ [csharp]
+ var color = new Color(1.0f, 0.5f, 0.2f);
+ GD.Print(color.ToArgb32()); // Prints 4294934323
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_argb64">
<return type="int">
</return>
<description>
- Returns the color's 64-bit integer in ARGB format (each word represents a component of the ARGB profile). ARGB is more compatible with DirectX.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_argb64()) # Prints -2147470541
- [/codeblock]
+ Returns the color converted to a 64-bit integer in ARGB format (each word represents a color channel). ARGB is more compatible with DirectX.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_argb64()) # Prints -2147470541
+ [/gdscript]
+ [csharp]
+ var color = new Color(1.0f, 0.5f, 0.2f);
+ GD.Print(color.ToArgb64()); // Prints -2147470541
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_html">
@@ -228,71 +369,90 @@
<argument index="0" name="with_alpha" type="bool" default="true">
</argument>
<description>
- Returns the color's HTML hexadecimal color string in ARGB format (ex: [code]ff34f822[/code]).
- Setting [code]with_alpha[/code] to [code]false[/code] excludes alpha from the hexadecimal string.
- [codeblock]
- var c = Color(1, 1, 1, 0.5)
- var s1 = c.to_html() # Returns "7fffffff"
- var s2 = c.to_html(false) # Returns "ffffff"
- [/codeblock]
+ Returns the color converted to an HTML hexadecimal color string in RGBA format (ex: [code]ff34f822[/code]).
+ Setting [code]with_alpha[/code] to [code]false[/code] excludes alpha from the hexadecimal string (and uses RGB instead of RGBA format).
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 1, 1, 0.5)
+ var with_alpha = color.to_html() # Returns "ffffff7f"
+ var without_alpha = color.to_html(false) # Returns "ffffff"
+ [/gdscript]
+ [csharp]
+ var color = new Color(1, 1, 1, 0.5f);
+ String withAlpha = color.ToHtml(); // Returns "ffffff7f"
+ String withoutAlpha = color.ToHtml(false); // Returns "ffffff"
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_rgba32">
<return type="int">
</return>
<description>
- Returns the color's 32-bit integer in RGBA format (each byte represents a component of the RGBA profile). RGBA is Godot's default format.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_rgba32()) # Prints 4286526463
- [/codeblock]
+ Returns the color converted to a 32-bit integer in RGBA format (each byte represents a color channel). RGBA is Godot's default format.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_rgba32()) # Prints 4286526463
+ [/gdscript]
+ [csharp]
+ var color = new Color(1, 0.5f, 0.2f);
+ GD.Print(color.ToRgba32()); // Prints 4286526463
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_rgba64">
<return type="int">
</return>
<description>
- Returns the color's 64-bit integer in RGBA format (each word represents a component of the RGBA profile). RGBA is Godot's default format.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_rgba64()) # Prints -140736629309441
- [/codeblock]
+ Returns the color converted to a 64-bit integer in RGBA format (each word represents a color channel). RGBA is Godot's default format.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_rgba64()) # Prints -140736629309441
+ [/gdscript]
+ [csharp]
+ var color = new Color(1, 0.5f, 0.2f);
+ GD.Print(color.ToRgba64()); // Prints -140736629309441
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
<members>
<member name="a" type="float" setter="" getter="" default="1.0">
- Alpha value (range 0 to 1).
+ The color's alpha (transparency) component, typically on the range of 0 to 1.
</member>
<member name="a8" type="int" setter="" getter="" default="255">
- Alpha value (range 0 to 255).
+ Wrapper for [member a] that uses the range 0 to 255 instead of 0 to 1.
</member>
<member name="b" type="float" setter="" getter="" default="0.0">
- Blue value (range 0 to 1).
+ The color's blue component, typically on the range of 0 to 1.
</member>
<member name="b8" type="int" setter="" getter="" default="0">
- Blue value (range 0 to 255).
+ Wrapper for [member b] that uses the range 0 to 255 instead of 0 to 1.
</member>
<member name="g" type="float" setter="" getter="" default="0.0">
- Green value (range 0 to 1).
+ The color's green component, typically on the range of 0 to 1.
</member>
<member name="g8" type="int" setter="" getter="" default="0">
- Green value (range 0 to 255).
+ Wrapper for [member g] that uses the range 0 to 255 instead of 0 to 1.
</member>
<member name="h" type="float" setter="" getter="" default="0.0">
- HSV hue value (range 0 to 1).
+ The HSV hue of this color, on the range 0 to 1.
</member>
<member name="r" type="float" setter="" getter="" default="0.0">
- Red value (range 0 to 1).
+ The color's red component, typically on the range of 0 to 1.
</member>
<member name="r8" type="int" setter="" getter="" default="0">
- Red value (range 0 to 255).
+ Wrapper for [member r] that uses the range 0 to 255 instead of 0 to 1.
</member>
<member name="s" type="float" setter="" getter="" default="0.0">
- HSV saturation value (range 0 to 1).
+ The HSV saturation of this color, on the range 0 to 1.
</member>
<member name="v" type="float" setter="" getter="" default="0.0">
- HSV value (range 0 to 1).
+ The HSV value (brightness) of this color, on the range 0 to 1.
</member>
</members>
<constants>
diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml
index d8b4a8f76c..aea3542867 100644
--- a/doc/classes/ColorPicker.xml
+++ b/doc/classes/ColorPicker.xml
@@ -7,6 +7,7 @@
Displays a color picker widget. Useful for selecting a color from an RGB/RGBA colorspace.
</description>
<tutorials>
+ <link title="Tween Demo">https://godotengine.org/asset-library/asset/146</link>
</tutorials>
<methods>
<method name="add_preset">
diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml
index 67f64c8a66..76cc49a043 100644
--- a/doc/classes/ColorPickerButton.xml
+++ b/doc/classes/ColorPickerButton.xml
@@ -5,8 +5,11 @@
</brief_description>
<description>
Encapsulates a [ColorPicker] making it accessible by pressing a button. Pressing the button will toggle the [ColorPicker] visibility.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
+ <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/133</link>
+ <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/517</link>
</tutorials>
<methods>
<method name="get_picker">
diff --git a/doc/classes/ColorRect.xml b/doc/classes/ColorRect.xml
index 92f42b6dd3..09ba4c8b26 100644
--- a/doc/classes/ColorRect.xml
+++ b/doc/classes/ColorRect.xml
@@ -4,18 +4,24 @@
Colored rectangle.
</brief_description>
<description>
- Displays a colored rectangle.
+ Displays a rectangle filled with a solid [member color]. If you need to display the border alone, consider using [ReferenceRect] instead.
</description>
<tutorials>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
</methods>
<members>
- <member name="color" type="Color" setter="set_frame_color" getter="get_frame_color" default="Color( 1, 1, 1, 1 )">
+ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
The fill color.
- [codeblock]
+ [codeblocks]
+ [gdscript]
$ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect's color to red.
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GetNode&lt;ColorRect&gt;("ColorRect").Color = new Color(1, 0, 0, 1); // Set ColorRect's color to red.
+ [/csharp]
+ [/codeblocks]
</member>
</members>
<constants>
diff --git a/doc/classes/ConcavePolygonShape3D.xml b/doc/classes/ConcavePolygonShape3D.xml
index 20402d350a..3e83202472 100644
--- a/doc/classes/ConcavePolygonShape3D.xml
+++ b/doc/classes/ConcavePolygonShape3D.xml
@@ -8,6 +8,7 @@
Note: when used for collision, [ConcavePolygonShape3D] is intended to work with static [PhysicsBody3D] nodes like [StaticBody3D] and will not work with [KinematicBody3D] or [RigidBody3D] with a mode other than Static.
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
</tutorials>
<methods>
<method name="get_faces" qualifiers="const">
diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml
index 522d484131..da17d993e3 100644
--- a/doc/classes/ConfigFile.xml
+++ b/doc/classes/ConfigFile.xml
@@ -13,7 +13,8 @@
[/codeblock]
The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used directly without accessing the filesystem.
The following example shows how to parse an INI-style file from the system, read its contents and store new values in it:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var config = ConfigFile.new()
var err = config.load("user://settings.cfg")
if err == OK: # If not, something went wrong with the file loading
@@ -24,7 +25,24 @@
config.set_value("audio", "mute", false)
# Save the changes by overwriting the previous file
config.save("user://settings.cfg")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var config = new ConfigFile();
+ Error err = config.Load("user://settings.cfg");
+ if (err == Error.Ok) // If not, something went wrong with the file loading
+ {
+ // Look for the display/width pair, and default to 1024 if missing
+ int screenWidth = (int)config.GetValue("display", "width", 1024);
+ // Store a variable if and only if it hasn't been defined yet
+ if (!config.HasSectionKey("audio", "mute"))
+ {
+ config.SetValue("audio", "mute", false);
+ }
+ // Save the changes by overwriting the previous file
+ config.Save("user://settings.cfg");
+ }
+ [/csharp]
+ [/codeblocks]
Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load.
ConfigFiles can also contain manually written comment lines starting with a semicolon ([code];[/code]). Those lines will be ignored when parsing the file. Note that comments will be lost when saving the ConfigFile. This can still be useful for dedicated server configuration files, which are typically never overwritten without explicit user action.
</description>
diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml
index 6d5871508b..a850afdd9f 100644
--- a/doc/classes/ConfirmationDialog.xml
+++ b/doc/classes/ConfirmationDialog.xml
@@ -6,9 +6,14 @@
<description>
Dialog for confirmation of actions. This dialog inherits from [AcceptDialog], but has by default an OK and Cancel button (in host OS order).
To get cancel action, you can use:
- [codeblock]
+ [codeblocks]
+ [gdscript]
get_cancel().connect("pressed", self, "cancelled")
- [/codeblock].
+ [/gdscript]
+ [csharp]
+ GetCancel().Connect("pressed", this, nameof(Cancelled));
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index 0c8d42021a..eb0b941da5 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -13,10 +13,12 @@
Only one [Control] node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus.
Sets [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] to tell a [Control] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button.
[Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_theme_*_override[/code] methods, like [method add_theme_font_override]. You can override the theme with the inspector.
+ [b]Note:[/b] Theme items are [i]not[/i] [Object] properties. This means you can't access their values using [method Object.get] and [method Object.set]. Instead, use the [code]get_theme_*[/code] and [code]add_theme_*_override[/code] methods provided by this class.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/gui/index.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
+ <link title="GUI tutorial index">https://docs.godotengine.org/en/latest/tutorials/gui/index.html</link>
+ <link title="Custom drawing in 2D">https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
+ <link title="All GUI Demos">https://github.com/godotengine/godot-demo-projects/tree/master/gui</link>
</tutorials>
<methods>
<method name="_clips_input" qualifiers="virtual">
@@ -43,12 +45,27 @@
<description>
Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [method accept_event].
Example: clicking a control.
- [codeblock]
+ [codeblocks]
+ [gdscript]
func _gui_input(event):
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:
print("I've been clicked D:")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void _GuiInput(InputEvent @event)
+ {
+ if (@event is InputEventMouseButton)
+ {
+ var mb = @event as InputEventMouseButton;
+ if (mb.ButtonIndex == (int)ButtonList.Left &amp;&amp; mb.Pressed)
+ {
+ GD.Print("I've been clicked D:");
+ }
+ }
+ }
+ [/csharp]
+ [/codeblocks]
The event won't trigger if:
* clicking outside the control (see [method has_point]);
* control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE];
@@ -58,28 +75,50 @@
</description>
</method>
<method name="_make_custom_tooltip" qualifiers="virtual">
- <return type="Object">
+ <return type="Control">
</return>
<argument index="0" name="for_text" type="String">
</argument>
<description>
- Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. Use [code]for_text[/code] parameter to determine what text the tooltip should contain (likely the contents of [member hint_tooltip]).
- The returned node must be of type [Control] or Control-derieved. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance, not e.g. a node from scene. When [code]null[/code] or non-Control node is returned, the default tooltip will be used instead.
+ Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [code]for_text[/code] includes the contents of the [member hint_tooltip] property.
+ The returned node must be of type [Control] or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance).When [code]null[/code] or a non-Control node is returned, the default tooltip will be used instead.
+ The returned node will be added as child to a [PopupPanel], so you should only provide the contents of that panel. That [PopupPanel] can be themed using [method Theme.set_stylebox] for the type [code]"TooltipPanel"[/code] (see [member hint_tooltip] for an example).
[b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member rect_min_size] to some non-zero value.
- Example of usage with custom-constructed node:
- [codeblock]
+ [b]Note:[/b] The node (and any relevant children) should be [member CanvasItem.visible] when returned, otherwise the viewport that instantiates it will not be able to calculate its minimum size reliably.
+ Example of usage with a custom-constructed node:
+ [codeblocks]
+ [gdscript]
func _make_custom_tooltip(for_text):
var label = Label.new()
label.text = for_text
return label
- [/codeblock]
- Example of usage with custom scene instance:
- [codeblock]
+ [/gdscript]
+ [csharp]
+ public override Godot.Control _MakeCustomTooltip(String forText)
+ {
+ var label = new Label();
+ label.Text = forText;
+ return label;
+ }
+ [/csharp]
+ [/codeblocks]
+ Example of usage with a custom scene instance:
+ [codeblocks]
+ [gdscript]
func _make_custom_tooltip(for_text):
- var tooltip = preload("SomeTooltipScene.tscn").instance()
+ var tooltip = preload("res://SomeTooltipScene.tscn").instance()
tooltip.get_node("Label").text = for_text
return tooltip
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override Godot.Control _MakeCustomTooltip(String forText)
+ {
+ Node tooltip = ResourceLoader.Load&lt;PackedScene&gt;("res://SomeTooltipScene.tscn").Instance();
+ tooltip.GetNode&lt;Label&gt;("Label").Text = forText;
+ return tooltip;
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="accept_event">
@@ -97,7 +136,25 @@
<argument index="1" name="color" type="Color">
</argument>
<description>
- Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses. If the [code]color[/code] is empty or invalid, the override is cleared and the color from assigned [Theme] is used.
+ Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses.
+ [b]Note:[/b] Unlike other theme overrides, there is no way to undo a color override without manually assigning the previous color.
+ [b]Example of overriding a label's color and resetting it later:[/b]
+ [codeblocks]
+ [gdscript]
+ # Override the child node "MyLabel"'s font color to orange.
+ $MyLabel.add_theme_color_override("font_color", Color(1, 0.5, 0))
+ # Reset the color by creating a new node to get the default value:
+ var default_label_color = Label.new().get_theme_color("font_color")
+ $MyLabel.add_theme_color_override("font_color", default_label_color)
+ [/gdscript]
+ [csharp]
+ // Override the child node "MyLabel"'s font color to orange.
+ GetNode&lt;Label&gt;("MyLabel").AddThemeColorOverride("font_color", new Color(1, 0.5f, 0));
+ // Reset the color by creating a new node to get the default value:
+ var defaultLabelColor = new Label().GetThemeColor("font_color");
+ GetNode&lt;Label&gt;("MyLabel").AddThemeColorOverride("font_color", defaultLabelColor);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="add_theme_constant_override">
@@ -108,7 +165,7 @@
<argument index="1" name="constant" type="int">
</argument>
<description>
- Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses. If the [code]constant[/code] is empty or invalid, the override is cleared and the constant from assigned [Theme] is used.
+ Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses. If the [code]constant[/code] is [code]0[/code], the override is cleared and the constant from assigned [Theme] is used.
</description>
</method>
<method name="add_theme_font_override">
@@ -119,7 +176,7 @@
<argument index="1" name="font" type="Font">
</argument>
<description>
- Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is empty or invalid, the override is cleared and the font from assigned [Theme] is used.
+ Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is [code]null[/code] or invalid, the override is cleared and the font from assigned [Theme] is used.
</description>
</method>
<method name="add_theme_icon_override">
@@ -130,7 +187,7 @@
<argument index="1" name="texture" type="Texture2D">
</argument>
<description>
- Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. If [code]icon[/code] is empty or invalid, the override is cleared and the icon from assigned [Theme] is used.
+ Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. If [code]icon[/code] is [code]null[/code] or invalid, the override is cleared and the icon from assigned [Theme] is used.
</description>
</method>
<method name="add_theme_shader_override">
@@ -141,7 +198,7 @@
<argument index="1" name="shader" type="Shader">
</argument>
<description>
- Overrides the [Shader] with given [code]name[/code] in the [member theme] resource the control uses. If [code]shader[/code] is empty or invalid, the override is cleared and the shader from assigned [Theme] is used.
+ Overrides the [Shader] with given [code]name[/code] in the [member theme] resource the control uses. If [code]shader[/code] is [code]null[/code] or invalid, the override is cleared and the shader from assigned [Theme] is used.
</description>
</method>
<method name="add_theme_stylebox_override">
@@ -153,6 +210,31 @@
</argument>
<description>
Overrides the [StyleBox] with given [code]name[/code] in the [member theme] resource the control uses. If [code]stylebox[/code] is empty or invalid, the override is cleared and the [StyleBox] from assigned [Theme] is used.
+ [b]Example of modifying a property in a StyleBox by duplicating it:[/b]
+ [codeblocks]
+ [gdscript]
+ # The snippet below assumes the child node MyButton has a StyleBoxFlat assigned.
+ # Resources are shared across instances, so we need to duplicate it
+ # to avoid modifying the appearance of all other buttons.
+ var new_stylebox_normal = $MyButton.get_theme_stylebox("normal").duplicate()
+ new_stylebox_normal.border_width_top = 3
+ new_stylebox_normal.border_color = Color(0, 1, 0.5)
+ $MyButton.add_theme_stylebox_override("normal", new_stylebox_normal)
+ # Remove the stylebox override:
+ $MyButton.add_theme_stylebox_override("normal", null)
+ [/gdscript]
+ [csharp]
+ // The snippet below assumes the child node MyButton has a StyleBoxFlat assigned.
+ // Resources are shared across instances, so we need to duplicate it
+ // to avoid modifying the appearance of all other buttons.
+ StyleBoxFlat newStyleboxNormal = GetNode&lt;Button&gt;("MyButton").GetThemeStylebox("normal").Duplicate() as StyleBoxFlat;
+ newStyleboxNormal.BorderWidthTop = 3;
+ newStyleboxNormal.BorderColor = new Color(0, 1, 0.5f);
+ GetNode&lt;Button&gt;("MyButton").AddThemeStyleboxOverride("normal", newStyleboxNormal);
+ // Remove the stylebox override:
+ GetNode&lt;Button&gt;("MyButton").AddThemeStyleboxOverride("normal", null);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="can_drop_data" qualifiers="virtual">
@@ -165,12 +247,22 @@
<description>
Godot calls this method to test if [code]data[/code] from a control's [method get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control.
This method should only be used to test the data. Process the data in [method drop_data].
- [codeblock]
+ [codeblocks]
+ [gdscript]
func can_drop_data(position, data):
# Check position if it is relevant to you
# Otherwise, just check data
return typeof(data) == TYPE_DICTIONARY and data.has("expected")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override bool CanDropData(Vector2 position, object data)
+ {
+ // Check position if it is relevant to you
+ // Otherwise, just check data
+ return data is Godot.Collections.Dictionary &amp;&amp; (data as Godot.Collections.Dictionary).Contains("expected");
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="drop_data" qualifiers="virtual">
@@ -182,13 +274,24 @@
</argument>
<description>
Godot calls this method to pass you the [code]data[/code] from a control's [method get_drag_data] result. Godot first calls [method can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control.
- [codeblock]
+ [codeblocks]
+ [gdscript]
func can_drop_data(position, data):
return typeof(data) == TYPE_DICTIONARY and data.has("color")
-
func drop_data(position, data):
- color = data["color"]
- [/codeblock]
+ var color = data["color"]
+ [/gdscript]
+ [csharp]
+ public override bool CanDropData(Vector2 position, object data)
+ {
+ return data is Godot.Collections.Dictionary &amp;&amp; (data as Godot.Collections.Dictionary).Contains("color");
+ }
+ public override void DropData(Vector2 position, object data)
+ {
+ Color color = (Color)(data as Godot.Collections.Dictionary)["color"];
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="force_drag">
@@ -243,12 +346,22 @@
<description>
Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method can_drop_data] and [method drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag].
A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method.
- [codeblock]
+ [codeblocks]
+ [gdscript]
func get_drag_data(position):
- var mydata = make_data()
- set_drag_preview(make_preview(mydata))
+ var mydata = make_data() # This is your custom method generating the drag data.
+ set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data.
return mydata
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override object GetDragData(Vector2 position)
+ {
+ object mydata = MakeData(); // This is your custom method generating the drag data.
+ SetDragPreview(MakePreview(mydata)); // This is your custom method generating the preview of the drag data.
+ return mydata;
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_end" qualifiers="const">
@@ -333,11 +446,19 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
- [codeblock]
+ Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
+ [codeblocks]
+ [gdscript]
func _ready():
modulate = get_theme_color("font_color", "Button") #get the color defined for button fonts
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ Modulate = GetThemeColor("font_color", "Button"); //get the color defined for button fonts
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_theme_constant" qualifiers="const">
@@ -348,7 +469,7 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
+ Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
</description>
</method>
<method name="get_theme_font" qualifiers="const">
@@ -359,7 +480,7 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
+ Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
</description>
</method>
<method name="get_theme_icon" qualifiers="const">
@@ -370,7 +491,7 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
+ Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
</description>
</method>
<method name="get_theme_stylebox" qualifiers="const">
@@ -381,7 +502,7 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
+ Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
</description>
</method>
<method name="get_tooltip" qualifiers="const">
@@ -398,10 +519,18 @@
</return>
<description>
Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control acquires focus.
- [codeblock]
+ [codeblocks]
+ [gdscript]
func _process(delta):
grab_click_focus() #when clicking another Control node, this node will be clicked instead
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void _Process(float delta)
+ {
+ GrabClickFocus(); //when clicking another Control node, this node will be clicked instead
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="grab_focus">
@@ -437,7 +566,7 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_color_override" qualifiers="const">
@@ -457,7 +586,7 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_constant_override" qualifiers="const">
@@ -477,7 +606,7 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_font_override" qualifiers="const">
@@ -497,7 +626,7 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_icon_override" qualifiers="const">
@@ -526,7 +655,7 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_stylebox_override" qualifiers="const">
@@ -542,7 +671,7 @@
<return type="void">
</return>
<description>
- Invalidates the size cache in this node and in parent nodes up to toplevel. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member rect_min_size] directly calls this method automatically.
+ Invalidates the size cache in this node and in parent nodes up to top_level. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member rect_min_size] directly calls this method automatically.
</description>
</method>
<method name="release_focus">
@@ -628,24 +757,61 @@
Forwarding can be implemented in the target control similar to the methods [method get_drag_data], [method can_drop_data], and [method drop_data] but with two differences:
1. The function name must be suffixed with [b]_fw[/b]
2. The function must take an extra argument that is the control doing the forwarding
- [codeblock]
+ [codeblocks]
+ [gdscript]
# ThisControl.gd
extends Control
+ export(Control) var target_control
+
func _ready():
set_drag_forwarding(target_control)
# TargetControl.gd
extends Control
+
func can_drop_data_fw(position, data, from_control):
return true
func drop_data_fw(position, data, from_control):
- my_handle_data(data)
+ my_handle_data(data) # Your handler method.
func get_drag_data_fw(position, from_control):
set_drag_preview(my_preview)
return my_data()
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // ThisControl.cs
+ public class ThisControl : Control
+ {
+ [Export]
+ public Control TargetControl { get; set; }
+ public override void _Ready()
+ {
+ SetDragForwarding(TargetControl);
+ }
+ }
+
+ // TargetControl.cs
+ public class TargetControl : Control
+ {
+ public void CanDropDataFw(Vector2 position, object data, Control fromControl)
+ {
+ return true;
+ }
+
+ public void DropDataFw(Vector2 position, object data, Control fromControl)
+ {
+ MyHandleData(data); // Your handler method.
+ }
+
+ public void GetDragDataFw(Vector2 position, Control fromControl)
+ {
+ SetDragPreview(MyPreview);
+ return MyData();
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="set_drag_preview">
@@ -655,7 +821,8 @@
</argument>
<description>
Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. The control must not be in the scene tree.
- [codeblock]
+ [codeblocks]
+ [gdscript]
export (Color, RGBA) var color = Color(1, 0, 0, 1)
func get_drag_data(position):
@@ -665,7 +832,22 @@
cpb.rect_size = Vector2(50, 50)
set_drag_preview(cpb)
return color
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ [Export]
+ public Color Color = new Color(1, 0, 0, 1);
+
+ public override object GetDragData(Vector2 position)
+ {
+ // Use a control that is not in the tree
+ var cpb = new ColorPickerButton();
+ cpb.Color = Color;
+ cpb.RectSize = new Vector2(50, 50);
+ SetDragPreview(cpb);
+ return Color;
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="set_end">
@@ -798,11 +980,11 @@
Tells Godot which node it should give keyboard focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [code]ui_top[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
</member>
<member name="focus_next" type="NodePath" setter="set_focus_next" getter="get_focus_next" default="NodePath(&quot;&quot;)">
- Tells Godot which node it should give keyboard focus to if the user presses Tab on a keyboard by default. You can change the key by editing the [code]ui_focus_next[/code] input action.
+ Tells Godot which node it should give keyboard focus to if the user presses [kbd]Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_next[/code] input action.
If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
</member>
<member name="focus_previous" type="NodePath" setter="set_focus_previous" getter="get_focus_previous" default="NodePath(&quot;&quot;)">
- Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab on a keyboard by default. You can change the key by editing the [code]ui_focus_prev[/code] input action.
+ Tells Godot which node it should give keyboard focus to if the user presses [kbd]Shift + Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_prev[/code] input action.
If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
</member>
<member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" enum="Control.GrowDirection" default="1">
@@ -813,6 +995,25 @@
</member>
<member name="hint_tooltip" type="String" setter="set_tooltip" getter="_get_tooltip" default="&quot;&quot;">
Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. You can change the time required for the tooltip to appear with [code]gui/timers/tooltip_delay_sec[/code] option in Project Settings.
+ The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding [method _make_custom_tooltip]. The default tooltip includes a [PopupPanel] and [Label] whose theme properties can be customized using [Theme] methods with the [code]"TooltipPanel"[/code] and [code]"TooltipLabel"[/code] respectively. For example:
+ [codeblocks]
+ [gdscript]
+ var style_box = StyleBoxFlat.new()
+ style_box.set_bg_color(Color(1, 1, 0))
+ style_box.set_border_width_all(2)
+ # We assume here that the `theme` property has been assigned a custom Theme beforehand.
+ theme.set_stylebox("panel", "TooltipPanel", style_box)
+ theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1))
+ [/gdscript]
+ [csharp]
+ var styleBox = new StyleBoxFlat();
+ styleBox.SetBgColor(new Color(1, 1, 0));
+ styleBox.SetBorderWidthAll(2);
+ // We assume here that the `Theme` property has been assigned a custom Theme beforehand.
+ Theme.SetStyleBox("panel", "TooltipPanel", styleBox);
+ Theme.SetColor("font_color", "TooltipLabel", new Color(0, 1, 1));
+ [/csharp]
+ [/codeblocks]
</member>
<member name="margin_bottom" type="float" setter="set_margin" getter="get_margin" default="0.0">
Distance between the node's bottom edge and its parent control, based on [member anchor_bottom].
@@ -856,7 +1057,9 @@
The node's rotation around its pivot, in degrees. See [member rect_pivot_offset] to change the pivot's position.
</member>
<member name="rect_scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2( 1, 1 )">
- The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset].
+ The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control's [member hint_tooltip] will also scale according to this value.
+ [b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually.
+ [b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instanced. To set the Control's scale when it's instanced, wait for one frame using [code]yield(get_tree(), "idle_frame")[/code] then set its [member rect_scale] property.
</member>
<member name="rect_size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2( 0, 0 )">
The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically.
diff --git a/doc/classes/ConvexPolygonShape2D.xml b/doc/classes/ConvexPolygonShape2D.xml
index cba446fff8..42951e2158 100644
--- a/doc/classes/ConvexPolygonShape2D.xml
+++ b/doc/classes/ConvexPolygonShape2D.xml
@@ -16,7 +16,7 @@
<argument index="0" name="point_cloud" type="PackedVector2Array">
</argument>
<description>
- Based on the set of points provided, this creates and assigns the [member points] property using the convex hull algorithm. Removing all unneeded points. See [method Geometry.convex_hull_2d] for details.
+ Based on the set of points provided, this creates and assigns the [member points] property using the convex hull algorithm. Removing all unneeded points. See [method Geometry2D.convex_hull] for details.
</description>
</method>
</methods>
diff --git a/doc/classes/ConvexPolygonShape3D.xml b/doc/classes/ConvexPolygonShape3D.xml
index c036f80e2d..e18d716255 100644
--- a/doc/classes/ConvexPolygonShape3D.xml
+++ b/doc/classes/ConvexPolygonShape3D.xml
@@ -7,6 +7,7 @@
Convex polygon shape resource, which can be added to a [PhysicsBody3D] or area.
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Crypto.xml b/doc/classes/Crypto.xml
index 10f1f18f0d..b3bbbae94f 100644
--- a/doc/classes/Crypto.xml
+++ b/doc/classes/Crypto.xml
@@ -5,14 +5,13 @@
</brief_description>
<description>
The Crypto class allows you to access some more advanced cryptographic functionalities in Godot.
- For now, this includes generating cryptographically secure random bytes, and RSA keys and self-signed X509 certificates generation. More functionalities are planned for future releases.
- [codeblock]
+ For now, this includes generating cryptographically secure random bytes, RSA keys and self-signed X509 certificates generation, asymmetric key encryption/decryption, and signing/verification.
+ [codeblocks]
+ [gdscript]
extends Node
-
var crypto = Crypto.new()
var key = CryptoKey.new()
var cert = X509Certificate.new()
-
func _ready():
# Generate new RSA key.
key = crypto.generate_rsa(4096)
@@ -21,12 +20,83 @@
# Save key and certificate in the user folder.
key.save("user://generated.key")
cert.save("user://generated.crt")
- [/codeblock]
+ # Encryption
+ var data = "Some data"
+ var encrypted = crypto.encrypt(key, data.to_utf8())
+ # Decryption
+ var decrypted = crypto.decrypt(key, encrypted)
+ # Signing
+ var signature = crypto.sign(HashingContext.HASH_SHA256, data.sha256_buffer(), key)
+ # Verifying
+ var verified = crypto.verify(HashingContext.HASH_SHA256, data.sha256_buffer(), signature, key)
+ # Checks
+ assert(verified)
+ assert(data.to_utf8() == decrypted)
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+ using System.Diagnostics;
+
+ public class CryptoNode : Node
+ {
+ public Crypto Crypto = new Crypto();
+ public CryptoKey Key = new CryptoKey();
+ public X509Certificate Cert = new X509Certificate();
+ public override void _Ready()
+ {
+ // Generate new RSA key.
+ Key = Crypto.GenerateRsa(4096);
+ // Generate new self-signed certificate with the given key.
+ Cert = Crypto.GenerateSelfSignedCertificate(Key, "CN=mydomain.com,O=My Game Company,C=IT");
+ // Save key and certificate in the user folder.
+ Key.Save("user://generated.key");
+ Cert.Save("user://generated.crt");
+ // Encryption
+ string data = "Some data";
+ byte[] encrypted = Crypto.Encrypt(Key, data.ToUTF8());
+ // Decryption
+ byte[] decrypted = Crypto.Decrypt(Key, encrypted);
+ // Signing
+ byte[] signature = Crypto.Sign(HashingContext.HashType.Sha256, Data.SHA256Buffer(), Key);
+ // Verifying
+ bool verified = Crypto.Verify(HashingContext.HashType.Sha256, Data.SHA256Buffer(), signature, Key);
+ // Checks
+ Debug.Assert(verified);
+ Debug.Assert(data.ToUTF8() == decrypted);
+ }
+ }
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] Not available in HTML5 exports.
</description>
<tutorials>
</tutorials>
<methods>
+ <method name="decrypt">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="key" type="CryptoKey">
+ </argument>
+ <argument index="1" name="ciphertext" type="PackedByteArray">
+ </argument>
+ <description>
+ Decrypt the given [code]ciphertext[/code] with the provided private [code]key[/code].
+ [b]Note[/b]: The maximum size of accepted ciphertext is limited by the key size.
+ </description>
+ </method>
+ <method name="encrypt">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="key" type="CryptoKey">
+ </argument>
+ <argument index="1" name="plaintext" type="PackedByteArray">
+ </argument>
+ <description>
+ Encrypt the given [code]plaintext[/code] with the provided public [code]key[/code].
+ [b]Note[/b]: The maximum size of accepted plaintext is limited by the key size.
+ </description>
+ </method>
<method name="generate_random_bytes">
<return type="PackedByteArray">
</return>
@@ -59,13 +129,50 @@
<description>
Generates a self-signed [X509Certificate] from the given [CryptoKey] and [code]issuer_name[/code]. The certificate validity will be defined by [code]not_before[/code] and [code]not_after[/code] (first valid date and last valid date). The [code]issuer_name[/code] must contain at least "CN=" (common name, i.e. the domain name), "O=" (organization, i.e. your company name), "C=" (country, i.e. 2 lettered ISO-3166 code of the country the organization is based in).
A small example to generate an RSA key and a X509 self-signed certificate.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var crypto = Crypto.new()
# Generate 4096 bits RSA key.
var key = crypto.generate_rsa(4096)
# Generate self-signed certificate using the given key.
var cert = crypto.generate_self_signed_certificate(key, "CN=example.com,O=A Game Company,C=IT")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var crypto = new Crypto();
+ // Generate 4096 bits RSA key.
+ CryptoKey key = crypto.GenerateRsa(4096);
+ // Generate self-signed certificate using the given key.
+ X509Certificate cert = crypto.GenerateSelfSignedCertificate(key, "CN=mydomain.com,O=My Game Company,C=IT");
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="sign">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="hash_type" type="int" enum="HashingContext.HashType">
+ </argument>
+ <argument index="1" name="hash" type="PackedByteArray">
+ </argument>
+ <argument index="2" name="key" type="CryptoKey">
+ </argument>
+ <description>
+ Sign a given [code]hash[/code] of type [code]hash_type[/code] with the provided private [code]key[/code].
+ </description>
+ </method>
+ <method name="verify">
+ <return type="bool">
+ </return>
+ <argument index="0" name="hash_type" type="int" enum="HashingContext.HashType">
+ </argument>
+ <argument index="1" name="hash" type="PackedByteArray">
+ </argument>
+ <argument index="2" name="signature" type="PackedByteArray">
+ </argument>
+ <argument index="3" name="key" type="CryptoKey">
+ </argument>
+ <description>
+ Verify that a given [code]signature[/code] for [code]hash[/code] of type [code]hash_type[/code] against the provided public [code]key[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/CryptoKey.xml b/doc/classes/CryptoKey.xml
index fe7f4b63f0..410c2262f9 100644
--- a/doc/classes/CryptoKey.xml
+++ b/doc/classes/CryptoKey.xml
@@ -11,13 +11,34 @@
<tutorials>
</tutorials>
<methods>
+ <method name="is_public_only" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Return [code]true[/code] if this CryptoKey only has the public part, and not the private one.
+ </description>
+ </method>
<method name="load">
<return type="int" enum="Error">
</return>
<argument index="0" name="path" type="String">
</argument>
+ <argument index="1" name="public_only" type="bool" default="false">
+ </argument>
+ <description>
+ Loads a key from [code]path[/code]. If [code]public_only[/code] is [code]true[/code], only the public key will be loaded.
+ [b]Note[/b]: [code]path[/code] should should be a "*.pub" file if [code]public_only[/code] is [code]true[/code], a "*.key" file otherwise.
+ </description>
+ </method>
+ <method name="load_from_string">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="string_key" type="String">
+ </argument>
+ <argument index="1" name="public_only" type="bool" default="false">
+ </argument>
<description>
- Loads a key from [code]path[/code] ("*.key" file).
+ Loads a key from the given [code]string[/code]. If [code]public_only[/code] is [code]true[/code], only the public key will be loaded.
</description>
</method>
<method name="save">
@@ -25,8 +46,20 @@
</return>
<argument index="0" name="path" type="String">
</argument>
+ <argument index="1" name="public_only" type="bool" default="false">
+ </argument>
+ <description>
+ Saves a key to the given [code]path[/code]. If [code]public_only[/code] is [code]true[/code], only the public key will be saved.
+ [b]Note[/b]: [code]path[/code] should should be a "*.pub" file if [code]public_only[/code] is [code]true[/code], a "*.key" file otherwise.
+ </description>
+ </method>
+ <method name="save_to_string">
+ <return type="String">
+ </return>
+ <argument index="0" name="public_only" type="bool" default="false">
+ </argument>
<description>
- Saves a key to the given [code]path[/code] (should be a "*.key" file).
+ Returns a string containing the key in PEM format. If [code]public_only[/code] is [code]true[/code], only the public key will be included.
</description>
</method>
</methods>
diff --git a/doc/classes/Cubemap.xml b/doc/classes/Cubemap.xml
index 16431c65c9..61cb1d43f0 100644
--- a/doc/classes/Cubemap.xml
+++ b/doc/classes/Cubemap.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="Cubemap" inherits="TextureLayered" version="4.0">
+<class name="Cubemap" inherits="ImageTextureLayered" version="4.0">
<brief_description>
</brief_description>
<description>
diff --git a/doc/classes/CubemapArray.xml b/doc/classes/CubemapArray.xml
index 03cfd75acf..627baf79e0 100644
--- a/doc/classes/CubemapArray.xml
+++ b/doc/classes/CubemapArray.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="CubemapArray" inherits="TextureLayered" version="4.0">
+<class name="CubemapArray" inherits="ImageTextureLayered" version="4.0">
<brief_description>
</brief_description>
<description>
diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml
index 8ac6258e97..2d50d98a74 100644
--- a/doc/classes/Curve2D.xml
+++ b/doc/classes/Curve2D.xml
@@ -80,7 +80,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
+ Returns the position of the control point leading to the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
</description>
</method>
<method name="get_point_out" qualifiers="const">
@@ -89,7 +89,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
+ Returns the position of the control point leading out of the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
</description>
</method>
<method name="get_point_position" qualifiers="const">
@@ -152,7 +152,7 @@
<argument index="1" name="position" type="Vector2">
</argument>
<description>
- Sets the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
+ Sets the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<method name="set_point_out">
@@ -163,7 +163,7 @@
<argument index="1" name="position" type="Vector2">
</argument>
<description>
- Sets the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
+ Sets the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<method name="set_point_position">
diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml
index fe454d90cc..a6a0e0c33d 100644
--- a/doc/classes/Curve3D.xml
+++ b/doc/classes/Curve3D.xml
@@ -95,7 +95,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
+ Returns the position of the control point leading to the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
</description>
</method>
<method name="get_point_out" qualifiers="const">
@@ -104,7 +104,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
+ Returns the position of the control point leading out of the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
</description>
</method>
<method name="get_point_position" qualifiers="const">
@@ -189,7 +189,7 @@
<argument index="1" name="position" type="Vector3">
</argument>
<description>
- Sets the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
+ Sets the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<method name="set_point_out">
@@ -200,7 +200,7 @@
<argument index="1" name="position" type="Vector3">
</argument>
<description>
- Sets the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
+ Sets the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<method name="set_point_position">
diff --git a/doc/classes/CylinderShape3D.xml b/doc/classes/CylinderShape3D.xml
index eb12568e71..99334ceae6 100644
--- a/doc/classes/CylinderShape3D.xml
+++ b/doc/classes/CylinderShape3D.xml
@@ -7,6 +7,9 @@
Cylinder shape for collisions.
</description>
<tutorials>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/DTLSServer.xml b/doc/classes/DTLSServer.xml
index 8c71b61553..91a04b1f28 100644
--- a/doc/classes/DTLSServer.xml
+++ b/doc/classes/DTLSServer.xml
@@ -6,8 +6,9 @@
<description>
This class is used to store the state of a DTLS server. Upon [method setup] it converts connected [PacketPeerUDP] to [PacketPeerDTLS] accepting them via [method take_connection] as DTLS clients. Under the hood, this class is used to store the DTLS state and cookies of the server. The reason of why the state and cookies are needed is outside of the scope of this documentation.
Below a small example of how to use it:
- [codeblock]
- # server.gd
+ [codeblocks]
+ [gdscript]
+ # ServerNode.gd
extends Node
var dtls := DTLSServer.new()
@@ -28,15 +29,64 @@
continue # It is normal that 50% of the connections fails due to cookie exchange.
print("Peer connected!")
peers.append(dtls_peer)
+
for p in peers:
p.poll() # Must poll to update the state.
if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED:
while p.get_available_packet_count() &gt; 0:
print("Received message from client: %s" % p.get_packet().get_string_from_utf8())
p.put_packet("Hello DTLS client".to_utf8())
- [/codeblock]
- [codeblock]
- # client.gd
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+ // ServerNode.cs
+ public class ServerNode : Node
+ {
+ public DTLSServer Dtls = new DTLSServer();
+ public UDPServer Server = new UDPServer();
+ public Godot.Collections.Array&lt;PacketPeerDTLS&gt; Peers = new Godot.Collections.Array&lt;PacketPeerDTLS&gt;();
+ public override void _Ready()
+ {
+ Server.Listen(4242);
+ var key = GD.Load&lt;CryptoKey&gt;("key.key"); // Your private key.
+ var cert = GD.Load&lt;X509Certificate&gt;("cert.crt"); // Your X509 certificate.
+ Dtls.Setup(key, cert);
+ }
+
+ public override void _Process(float delta)
+ {
+ while (Server.IsConnectionAvailable())
+ {
+ PacketPeerUDP peer = Server.TakeConnection();
+ PacketPeerDTLS dtlsPeer = Dtls.TakeConnection(peer);
+ if (dtlsPeer.GetStatus() != PacketPeerDTLS.Status.Handshaking)
+ {
+ continue; // It is normal that 50% of the connections fails due to cookie exchange.
+ }
+ GD.Print("Peer connected!");
+ Peers.Add(dtlsPeer);
+ }
+
+ foreach (var p in Peers)
+ {
+ p.Poll(); // Must poll to update the state.
+ if (p.GetStatus() == PacketPeerDTLS.Status.Connected)
+ {
+ while (p.GetAvailablePacketCount() &gt; 0)
+ {
+ GD.Print("Received Message From Client: " + p.GetPacket().GetStringFromUTF8());
+ p.PutPacket("Hello Dtls Client".ToUTF8());
+ }
+ }
+ }
+ }
+ }
+ [/csharp]
+ [/codeblocks]
+ [codeblocks]
+ [gdscript]
+ # ClientNode.gd
extends Node
var dtls := PacketPeerDTLS.new()
@@ -56,7 +106,42 @@
while dtls.get_available_packet_count() &gt; 0:
print("Connected: %s" % dtls.get_packet().get_string_from_utf8())
connected = true
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System.Text;
+ // ClientNode.cs
+ public class ClientNode : Node
+ {
+ public PacketPeerDTLS Dtls = new PacketPeerDTLS();
+ public PacketPeerUDP Udp = new PacketPeerUDP();
+ public bool Connected = false;
+ public override void _Ready()
+ {
+ Udp.ConnectToHost("127.0.0.1", 4242);
+ Dtls.ConnectToPeer(Udp, false); // Use true in production for certificate validation!
+ }
+
+ public override void _Process(float delta)
+ {
+ Dtls.Poll();
+ if (Dtls.GetStatus() == PacketPeerDTLS.Status.Connected)
+ {
+ if (!Connected)
+ {
+ // Try to contact server
+ Dtls.PutPacket("The Answer Is..42!".ToUTF8());
+ }
+ while (Dtls.GetAvailablePacketCount() &gt; 0)
+ {
+ GD.Print("Connected: " + Dtls.GetPacket().GetStringFromUTF8());
+ Connected = true;
+ }
+ }
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml
index f7329d1537..8107d97b67 100644
--- a/doc/classes/Decal.xml
+++ b/doc/classes/Decal.xml
@@ -17,13 +17,21 @@
<argument index="0" name="type" type="int" enum="Decal.DecalTexture">
</argument>
<description>
- Returns the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
+ Returns the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
For example, instead of [code]albedo_tex = $Decal.get_texture(Decal.TEXTURE_ALBEDO)[/code], use [code]albedo_tex = $Decal.texture_albedo[/code].
One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
for i in Decal.TEXTURE_MAX:
$NewDecal.set_texture(i, $OldDecal.get_texture(i))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ for (int i = 0; i &lt; (int)Decal.DecalTexture.Max; i++)
+ {
+ GetNode&lt;Decal&gt;("NewDecal").SetTexture(i, GetNode&lt;Decal&gt;("OldDecal").GetTexture(i));
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="set_texture">
@@ -34,13 +42,21 @@
<argument index="1" name="texture" type="Texture2D">
</argument>
<description>
- Sets the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
+ Sets the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
For example, instead of [code]$Decal.set_texture(Decal.TEXTURE_ALBEDO, albedo_tex)[/code], use [code]$Decal.texture_albedo = albedo_tex[/code].
One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
for i in Decal.TEXTURE_MAX:
$NewDecal.set_texture(i, $OldDecal.get_texture(i))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ for (int i = 0; i &lt; (int)Decal.DecalTexture.Max; i++)
+ {
+ GetNode&lt;Decal&gt;("NewDecal").SetTexture(i, GetNode&lt;Decal&gt;("OldDecal").GetTexture(i));
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index e982e00d6d..cd0b5ac027 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -7,74 +7,198 @@
Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding elements, even though this may not be reflected when printing the dictionary. In other programming languages, this data structure is sometimes referred to as an hash map or associative array.
You can define a dictionary by placing a comma-separated list of [code]key: value[/code] pairs in curly braces [code]{}[/code].
Erasing elements while iterating over them [b]is not supported[/b] and will result in undefined behavior.
+ [b]Note:[/b] Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use [method duplicate].
Creating a dictionary:
- [codeblock]
- var my_dir = {} # Creates an empty dictionary.
- var points_dir = {"White": 50, "Yellow": 75, "Orange": 100}
- var another_dir = {
- key1: value1,
- key2: value2,
- key3: value3,
+ [codeblocks]
+ [gdscript]
+ var my_dict = {} # Creates an empty dictionary.
+
+ var dict_variable_key = "Another key name"
+ var dict_variable_value = "value2"
+ var another_dict = {
+ "Some key name": "value1",
+ dict_variable_key: dict_variable_value,
}
- [/codeblock]
- You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dir["White"][/code] will return [code]50[/code]. You can also write [code]points_dir.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable).
- [codeblock]
- export(String, "White", "Yellow", "Orange") var my_color
- var points_dir = {"White": 50, "Yellow": 75, "Orange": 100}
+ var points_dict = {"White": 50, "Yellow": 75, "Orange": 100}
+
+ # Alternative Lua-style syntax.
+ # Doesn't require quotes around keys, but only string constants can be used as key names.
+ # Additionally, key names must start with a letter or an underscore.
+ # Here, `some_key` is a string literal, not a variable!
+ another_dict = {
+ some_key = 42,
+ }
+ [/gdscript]
+ [csharp]
+ var myDict = new Godot.Collections.Dictionary(); // Creates an empty dictionary.
+ var pointsDict = new Godot.Collections.Dictionary
+ {
+ {"White", 50},
+ {"Yellow", 75},
+ {"Orange", 100}
+ };
+ [/csharp]
+ [/codeblocks]
+ You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dir["White"][/code] will return [code]50[/code]. You can also write [code]points_dir.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable).
+ [codeblocks]
+ [gdscript]
+ export(string, "White", "Yellow", "Orange") var my_color
+ var points_dict = {"White": 50, "Yellow": 75, "Orange": 100}
func _ready():
# We can't use dot syntax here as `my_color` is a variable.
- var points = points_dir[my_color]
- [/codeblock]
+ var points = points_dict[my_color]
+ [/gdscript]
+ [csharp]
+ [Export(PropertyHint.Enum, "White,Yellow,Orange")]
+ public string MyColor { get; set; }
+ public Godot.Collections.Dictionary pointsDict = new Godot.Collections.Dictionary
+ {
+ {"White", 50},
+ {"Yellow", 75},
+ {"Orange", 100}
+ };
+
+ public override void _Ready()
+ {
+ int points = (int)pointsDict[MyColor];
+ }
+ [/csharp]
+ [/codeblocks]
In the above code, [code]points[/code] will be assigned the value that is paired with the appropriate color selected in [code]my_color[/code].
Dictionaries can contain more complex data:
- [codeblock]
- my_dir = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key.
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ my_dict = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key.
+ [/gdscript]
+ [csharp]
+ var myDir = new Godot.Collections.Dictionary
+ {
+ {"First Array", new Godot.Collections.Array{1, 2, 3, 4}}
+ };
+ [/csharp]
+ [/codeblocks]
To add a key to an existing dictionary, access it like an existing key and assign to it:
- [codeblock]
- var points_dir = {"White": 50, "Yellow": 75, "Orange": 100}
- points_dir["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value.
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ var points_dict = {"White": 50, "Yellow": 75, "Orange": 100}
+ points_dict["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value.
+ [/gdscript]
+ [csharp]
+ var pointsDir = new Godot.Collections.Dictionary
+ {
+ {"White", 50},
+ {"Yellow", 75},
+ {"Orange", 100}
+ };
+ pointsDict["blue"] = 150; // Add "Blue" as a key and assign 150 as its value.
+ [/csharp]
+ [/codeblocks]
Finally, dictionaries can contain different types of keys and values in the same dictionary:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# This is a valid dictionary.
# To access the string "Nested value" below, use `my_dir.sub_dir.sub_key` or `my_dir["sub_dir"]["sub_key"]`.
# Indexing styles can be mixed and matched depending on your needs.
- var my_dir = {
+ var my_dict = {
"String Key": 5,
4: [1, 2, 3],
7: "Hello",
- "sub_dir": {"sub_key": "Nested value"},
+ "sub_dict": {"sub_key": "Nested value"},
}
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // This is a valid dictionary.
+ // To access the string "Nested value" below, use `my_dir.sub_dir.sub_key` or `my_dir["sub_dir"]["sub_key"]`.
+ // Indexing styles can be mixed and matched depending on your needs.
+ var myDict = new Godot.Collections.Dictionary {
+ {"String Key", 5},
+ {4, new Godot.Collections.Array{1,2,3}},
+ {7, "Hello"},
+ {"sub_dict", new Godot.Collections.Dictionary{{"sub_key", "Nested value"}}}
+ };
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] Unlike [Array]s, you can't compare dictionaries directly:
- [codeblock]
- array1 = [1, 2, 3]
- array2 = [1, 2, 3]
+ [codeblocks]
+ [gdscript]
+ var array1 = [1, 2, 3]
+ var array2 = [1, 2, 3]
func compare_arrays():
print(array1 == array2) # Will print true.
- dir1 = {"a": 1, "b": 2, "c": 3}
- dir2 = {"a": 1, "b": 2, "c": 3}
+ var dict1 = {"a": 1, "b": 2, "c": 3}
+ var dict2 = {"a": 1, "b": 2, "c": 3}
func compare_dictionaries():
- print(dir1 == dir2) # Will NOT print true.
- [/codeblock]
+ print(dict1 == dict2) # Will NOT print true.
+ [/gdscript]
+ [csharp]
+ // You have to use GD.Hash().
+
+ public Godot.Collections.Array array1 = new Godot.Collections.Array{1, 2, 3};
+ public Godot.Collections.Array array2 = new Godot.Collections.Array{1, 2, 3};
+
+ public void CompareArrays()
+ {
+ GD.Print(array1 == array2); // Will print FALSE!!
+ GD.Print(GD.Hash(array1) == GD.Hash(array2)); // Will print true.
+ }
+
+ public Godot.Collections.Dictionary dict1 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}};
+ public Godot.Collections.Dictionary dict2 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}};
+
+ public void CompareDictionaries()
+ {
+ GD.Print(dict1 == dict2); // Will NOT print true.
+ }
+ [/csharp]
+ [/codeblocks]
You need to first calculate the dictionary's hash with [method hash] before you can compare them:
- [codeblock]
- dir1 = {"a": 1, "b": 2, "c": 3}
- dir2 = {"a": 1, "b": 2, "c": 3}
+ [codeblocks]
+ [gdscript]
+ var dict1 = {"a": 1, "b": 2, "c": 3}
+ var dict2 = {"a": 1, "b": 2, "c": 3}
func compare_dictionaries():
- print(dir1.hash() == dir2.hash()) # Will print true.
- [/codeblock]
+ print(dict1.hash() == dict2.hash()) # Will print true.
+ [/gdscript]
+ [csharp]
+ // You have to use GD.Hash().
+ public Godot.Collections.Dictionary dict1 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}};
+ public Godot.Collections.Dictionary dict2 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}};
+
+ public void CompareDictionaries()
+ {
+ GD.Print(GD.Hash(dict1) == GD.Hash(dict2)); // Will print true.
+ }
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] When declaring a dictionary with [code]const[/code], the dictionary itself can still be mutated by defining the values of individual keys. Using [code]const[/code] will only prevent assigning the constant with another value after it was initialized.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#dictionary</link>
+ <link title="GDScript basics: Dictionary">https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#dictionary</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
+ <method name="Dictionary" qualifiers="constructor">
+ <return type="Dictionary">
+ </return>
+ <description>
+ Constructs an empty [Dictionary].
+ </description>
+ </method>
+ <method name="Dictionary" qualifiers="constructor">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="from" type="Dictionary">
+ </argument>
+ <description>
+ Constructs a [Dictionary] as a copy of the given [Dictionary].
+ </description>
+ </method>
<method name="clear">
<return type="void">
</return>
@@ -125,6 +249,22 @@
</argument>
<description>
Returns [code]true[/code] if the dictionary has a given key.
+ [b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows:
+ [codeblocks]
+ [gdscript]
+ # Will evaluate to `true`.
+ if "godot" in {"godot": "engine"}:
+ pass
+ [/gdscript]
+ [csharp]
+ // You have to use Contains() here as an alternative to GDScript's `in` operator.
+ if (new Godot.Collections.Dictionary{{"godot", "engine"}}.Contains("godot"))
+ {
+ // I am executed.
+ }
+ [/csharp]
+ [/codeblocks]
+ This method (like the [code]in[/code] operator) will evaluate to [code]true[/code] as long as the key exists, even if the associated value is [code]null[/code].
</description>
</method>
<method name="has_all">
@@ -141,12 +281,22 @@
</return>
<description>
Returns a hashed integer value representing the dictionary contents. This can be used to compare dictionaries by value:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var dict1 = {0: 10}
var dict2 = {0: 10}
# The line below prints `true`, whereas it would have printed `false` if both variables were compared directly.
print(dict1.hash() == dict2.hash())
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var dict1 = new Godot.Collections.Dictionary{{0, 10}};
+ var dict2 = new Godot.Collections.Dictionary{{0, 10}};
+ // The line below prints `true`, whereas it would have printed `false` if both variables were compared directly.
+ // Dictionary has no Hash() method. Use GD.Hash() instead.
+ GD.Print(GD.Hash(dict1) == GD.Hash(dict2));
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] Dictionaries with the same keys/values but in a different order will have a different hash.
</description>
</method>
<method name="keys">
@@ -156,11 +306,35 @@
Returns the list of keys in the [Dictionary].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Dictionary">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Dictionary">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="key" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="size">
<return type="int">
</return>
<description>
- Returns the size of the dictionary (in pairs).
+ Returns the number of keys in the dictionary.
</description>
</method>
<method name="values">
diff --git a/doc/classes/DirectionalLight2D.xml b/doc/classes/DirectionalLight2D.xml
new file mode 100644
index 0000000000..a6eb780159
--- /dev/null
+++ b/doc/classes/DirectionalLight2D.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="DirectionalLight2D" inherits="Light2D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="height" type="float" setter="set_height" getter="get_height" default="0.0">
+ The height of the light. Used with 2D normal mapping.
+ </member>
+ <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="10000.0">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/DirectionalLight3D.xml b/doc/classes/DirectionalLight3D.xml
index 6c88dcf42e..afd85a9cb7 100644
--- a/doc/classes/DirectionalLight3D.xml
+++ b/doc/classes/DirectionalLight3D.xml
@@ -7,7 +7,7 @@
A directional light is a type of [Light3D] node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene to model sunlight or moonlight. The worldspace location of the DirectionalLight3D transform (origin) is ignored. Only the basis is used to determine light direction.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
+ <link title="Lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
</tutorials>
<methods>
</methods>
@@ -39,22 +39,24 @@
<member name="directional_shadow_split_3" type="float" setter="set_param" getter="get_param" default="0.5">
The distance from shadow split 2 to split 3. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code].
</member>
+ <member name="shadow_bias" type="float" setter="set_param" getter="get_param" override="true" default="0.05" />
+ <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" override="true" default="1.0" />
</members>
<constants>
<constant name="SHADOW_ORTHOGONAL" value="0" enum="ShadowMode">
- Renders the entire scene's shadow map from an orthogonal point of view. May result in blockier shadows on close objects.
+ Renders the entire scene's shadow map from an orthogonal point of view. This is the fastest directional shadow mode. May result in blurrier shadows on close objects.
</constant>
<constant name="SHADOW_PARALLEL_2_SPLITS" value="1" enum="ShadowMode">
- Splits the view frustum in 2 areas, each with its own shadow map.
+ Splits the view frustum in 2 areas, each with its own shadow map. This shadow mode is a compromise between [constant SHADOW_ORTHOGONAL] and [constant SHADOW_PARALLEL_4_SPLITS] in terms of performance.
</constant>
<constant name="SHADOW_PARALLEL_4_SPLITS" value="2" enum="ShadowMode">
- Splits the view frustum in 4 areas, each with its own shadow map.
+ Splits the view frustum in 4 areas, each with its own shadow map. This is the slowest directional shadow mode.
</constant>
<constant name="SHADOW_DEPTH_RANGE_STABLE" value="0" enum="ShadowDepthRange">
Keeps the shadow stable when the camera moves, at the cost of lower effective shadow resolution.
</constant>
<constant name="SHADOW_DEPTH_RANGE_OPTIMIZED" value="1" enum="ShadowDepthRange">
- Tries to achieve maximum shadow resolution. May result in saw effect on shadow edges.
+ Tries to achieve maximum shadow resolution. May result in saw effect on shadow edges. This mode typically works best in games where the camera will often move at high speeds, such as most racing games.
</constant>
</constants>
</class>
diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml
index ed4257a809..2d7292717d 100644
--- a/doc/classes/Directory.xml
+++ b/doc/classes/Directory.xml
@@ -5,9 +5,10 @@
</brief_description>
<description>
Directory type. It is used to manage directories and their content (not restricted to the project folder).
- When creating a new [Directory], its default opened directory will be [code]res://[/code]. This may change in the future, so it is advised to always use [method open] to initialize your [Directory] where you want to operate, with explicit error checking.
+ When creating a new [Directory], it must be explicitly opened using [method open] before most methods can be used. However, [method file_exists] and [method dir_exists] can be used without opening a directory. If so, they use a path relative to [code]res://[/code].
Here is an example on how to iterate through the files of a directory:
- [codeblock]
+ [codeblocks]
+ [gdscript]
func dir_contents(path):
var dir = Directory.new()
if dir.open(path) == OK:
@@ -21,10 +22,38 @@
file_name = dir.get_next()
else:
print("An error occurred when trying to access the path.")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public void DirContents(string path)
+ {
+ var dir = new Directory();
+ if (dir.Open(path) == Error.Ok)
+ {
+ dir.ListDirBegin();
+ string fileName = dir.GetNext();
+ while (fileName != "")
+ {
+ if (dir.CurrentIsDir())
+ {
+ GD.Print("Found directory: " + fileName);
+ }
+ else
+ {
+ GD.Print("Found file: " + fileName);
+ }
+ fileName = dir.GetNext();
+ }
+ }
+ else
+ {
+ GD.Print("An error occurred when trying to access the path.");
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link>
+ <link title="File system">https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link>
</tutorials>
<methods>
<method name="change_dir">
@@ -63,6 +92,7 @@
</argument>
<description>
Returns whether the target directory exists. The argument can be relative to the current directory, or an absolute path.
+ If the [Directory] is not open, the path is relative to [code]res://[/code].
</description>
</method>
<method name="file_exists">
@@ -72,6 +102,7 @@
</argument>
<description>
Returns whether the target file exists. The argument can be relative to the current directory, or an absolute path.
+ If the [Directory] is not open, the path is relative to [code]res://[/code].
</description>
</method>
<method name="get_current_dir">
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 90828089f9..d91ea6528a 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -44,9 +44,9 @@
</return>
<argument index="0" name="mode" type="int" enum="DisplayServer.WindowMode">
</argument>
- <argument index="1" name="rect" type="int">
+ <argument index="1" name="flags" type="int">
</argument>
- <argument index="2" name="arg2" type="Rect2i" default="Rect2i( 0, 0, 0, 0 )">
+ <argument index="2" name="rect" type="Rect2i" default="Rect2i( 0, 0, 0, 0 )">
</argument>
<description>
</description>
@@ -127,12 +127,6 @@
<description>
</description>
</method>
- <method name="get_latin_keyboard_variant" qualifiers="const">
- <return type="int" enum="DisplayServer.LatinKeyboardVariant">
- </return>
- <description>
- </description>
- </method>
<method name="get_name" qualifiers="const">
<return type="String">
</return>
@@ -145,7 +139,7 @@
<description>
</description>
</method>
- <method name="get_swap_ok_cancel">
+ <method name="get_swap_cancel_ok">
<return type="bool">
</return>
<description>
@@ -389,6 +383,52 @@
<description>
</description>
</method>
+ <method name="keyboard_get_current_layout" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns active keyboard layout index.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
+ </description>
+ </method>
+ <method name="keyboard_get_layout_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the number of keyboard layouts.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
+ </description>
+ </method>
+ <method name="keyboard_get_layout_language" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ Returns the ISO-639/BCP-47 language code of the keyboard layout at position [code]index[/code].
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
+ </description>
+ </method>
+ <method name="keyboard_get_layout_name" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ Returns the localized name of the keyboard layout at position [code]index[/code].
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
+ </description>
+ </method>
+ <method name="keyboard_set_current_layout">
+ <return type="void">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ Sets active keyboard layout.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
+ </description>
+ </method>
<method name="mouse_get_absolute_position" qualifiers="const">
<return type="Vector2i">
</return>
@@ -481,6 +521,27 @@
<argument index="0" name="screen" type="int" default="-1">
</argument>
<description>
+ Returns the dots per inch density of the specified screen. If [code]screen[/code] is [/code]SCREEN_OF_MAIN_WINDOW[/code] (the default value), a screen with the main window will be used.
+ [b]Note:[/b] On macOS, returned value is inaccurate if fractional display scaling mode is used.
+ [b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities:
+ [codeblock]
+ ldpi - 120 dpi
+ mdpi - 160 dpi
+ hdpi - 240 dpi
+ xhdpi - 320 dpi
+ xxhdpi - 480 dpi
+ xxxhdpi - 640 dpi
+ [/codeblock]
+ [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. Returns [code]72[/code] on unsupported platforms.
+ </description>
+ </method>
+ <method name="screen_get_max_scale" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Return the greatest scale factor of all screens.
+ [b]Note:[/b] On macOS returned value is [code]2.0[/code] if there is at least one hiDPI (Retina) screen in the system, and [code]1.0[/code] in all other cases.
+ [b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="screen_get_orientation" qualifiers="const">
@@ -505,6 +566,9 @@
<argument index="0" name="screen" type="int" default="-1">
</argument>
<description>
+ Return the scale factor of the specified screen by index.
+ [b]Note:[/b] On macOS returned value is [code]2.0[/code] for hiDPI (Retina) screen, and [code]1.0[/code] for all other cases.
+ [b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="screen_get_size" qualifiers="const">
@@ -575,12 +639,14 @@
<return type="int">
</return>
<description>
+ Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
</description>
</method>
<method name="virtual_keyboard_hide">
<return type="void">
</return>
<description>
+ Hides the virtual keyboard if it is shown, does nothing otherwise.
</description>
</method>
<method name="virtual_keyboard_show">
@@ -590,9 +656,23 @@
</argument>
<argument index="1" name="position" type="Rect2" default="Rect2i( 0, 0, 0, 0 )">
</argument>
- <argument index="2" name="max_length" type="int" default="-1">
+ <argument index="2" name="multiline" type="bool" default="false">
+ </argument>
+ <argument index="3" name="max_length" type="int" default="-1">
+ </argument>
+ <argument index="4" name="cursor_start" type="int" default="-1">
+ </argument>
+ <argument index="5" name="cursor_end" type="int" default="-1">
</argument>
<description>
+ Shows the virtual keyboard if the platform has one.
+ [code]existing_text[/code] parameter is useful for implementing your own [LineEdit] or [TextEdit], as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).
+ [code]position[/code] parameter is the screen space [Rect2] of the edited text.
+ [code]multiline[/code] parameter needs to be set to [code]true[/code] to be able to enter multiple lines of text, as in [TextEdit].
+ [code]max_length[/code] limits the number of characters that can be entered if different from [code]-1[/code].
+ [code]cursor_start[/code] can optionally define the current text cursor position if [code]cursor_end[/code] is not set.
+ [code]cursor_start[/code] and [code]cursor_end[/code] can optionally define the current text selection.
+ [b]Note:[/b] This method is implemented on Android, iOS and UWP.
</description>
</method>
<method name="vsync_is_enabled" qualifiers="const">
@@ -833,6 +913,42 @@
<description>
</description>
</method>
+ <method name="window_set_mouse_passthrough">
+ <return type="void">
+ </return>
+ <argument index="0" name="region" type="PackedVector2Array">
+ </argument>
+ <argument index="1" name="window_id" type="int" default="0">
+ </argument>
+ <description>
+ Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
+ Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
+ [codeblocks]
+ [gdscript]
+ # Set region, using Path2D node.
+ DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
+
+ # Set region, using Polygon2D node.
+ DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
+
+ # Reset region to default.
+ DisplayServer.window_set_mouse_passthrough([])
+ [/gdscript]
+ [csharp]
+ // Set region, using Path2D node.
+ DisplayServer.WindowSetMousePassthrough(GetNode&lt;Path2D&gt;("Path2D").Curve.GetBakedPoints());
+
+ // Set region, using Polygon2D node.
+ DisplayServer.WindowSetMousePassthrough(GetNode&lt;Polygon2D&gt;("Polygon2D").Polygon);
+
+ // Reset region to default.
+ DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
+ </description>
+ </method>
<method name="window_set_position">
<return type="void">
</return>
@@ -1004,6 +1120,8 @@
<constant name="WINDOW_MODE_MAXIMIZED" value="2" enum="WindowMode">
</constant>
<constant name="WINDOW_MODE_FULLSCREEN" value="3" enum="WindowMode">
+ Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
+ Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
</constant>
<constant name="WINDOW_FLAG_RESIZE_DISABLED" value="0" enum="WindowFlags">
</constant>
@@ -1017,20 +1135,6 @@
</constant>
<constant name="WINDOW_FLAG_MAX" value="5" enum="WindowFlags">
</constant>
- <constant name="LATIN_KEYBOARD_QWERTY" value="0" enum="LatinKeyboardVariant">
- </constant>
- <constant name="LATIN_KEYBOARD_QWERTZ" value="1" enum="LatinKeyboardVariant">
- </constant>
- <constant name="LATIN_KEYBOARD_AZERTY" value="2" enum="LatinKeyboardVariant">
- </constant>
- <constant name="LATIN_KEYBOARD_QZERTY" value="3" enum="LatinKeyboardVariant">
- </constant>
- <constant name="LATIN_KEYBOARD_DVORAK" value="4" enum="LatinKeyboardVariant">
- </constant>
- <constant name="LATIN_KEYBOARD_NEO" value="5" enum="LatinKeyboardVariant">
- </constant>
- <constant name="LATIN_KEYBOARD_COLEMAK" value="6" enum="LatinKeyboardVariant">
- </constant>
<constant name="WINDOW_EVENT_MOUSE_ENTER" value="0" enum="WindowEvent">
</constant>
<constant name="WINDOW_EVENT_MOUSE_EXIT" value="1" enum="WindowEvent">
diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml
index 0864c3ba36..d2d0c54761 100644
--- a/doc/classes/DynamicFont.xml
+++ b/doc/classes/DynamicFont.xml
@@ -4,17 +4,26 @@
DynamicFont renders vector font files at runtime.
</brief_description>
<description>
- DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. DynamicFont also supports defining one or more fallbacks fonts, which will be used when displaying a character not supported by the main font.
+ DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. DynamicFont also supports defining one or more fallback fonts, which will be used when displaying a character not supported by the main font.
DynamicFont uses the [url=https://www.freetype.org/]FreeType[/url] library for rasterization.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var dynamic_font = DynamicFont.new()
dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf")
dynamic_font.size = 64
$"Label".set("custom_fonts/font", dynamic_font)
- [/codeblock]
- [b]Note:[/b] DynamicFont doesn't support features such as right-to-left typesetting, ligatures, text shaping, variable fonts and optional font features yet. If you wish to "bake" an optional font feature into a TTF font file, you can use [url=https://fontforge.org/]FontForge[/url] to do so. In FontForge, use [b]File &gt; Generate Fonts[/b], click [b]Options[/b], choose the desired features then generate the font.
+ [/gdscript]
+ [csharp]
+ var dynamicFont = new DynamicFont();
+ dynamicFont.FontData = ResourceLoader.Load&lt;DynamicFontData&gt;("res://BarlowCondensed-Bold.ttf");
+ dynamicFont.Size = 64;
+ GetNode("Label").Set("custom_fonts/font", dynamicFont);
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] DynamicFont doesn't support features such as kerning, right-to-left typesetting, ligatures, text shaping, variable fonts and optional font features yet. If you wish to "bake" an optional font feature into a TTF font file, you can use [url=https://fontforge.org/]FontForge[/url] to do so. In FontForge, use [b]File &gt; Generate Fonts[/b], click [b]Options[/b], choose the desired features then generate the font.
</description>
<tutorials>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="add_fallback">
@@ -26,6 +35,14 @@
Adds a fallback font.
</description>
</method>
+ <method name="get_available_chars" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ Returns a string containing all the characters available in the main and all the fallback fonts.
+ If a given character is included in more than one font, it appears only once in the returned string.
+ </description>
+ </method>
<method name="get_fallback" qualifiers="const">
<return type="DynamicFontData">
</return>
@@ -88,10 +105,12 @@
Extra spacing at the bottom in pixels.
</member>
<member name="extra_spacing_char" type="int" setter="set_spacing" getter="get_spacing" default="0">
- Extra character spacing in pixels.
+ Extra spacing for each character in pixels.
+ This can be a negative number to make the distance between characters smaller.
</member>
<member name="extra_spacing_space" type="int" setter="set_spacing" getter="get_spacing" default="0">
- Extra space spacing in pixels.
+ Extra spacing for the space character (in addition to [member extra_spacing_char]) in pixels.
+ This can be a negative number to make the distance between words smaller.
</member>
<member name="extra_spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0">
Extra spacing at the top in pixels.
@@ -118,10 +137,10 @@
Spacing at the bottom.
</constant>
<constant name="SPACING_CHAR" value="2" enum="SpacingType">
- Character spacing.
+ Spacing for each character.
</constant>
<constant name="SPACING_SPACE" value="3" enum="SpacingType">
- Space spacing.
+ Spacing for the space character.
</constant>
</constants>
</class>
diff --git a/doc/classes/DynamicFontData.xml b/doc/classes/DynamicFontData.xml
index 2b4ec17bf1..45585f17e0 100644
--- a/doc/classes/DynamicFontData.xml
+++ b/doc/classes/DynamicFontData.xml
@@ -7,12 +7,13 @@
Used with [DynamicFont] to describe the location of a vector font file for dynamic rendering at runtime.
</description>
<tutorials>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
<members>
<member name="antialiased" type="bool" setter="set_antialiased" getter="is_antialiased" default="true">
- If [code]true[/code], the font is rendered with anti-aliasing.
+ If [code]true[/code], the font is rendered with anti-aliasing. This property applies both to the main font and its outline (if it has one).
</member>
<member name="font_path" type="String" setter="set_font_path" getter="get_font_path" default="&quot;&quot;">
The path to the vector font file.
diff --git a/doc/classes/EditorDebuggerPlugin.xml b/doc/classes/EditorDebuggerPlugin.xml
new file mode 100644
index 0000000000..b97933e582
--- /dev/null
+++ b/doc/classes/EditorDebuggerPlugin.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EditorDebuggerPlugin" inherits="Control" version="4.0">
+ <brief_description>
+ A base class to implement debugger plugins.
+ </brief_description>
+ <description>
+ All debugger plugin scripts must extend [EditorDebuggerPlugin]. It provides functions related to editor side of debugger.
+ You don't need to instantiate this class. That is handled by the debugger itself. [Control] nodes can be added as child nodes to provide a GUI front-end for the plugin.
+ Do not queue_free/reparent it's instance otherwise the instance becomes unusable.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="has_capture">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <description>
+ Returns [code]true[/code] if a message capture with given name is present otherwise [code]false[/code].
+ </description>
+ </method>
+ <method name="is_breaked">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if the game is in break state otherwise [code]false[/code].
+ </description>
+ </method>
+ <method name="is_debuggable">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if the game can be debugged otherwise [code]false[/code].
+ </description>
+ </method>
+ <method name="is_session_active">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if there is an instance of the game running with the attached debugger otherwise [code]false[/code].
+ </description>
+ </method>
+ <method name="register_message_capture">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="callable" type="Callable">
+ </argument>
+ <description>
+ Registers a message capture with given [code]name[/code]. If [code]name[/code] is "my_message" then messages starting with "my_message:" will be called with the given callable.
+ Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return [code]true[/code] otherwise [code]false[/code].
+ </description>
+ </method>
+ <method name="send_message">
+ <return type="void">
+ </return>
+ <argument index="0" name="message" type="String">
+ </argument>
+ <argument index="1" name="data" type="Array">
+ </argument>
+ <description>
+ Sends a message with given [code]message[/code] and [code]data[/code] array.
+ </description>
+ </method>
+ <method name="unregister_message_capture">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <description>
+ Unregisters the message capture with given name.
+ </description>
+ </method>
+ </methods>
+ <signals>
+ <signal name="breaked">
+ <argument index="0" name="can_debug" type="bool">
+ </argument>
+ <description>
+ Emitted when the game enters a break state.
+ </description>
+ </signal>
+ <signal name="continued">
+ <description>
+ Emitted when the game exists a break state.
+ </description>
+ </signal>
+ <signal name="started">
+ <description>
+ Emitted when the debugging starts.
+ </description>
+ </signal>
+ <signal name="stopped">
+ <description>
+ Emitted when the debugging stops.
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml
index 8cfd3b63d6..9ef2bd21cc 100644
--- a/doc/classes/EditorExportPlugin.xml
+++ b/doc/classes/EditorExportPlugin.xml
@@ -70,12 +70,24 @@
<description>
</description>
</method>
+ <method name="add_ios_embedded_framework">
+ <return type="void">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ Adds a dynamic library (*.dylib, *.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary.
+ [b]Note:[/b] For static libraries (*.a) works in same way as [code]add_ios_framework[/code].
+ This method should not be used for System libraries as they are already present on the device.
+ </description>
+ </method>
<method name="add_ios_framework">
<return type="void">
</return>
<argument index="0" name="path" type="String">
</argument>
<description>
+ Adds a static library (*.a) or dynamic library (*.dylib, *.framework) to Linking Phase in iOS's Xcode project.
</description>
</method>
<method name="add_ios_linker_flags">
diff --git a/doc/classes/EditorFeatureProfile.xml b/doc/classes/EditorFeatureProfile.xml
index eb03d3010f..e05a685dd7 100644
--- a/doc/classes/EditorFeatureProfile.xml
+++ b/doc/classes/EditorFeatureProfile.xml
@@ -135,15 +135,15 @@
<constant name="FEATURE_SCENE_TREE" value="3" enum="Feature">
Scene tree editing. If this feature is disabled, the Scene tree dock will still be visible but will be read-only.
</constant>
- <constant name="FEATURE_IMPORT_DOCK" value="4" enum="Feature">
- The Import dock. If this feature is disabled, the Import dock won't be visible.
- </constant>
- <constant name="FEATURE_NODE_DOCK" value="5" enum="Feature">
+ <constant name="FEATURE_NODE_DOCK" value="4" enum="Feature">
The Node dock. If this feature is disabled, signals and groups won't be visible and modifiable from the editor.
</constant>
- <constant name="FEATURE_FILESYSTEM_DOCK" value="6" enum="Feature">
+ <constant name="FEATURE_FILESYSTEM_DOCK" value="5" enum="Feature">
The FileSystem dock. If this feature is disabled, the FileSystem dock won't be visible.
</constant>
+ <constant name="FEATURE_IMPORT_DOCK" value="6" enum="Feature">
+ The Import dock. If this feature is disabled, the Import dock won't be visible.
+ </constant>
<constant name="FEATURE_MAX" value="7" enum="Feature">
Represents the size of the [enum Feature] enum.
</constant>
diff --git a/doc/classes/EditorFileSystem.xml b/doc/classes/EditorFileSystem.xml
index 9bb51af2d0..5461dccd27 100644
--- a/doc/classes/EditorFileSystem.xml
+++ b/doc/classes/EditorFileSystem.xml
@@ -97,6 +97,7 @@
<argument index="0" name="resources" type="PackedStringArray">
</argument>
<description>
+ Emitted if at least one resource is reloaded when the filesystem is scanned.
</description>
</signal>
<signal name="sources_changed">
diff --git a/doc/classes/EditorFileSystemDirectory.xml b/doc/classes/EditorFileSystemDirectory.xml
index 096fe5df8f..b852ae1063 100644
--- a/doc/classes/EditorFileSystemDirectory.xml
+++ b/doc/classes/EditorFileSystemDirectory.xml
@@ -67,6 +67,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the base class of the script class defined in the file at index [code]idx[/code]. If the file doesn't define a script class using the [code]class_name[/code] syntax, this will return an empty string.
</description>
</method>
<method name="get_file_script_class_name" qualifiers="const">
@@ -75,6 +76,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the name of the script class defined in the file at index [code]idx[/code]. If the file doesn't define a script class using the [code]class_name[/code] syntax, this will return an empty string.
</description>
</method>
<method name="get_file_type" qualifiers="const">
diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml
index 0aac59c727..e5401134bf 100644
--- a/doc/classes/EditorImportPlugin.xml
+++ b/doc/classes/EditorImportPlugin.xml
@@ -5,9 +5,10 @@
</brief_description>
<description>
EditorImportPlugins provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. Register your [EditorPlugin] with [method EditorPlugin.add_import_plugin].
- EditorImportPlugins work by associating with specific file extensions and a resource type. See [method get_recognized_extensions] and [method get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].import[/code] directory.
+ EditorImportPlugins work by associating with specific file extensions and a resource type. See [method get_recognized_extensions] and [method get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].godot/imported[/code] directory.
Below is an example EditorImportPlugin that imports a [Mesh] from a file with the extension ".special" or ".spec":
- [codeblock]
+ [codeblocks]
+ [gdscript]
tool
extends EditorImportPlugin
@@ -39,17 +40,79 @@
var file = File.new()
if file.open(source_file, File.READ) != OK:
return FAILED
-
- var mesh = Mesh.new()
- # Fill the Mesh with data read in "file", left as an exercise to the reader
+ var mesh = ArrayMesh.new()
+ # Fill the Mesh with data read in "file", left as an exercise to the reader.
var filename = save_path + "." + get_save_extension()
ResourceSaver.save(filename, mesh)
return OK
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+
+ public class MySpecialPlugin : EditorImportPlugin
+ {
+ public override String GetImporterName()
+ {
+ return "my.special.plugin";
+ }
+
+ public override String GetVisibleName()
+ {
+ return "Special Mesh Importer";
+ }
+
+ public override Godot.Collections.Array GetRecognizedExtensions()
+ {
+ return new Godot.Collections.Array{"special", "spec"};
+ }
+
+ public override String GetSaveExtension()
+ {
+ return "mesh";
+ }
+
+ public override String GetResourceType()
+ {
+ return "Mesh";
+ }
+
+ public override int GetPresetCount()
+ {
+ return 1;
+ }
+
+ public override String GetPresetName(int i)
+ {
+ return "Default";
+ }
+
+ public override Godot.Collections.Array GetImportOptions(int i)
+ {
+ return new Godot.Collections.Array{new Godot.Collections.Dictionary{{"name", "myOption"}, {"defaultValue", false}}};
+ }
+
+ public override int Import(String sourceFile, String savePath, Godot.Collections.Dictionary options, Godot.Collections.Array platformVariants, Godot.Collections.Array genFiles)
+ {
+ var file = new File();
+ if (file.Open(sourceFile, File.ModeFlags.Read) != Error.Ok)
+ {
+ return (int)Error.Failed;
+ }
+
+ var mesh = new ArrayMesh();
+ // Fill the Mesh with data read in "file", left as an exercise to the reader.
+ String filename = savePath + "." + GetSaveExtension();
+ ResourceSaver.Save(filename, mesh);
+ return (int)Error.Ok;
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link>
+ <link title="Import plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link>
</tutorials>
<methods>
<method name="get_import_options" qualifiers="virtual">
@@ -83,6 +146,30 @@
<argument index="1" name="options" type="Dictionary">
</argument>
<description>
+ This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example:
+ [codeblocks]
+ [gdscript]
+ func get_option_visibility(option, options):
+ # Only show the lossy quality setting if the compression mode is set to "Lossy".
+ if option == "compress/lossy_quality" and options.has("compress/mode"):
+ return int(options["compress/mode"]) == COMPRESS_LOSSY # This is a constant that you set
+
+ return true
+ [/gdscript]
+ [csharp]
+ public void GetOptionVisibility(string option, Godot.Collections.Dictionary options)
+ {
+ // Only show the lossy quality setting if the compression mode is set to "Lossy".
+ if (option == "compress/lossyQuality" &amp;&amp; options.Contains("compress/mode"))
+ {
+ return (int)options["compress/mode"] == COMPRESS_LOSSY; // This is a constant you set
+ }
+
+ return true;
+ }
+ [/csharp]
+ [/codeblocks]
+ Return [code]true[/code] to make all options always visible.
</description>
</method>
<method name="get_preset_count" qualifiers="virtual">
@@ -126,7 +213,7 @@
<return type="String">
</return>
<description>
- Gets the extension used to save this resource in the [code].import[/code] directory.
+ Gets the extension used to save this resource in the [code].godot/imported[/code] directory.
</description>
</method>
<method name="get_visible_name" qualifiers="virtual">
@@ -150,6 +237,8 @@
<argument index="4" name="gen_files" type="Array">
</argument>
<description>
+ Imports [code]source_file[/code] into [code]save_path[/code] with the import [code]options[/code] specified. The [code]platform_variants[/code] and [code]gen_files[/code] arrays will be modified by this function.
+ This method must be overridden to do the actual importing work. See this class' description for an example of overriding this method.
</description>
</method>
</methods>
diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml
index 2f62fe9e40..6f03165a97 100644
--- a/doc/classes/EditorInspector.xml
+++ b/doc/classes/EditorInspector.xml
@@ -14,6 +14,8 @@
<return type="void">
</return>
<description>
+ Refreshes the inspector.
+ [b]Note:[/b] To save on CPU resources, calling this method will do nothing if the time specified in [code]docks/property_editor/auto_refresh_interval[/code] editor setting hasn't passed yet since this method was last called. (By default, this interval is set to 0.3 seconds.)
</description>
</method>
</methods>
@@ -25,30 +27,35 @@
<argument index="0" name="id" type="int">
</argument>
<description>
+ Emitted when the Edit button of an [Object] has been pressed in the inspector. This is mainly used in the remote scene tree inspector.
</description>
</signal>
<signal name="property_deleted">
<argument index="0" name="property" type="String">
</argument>
<description>
+ Emitted when a property is removed from the inspector.
</description>
</signal>
<signal name="property_edited">
<argument index="0" name="property" type="String">
</argument>
<description>
+ Emitted when a property is edited in the inspector.
</description>
</signal>
<signal name="property_keyed">
<argument index="0" name="property" type="String">
</argument>
<description>
+ Emitted when a property is keyed in the inspector. Properties can be keyed by clicking the "key" icon next to a property when the Animation panel is toggled.
</description>
</signal>
<signal name="property_selected">
<argument index="0" name="property" type="String">
</argument>
<description>
+ Emitted when a property is selected in the inspector.
</description>
</signal>
<signal name="property_toggled">
@@ -57,6 +64,8 @@
<argument index="1" name="checked" type="bool">
</argument>
<description>
+ Emitted when a boolean property is toggled in the inspector.
+ [b]Note:[/b] This signal is never emitted if the internal [code]autoclear[/code] property enabled. Since this property is always enabled in the editor inspector, this signal is never emitted by the editor itself.
</description>
</signal>
<signal name="resource_selected">
@@ -65,10 +74,12 @@
<argument index="1" name="prop" type="String">
</argument>
<description>
+ Emitted when a resource is selected in the inspector.
</description>
</signal>
<signal name="restart_requested">
<description>
+ Emitted when a property that requires a restart to be applied is edited in the inspector. This is only used in the Project Settings and Editor Settings.
</description>
</signal>
</signals>
diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml
index 499c3b8271..c7561449b9 100644
--- a/doc/classes/EditorInterface.xml
+++ b/doc/classes/EditorInterface.xml
@@ -23,13 +23,14 @@
<return type="Control">
</return>
<description>
- Returns the main container of Godot editor's window. You can use it, for example, to retrieve the size of the container and place your controls accordingly.
+ Returns the main container of Godot editor's window. For example, you can use it to retrieve the size of the container and place your controls accordingly.
</description>
</method>
<method name="get_current_path" qualifiers="const">
<return type="String">
</return>
<description>
+ Returns the current path being viewed in the [FileSystemDock].
</description>
</method>
<method name="get_edited_scene_root">
@@ -43,26 +44,29 @@
<return type="EditorSettings">
</return>
<description>
- Returns the [EditorSettings].
+ Returns the editor's [EditorSettings] instance.
</description>
</method>
<method name="get_editor_viewport">
<return type="Control">
</return>
<description>
- Returns the editor [Viewport].
+ Returns the main editor control. Use this as a parent for main screens.
+ [b]Note:[/b] This returns the main editor control containing the whole editor, not the 2D or 3D viewports specifically.
</description>
</method>
<method name="get_file_system_dock">
<return type="FileSystemDock">
</return>
<description>
+ Returns the editor's [FileSystemDock] instance.
</description>
</method>
<method name="get_inspector" qualifiers="const">
<return type="EditorInspector">
</return>
<description>
+ Returns the editor's [EditorInspector] instance.
</description>
</method>
<method name="get_open_scenes" qualifiers="const">
@@ -72,38 +76,46 @@
Returns an [Array] with the file paths of the currently opened scenes.
</description>
</method>
+ <method name="get_playing_scene" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ Returns the name of the scene that is being played. If no scene is currently being played, returns an empty string.
+ </description>
+ </method>
<method name="get_resource_filesystem">
<return type="EditorFileSystem">
</return>
<description>
- Returns the [EditorFileSystem].
+ Returns the editor's [EditorFileSystem] instance.
</description>
</method>
<method name="get_resource_previewer">
<return type="EditorResourcePreview">
</return>
<description>
- Returns the [EditorResourcePreview].
+ Returns the editor's [EditorResourcePreview] instance.
</description>
</method>
<method name="get_script_editor">
<return type="ScriptEditor">
</return>
<description>
- Returns the [ScriptEditor].
+ Returns the editor's [ScriptEditor] instance.
</description>
</method>
<method name="get_selected_path" qualifiers="const">
<return type="String">
</return>
<description>
+ Returns the path of the directory currently selected in the [FileSystemDock]. If a file is selected, its base directory will be returned using [method String.get_base_dir] instead.
</description>
</method>
<method name="get_selection">
<return type="EditorSelection">
</return>
<description>
- Returns the [EditorSelection].
+ Returns the editor's [EditorSelection] instance.
</description>
</method>
<method name="inspect_object">
@@ -113,8 +125,17 @@
</argument>
<argument index="1" name="for_property" type="String" default="&quot;&quot;">
</argument>
+ <argument index="2" name="inspector_only" type="bool" default="false">
+ </argument>
+ <description>
+ Shows the given property on the given [code]object[/code] in the editor's Inspector dock. If [code]inspector_only[/code] is [code]true[/code], plugins will not attempt to edit [code]object[/code].
+ </description>
+ </method>
+ <method name="is_playing_scene" qualifiers="const">
+ <return type="bool">
+ </return>
<description>
- Shows the given property on the given [code]object[/code] in the Editor's Inspector dock.
+ Returns [code]true[/code] if a scene is currently being played, [code]false[/code] otherwise. Paused scenes are considered as being played.
</description>
</method>
<method name="is_plugin_enabled" qualifiers="const">
@@ -123,7 +144,7 @@
<argument index="0" name="plugin" type="String">
</argument>
<description>
- Returns the enabled status of a plugin. The plugin name is the same as its directory name.
+ Returns [code]true[/code] if the specified [code]plugin[/code] is enabled. The plugin name is the same as its directory name.
</description>
</method>
<method name="make_mesh_previews">
@@ -146,6 +167,29 @@
Opens the scene at the given path.
</description>
</method>
+ <method name="play_current_scene">
+ <return type="void">
+ </return>
+ <description>
+ Plays the currently active scene.
+ </description>
+ </method>
+ <method name="play_custom_scene">
+ <return type="void">
+ </return>
+ <argument index="0" name="scene_filepath" type="String">
+ </argument>
+ <description>
+ Plays the scene specified by its filepath.
+ </description>
+ </method>
+ <method name="play_main_scene">
+ <return type="void">
+ </return>
+ <description>
+ Plays the main scene.
+ </description>
+ </method>
<method name="reload_scene_from_path">
<return type="void">
</return>
@@ -182,20 +226,13 @@
Selects the file, with the path provided by [code]file[/code], in the FileSystem dock.
</description>
</method>
- <method name="set_distraction_free_mode">
- <return type="void">
- </return>
- <argument index="0" name="enter" type="bool">
- </argument>
- <description>
- </description>
- </method>
<method name="set_main_screen_editor">
<return type="void">
</return>
<argument index="0" name="name" type="String">
</argument>
<description>
+ Sets the editor's current main screen to the one specified in [code]name[/code]. [code]name[/code] must match the text of the tab in question exactly ([code]2D[/code], [code]3D[/code], [code]Script[/code], [code]AssetLib[/code]).
</description>
</method>
<method name="set_plugin_enabled">
@@ -209,7 +246,19 @@
Sets the enabled status of a plugin. The plugin name is the same as its directory name.
</description>
</method>
+ <method name="stop_playing_scene">
+ <return type="void">
+ </return>
+ <description>
+ Stops the scene that is currently playing.
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="distraction_free_mode" type="bool" setter="set_distraction_free_mode" getter="is_distraction_free_mode_enabled">
+ If [code]true[/code], enables distraction-free mode which hides side docks to increase the space available for the main view.
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/EditorNode3DGizmo.xml b/doc/classes/EditorNode3DGizmo.xml
index 6d695ddeea..45541b9263 100644
--- a/doc/classes/EditorNode3DGizmo.xml
+++ b/doc/classes/EditorNode3DGizmo.xml
@@ -15,6 +15,7 @@
<argument index="0" name="segments" type="PackedVector3Array">
</argument>
<description>
+ Adds the specified [code]segments[/code] to the gizmo's collision shape for picking. Call this function during [method redraw].
</description>
</method>
<method name="add_collision_triangles">
@@ -69,6 +70,7 @@
<argument index="3" name="material" type="Material" default="null">
</argument>
<description>
+ Adds a mesh to the gizmo with the specified [code]billboard[/code] state, [code]skeleton[/code] and [code]material[/code]. If [code]billboard[/code] is [code]true[/code], the mesh will rotate to always face the camera. Call this function during [method redraw].
</description>
</method>
<method name="add_unscaled_billboard">
@@ -88,6 +90,7 @@
<return type="void">
</return>
<description>
+ Removes everything in the gizmo including meshes, collisions and handles.
</description>
</method>
<method name="commit_handle" qualifiers="virtual">
@@ -143,14 +146,14 @@
<argument index="0" name="index" type="int">
</argument>
<description>
- Gets whether a handle is highlighted or not.
+ Returns [code]true[/code] if the handle at index [code]index[/code] is highlighted by being hovered with the mouse.
</description>
</method>
<method name="redraw" qualifiers="virtual">
<return type="void">
</return>
<description>
- This function is called when the Node3D this gizmo refers to changes (the [method Node3D.update_gizmo] is called).
+ This function is called when the [Node3D] this gizmo refers to changes (the [method Node3D.update_gizmo] is called).
</description>
</method>
<method name="set_handle" qualifiers="virtual">
@@ -173,6 +176,7 @@
<argument index="0" name="hidden" type="bool">
</argument>
<description>
+ Sets the gizmo's hidden state. If [code]true[/code], the gizmo will be hidden. If [code]false[/code], it will be shown.
</description>
</method>
<method name="set_spatial_node">
@@ -181,6 +185,7 @@
<argument index="0" name="node" type="Node">
</argument>
<description>
+ Sets the reference [Node3D] node for the gizmo. [code]node[/code] must inherit from [Node3D].
</description>
</method>
</methods>
diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml
index ca75b47fbf..adaaed4f1c 100644
--- a/doc/classes/EditorNode3DGizmoPlugin.xml
+++ b/doc/classes/EditorNode3DGizmoPlugin.xml
@@ -7,7 +7,7 @@
EditorNode3DGizmoPlugin allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorNode3DGizmoPlugin] for the simpler gizmos, or creating a new [EditorNode3DGizmo] type. See the tutorial in the documentation for more info.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link>
+ <link title="Spatial gizmo plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link>
</tutorials>
<methods>
<method name="add_material">
@@ -59,8 +59,11 @@
</argument>
<argument index="1" name="billboard" type="bool" default="false">
</argument>
+ <argument index="2" name="texture" type="Texture2D" default="null">
+ </argument>
<description>
Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_handles]. Should not be overridden.
+ You can optionally provide a texture to use instead of the default icon.
</description>
</method>
<method name="create_icon_material">
@@ -136,9 +139,11 @@
</description>
</method>
<method name="get_priority" qualifiers="virtual">
- <return type="String">
+ <return type="int">
</return>
<description>
+ Override this method to set the gizmo's priority. Higher values correspond to higher priority. If a gizmo with higher priority conflicts with another gizmo, only the gizmo with higher priority will be used.
+ All built-in editor gizmos return a priority of [code]-1[/code]. If not overridden, this method will return [code]0[/code], which means custom gizmos will automatically override built-in gizmos.
</description>
</method>
<method name="has_gizmo" qualifiers="virtual">
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 19583fca28..ca011abb36 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -7,7 +7,7 @@
Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. See also [EditorScript] to add functions to the editor.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html</link>
+ <link title="Editor plugins tutorial index">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html</link>
</tutorials>
<methods>
<method name="add_autoload_singleton">
@@ -22,7 +22,7 @@
</description>
</method>
<method name="add_control_to_bottom_panel">
- <return type="ToolButton">
+ <return type="Button">
</return>
<argument index="0" name="control" type="Control">
</argument>
@@ -76,6 +76,15 @@
During run-time, this will be a simple object with a script so this function does not need to be called then.
</description>
</method>
+ <method name="add_debugger_plugin">
+ <return type="void">
+ </return>
+ <argument index="0" name="script" type="Script">
+ </argument>
+ <description>
+ Adds a [Script] as debugger plugin to the Debugger. The script must extend [EditorDebuggerPlugin].
+ </description>
+ </method>
<method name="add_export_plugin">
<return type="void">
</return>
@@ -142,6 +151,15 @@
Adds a custom submenu under [b]Project &gt; Tools &gt;[/b] [code]name[/code]. [code]submenu[/code] should be an object of class [PopupMenu]. This submenu should be cleaned up using [code]remove_tool_menu_item(name)[/code].
</description>
</method>
+ <method name="add_translation_parser_plugin">
+ <return type="void">
+ </return>
+ <argument index="0" name="parser" type="EditorTranslationParserPlugin">
+ </argument>
+ <description>
+ Registers a custom translation parser plugin for extracting translatable strings from custom files.
+ </description>
+ </method>
<method name="apply_changes" qualifiers="virtual">
<return type="void">
</return>
@@ -192,6 +210,38 @@
<argument index="0" name="overlay" type="Control">
</argument>
<description>
+ Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays].
+ [codeblocks]
+ [gdscript]
+ func forward_canvas_draw_over_viewport(overlay):
+ # Draw a circle at cursor position.
+ overlay.draw_circle(overlay.get_local_mouse_position(), 64)
+
+ func forward_canvas_gui_input(event):
+ if event is InputEventMouseMotion:
+ # Redraw viewport when cursor is moved.
+ update_overlays()
+ return true
+ return false
+ [/gdscript]
+ [csharp]
+ public override void ForwardCanvasDrawOverViewport(Godot.Control overlay)
+ {
+ // Draw a circle at cursor position.
+ overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White);
+ }
+
+ public override bool ForwardCanvasGuiInput(InputEvent @event)
+ {
+ if (@event is InputEventMouseMotion)
+ {
+ // Redraw viewport when cursor is moved.
+ UpdateOverlays();
+ return true;
+ }
+ return false;
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="forward_canvas_force_draw_over_viewport" qualifiers="virtual">
@@ -200,6 +250,8 @@
<argument index="0" name="overlay" type="Control">
</argument>
<description>
+ This method is the same as [method forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
+ You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled].
</description>
</method>
<method name="forward_canvas_gui_input" qualifiers="virtual">
@@ -209,21 +261,85 @@
</argument>
<description>
Called when there is a root node in the current edited scene, [method handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Prevents the InputEvent to reach other Editor classes
func forward_canvas_gui_input(event):
- var forward = true
- return forward
- [/codeblock]
+ return true
+ [/gdscript]
+ [csharp]
+ // Prevents the InputEvent to reach other Editor classes
+ public override bool ForwardCanvasGuiInput(InputEvent @event)
+ {
+ return true;
+ }
+ [/csharp]
+ [/codeblocks]
Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. Example:
- [codeblock]
- # Consumes InputEventMouseMotion and forwards other InputEvent types
+ [codeblocks]
+ [gdscript]
+ # Consumes InputEventMouseMotion and forwards other InputEvent types.
func forward_canvas_gui_input(event):
- var forward = false
+ return event is InputEventMouseMotion
+ [/gdscript]
+ [csharp]
+ // Consumes InputEventMouseMotion and forwards other InputEvent types.
+ public override bool ForwardCanvasGuiInput(InputEvent @event)
+ {
+ return @event is InputEventMouseMotion;
+ }
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="forward_spatial_draw_over_viewport" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="overlay" type="Control">
+ </argument>
+ <description>
+ Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays].
+ [codeblocks]
+ [gdscript]
+ func forward_spatial_draw_over_viewport(overlay):
+ # Draw a circle at cursor position.
+ overlay.draw_circle(overlay.get_local_mouse_position(), 64)
+
+ func forward_spatial_gui_input(camera, event):
if event is InputEventMouseMotion:
- forward = true
- return forward
- [/codeblock]
+ # Redraw viewport when cursor is moved.
+ update_overlays()
+ return true
+ return false
+ [/gdscript]
+ [csharp]
+ public override void ForwardSpatialDrawOverViewport(Godot.Control overlay)
+ {
+ // Draw a circle at cursor position.
+ overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White);
+ }
+
+ public override bool ForwardSpatialGuiInput(Godot.Camera3D camera, InputEvent @event)
+ {
+ if (@event is InputEventMouseMotion)
+ {
+ // Redraw viewport when cursor is moved.
+ UpdateOverlays();
+ return true;
+ }
+ return false;
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="forward_spatial_force_draw_over_viewport" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="overlay" type="Control">
+ </argument>
+ <description>
+ This method is the same as [method forward_spatial_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
+ You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled].
</description>
</method>
<method name="forward_spatial_gui_input" qualifiers="virtual">
@@ -235,21 +351,35 @@
</argument>
<description>
Called when there is a root node in the current edited scene, [method handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example:
- [codeblock]
- # Prevents the InputEvent to reach other Editor classes
+ [codeblocks]
+ [gdscript]
+ # Prevents the InputEvent to reach other Editor classes.
func forward_spatial_gui_input(camera, event):
- var forward = true
- return forward
- [/codeblock]
+ return true
+ [/gdscript]
+ [csharp]
+ // Prevents the InputEvent to reach other Editor classes.
+ public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event)
+ {
+ return true;
+ }
+ [/csharp]
+ [/codeblocks]
Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. Example:
- [codeblock]
- # Consumes InputEventMouseMotion and forwards other InputEvent types
+ [codeblocks]
+ [gdscript]
+ # Consumes InputEventMouseMotion and forwards other InputEvent types.
func forward_spatial_gui_input(camera, event):
- var forward = false
- if event is InputEventMouseMotion:
- forward = true
- return forward
- [/codeblock]
+ return event is InputEventMouseMotion
+ [/gdscript]
+ [csharp]
+ // Consumes InputEventMouseMotion and forwards other InputEvent types.
+ public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event)
+ {
+ return @event is InputEventMouseMotion;
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_breakpoints" qualifiers="virtual">
@@ -273,13 +403,24 @@
Override this method in your plugin to return a [Texture2D] in order to give it an icon.
For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons.
Ideally, the plugin icon should be white with a transparent background and 16x16 pixels in size.
- [codeblock]
+ [codeblocks]
+ [gdscript]
func get_plugin_icon():
# You can use a custom icon:
return preload("res://addons/my_plugin/my_plugin_icon.svg")
# Or use a built-in icon:
return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override Texture2D GetPluginIcon()
+ {
+ // You can use a custom icon:
+ return ResourceLoader.Load&lt;Texture2D&gt;("res://addons/my_plugin/my_plugin_icon.svg");
+ // Or use a built-in icon:
+ return GetEditorInterface().GetBaseControl().GetIcon("Node", "EditorIcons");
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_plugin_name" qualifiers="virtual">
@@ -361,7 +502,7 @@
Remember that you have to manage the visibility of all your editor controls manually.
</description>
</method>
- <method name="queue_save_layout" qualifiers="const">
+ <method name="queue_save_layout">
<return type="void">
</return>
<description>
@@ -415,6 +556,15 @@
Removes a custom type added by [method add_custom_type].
</description>
</method>
+ <method name="remove_debugger_plugin">
+ <return type="void">
+ </return>
+ <argument index="0" name="script" type="Script">
+ </argument>
+ <description>
+ Removes the debugger plugin with given script fromm the Debugger.
+ </description>
+ </method>
<method name="remove_export_plugin">
<return type="void">
</return>
@@ -464,6 +614,15 @@
Removes a menu [code]name[/code] from [b]Project &gt; Tools[/b].
</description>
</method>
+ <method name="remove_translation_parser_plugin">
+ <return type="void">
+ </return>
+ <argument index="0" name="parser" type="EditorTranslationParserPlugin">
+ </argument>
+ <description>
+ Removes a registered custom translation parser plugin.
+ </description>
+ </method>
<method name="save_external_data" qualifiers="virtual">
<return type="void">
</return>
@@ -475,6 +634,7 @@
<return type="void">
</return>
<description>
+ Enables calling of [method forward_canvas_force_draw_over_viewport] for the 2D editor and [method forward_spatial_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin.
</description>
</method>
<method name="set_input_event_forwarding_always_enabled">
@@ -506,7 +666,7 @@
<return type="int">
</return>
<description>
- Updates the overlays of the editor (2D/3D) viewport.
+ Updates the overlays of the 2D and 3D editor viewport. Causes methods [method forward_canvas_draw_over_viewport], [method forward_canvas_force_draw_over_viewport], [method forward_spatial_draw_over_viewport] and [method forward_spatial_force_draw_over_viewport] to be called.
</description>
</method>
</methods>
diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml
index 4da3b58b94..f568263ff8 100644
--- a/doc/classes/EditorProperty.xml
+++ b/doc/classes/EditorProperty.xml
@@ -73,24 +73,25 @@
</methods>
<members>
<member name="checkable" type="bool" setter="set_checkable" getter="is_checkable" default="false">
- Used by the inspector, set when property is checkable.
+ Used by the inspector, set to [code]true[/code] when the property is checkable.
</member>
<member name="checked" type="bool" setter="set_checked" getter="is_checked" default="false">
- Used by the inspector, when the property is checked.
+ Used by the inspector, set to [code]true[/code] when the property is checked.
</member>
<member name="deletable" type="bool" setter="set_deletable" getter="is_deletable" default="false">
+ Used by the inspector, set to [code]true[/code] when the property can be deleted by the user.
</member>
<member name="draw_red" type="bool" setter="set_draw_red" getter="is_draw_red" default="false">
- Used by the inspector, when the property must draw with error color.
+ Used by the inspector, set to [code]true[/code] when the property must draw with error color. This is used for editable children's properties.
</member>
<member name="keying" type="bool" setter="set_keying" getter="is_keying" default="false">
- Used by the inspector, when the property can add keys for animation.
+ Used by the inspector, set to [code]true[/code] when the property can add keys for animation.
</member>
<member name="label" type="String" setter="set_label" getter="get_label" default="&quot;&quot;">
- Sets this property to change the label (if you want to show one).
+ Set this property to change the label (if you want to show one).
</member>
<member name="read_only" type="bool" setter="set_read_only" getter="is_read_only" default="false">
- Used by the inspector, when the property is read-only.
+ Used by the inspector, set to [code]true[/code] when the property is read-only.
</member>
</members>
<signals>
@@ -134,6 +135,7 @@
<argument index="0" name="property" type="StringName">
</argument>
<description>
+ Emitted when a property was deleted. Used internally.
</description>
</signal>
<signal name="property_keyed">
diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml
index 56fc0e3d1a..5cddecffa8 100644
--- a/doc/classes/EditorScenePostImport.xml
+++ b/doc/classes/EditorScenePostImport.xml
@@ -6,27 +6,53 @@
<description>
Imported scenes can be automatically modified right after import by setting their [b]Custom Script[/b] Import property to a [code]tool[/code] script that inherits from this class.
The [method post_import] callback receives the imported scene's root node and returns the modified version of the scene. Usage example:
- [codeblock]
- tool # Needed so it runs in editor
+ [codeblocks]
+ [gdscript]
+ tool # Needed so it runs in editor.
extends EditorScenePostImport
-
- # This sample changes all node names
-
- # Called right after the scene is imported and gets the root node
+ # This sample changes all node names.
+ # Called right after the scene is imported and gets the root node.
func post_import(scene):
# Change all node names to "modified_[oldnodename]"
iterate(scene)
return scene # Remember to return the imported scene
-
func iterate(node):
if node != null:
node.name = "modified_" + node.name
for child in node.get_children():
iterate(child)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+
+ // This sample changes all node names.
+ // Called right after the scene is imported and gets the root node.
+ [Tool]
+ public class NodeRenamer : EditorScenePostImport
+ {
+ public override Object PostImport(Object scene)
+ {
+ // Change all node names to "modified_[oldnodename]"
+ Iterate(scene as Node);
+ return scene; // Remember to return the imported scene
+ }
+ public void Iterate(Node node)
+ {
+ if (node != null)
+ {
+ node.Name = "modified_" + node.Name;
+ foreach (Node child in node.GetChildren())
+ {
+ Iterate(child);
+ }
+ }
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_scenes.html#custom-script</link>
+ <link title="Importing 3D scenes: Custom script">https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_scenes.html#custom-script</link>
</tutorials>
<methods>
<method name="get_source_file" qualifiers="const">
diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml
index 410301351f..60ccf451b8 100644
--- a/doc/classes/EditorScript.xml
+++ b/doc/classes/EditorScript.xml
@@ -4,16 +4,31 @@
Base script that can be used to add extension functions to the editor.
</brief_description>
<description>
- Scripts extending this class and implementing its [method _run] method can be executed from the Script Editor's [b]File &gt; Run[/b] menu option (or by pressing [code]Ctrl+Shift+X[/code]) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin]s instead.
+ Scripts extending this class and implementing its [method _run] method can be executed from the Script Editor's [b]File &gt; Run[/b] menu option (or by pressing [kbd]Ctrl + Shift + X[/kbd]) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin]s instead.
[b]Note:[/b] Extending scripts need to have [code]tool[/code] mode enabled.
[b]Example script:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
tool
extends EditorScript
func _run():
print("Hello from the Godot Editor!")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+
+ [Tool]
+ public class HelloEditor : EditorScript
+ {
+ public override void _Run()
+ {
+ GD.Print("Hello from the Godot Editor!");
+ }
+ }
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] The script is run in the Editor context, which means the output is visible in the console window started with the Editor (stdout) instead of the usual Godot [b]Output[/b] dock.
</description>
<tutorials>
diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml
index 19921ff5c8..6088ae7a43 100644
--- a/doc/classes/EditorSettings.xml
+++ b/doc/classes/EditorSettings.xml
@@ -5,12 +5,26 @@
</brief_description>
<description>
Object that holds the project-independent editor settings. These settings are generally visible in the [b]Editor &gt; Editor Settings[/b] menu.
- Accessing the settings is done by using the regular [Object] API, such as:
- [codeblock]
- settings.set(prop,value)
- settings.get(prop)
- list_of_settings = settings.get_property_list()
- [/codeblock]
+ Property names use slash delimiters to distinguish sections. Setting values can be of any [Variant] type. It's recommended to use [code]snake_case[/code] for editor settings to be consistent with the Godot editor itself.
+ Accessing the settings can be done using the following methods, such as:
+ [codeblocks]
+ [gdscript]
+ var settings = EditorInterface.get_editor_settings()
+ # `settings.set("some/property", 10)` also works as this class overrides `_set()` internally.
+ settings.set_setting("some/property", 10)
+ # `settings.get("some/property")` also works as this class overrides `_get()` internally.
+ settings.get_setting("some/property")
+ var list_of_settings = settings.get_property_list()
+ [/gdscript]
+ [csharp]
+ EditorSettings settings = GetEditorInterface().GetEditorSettings();
+ // `settings.set("some/property", value)` also works as this class overrides `_set()` internally.
+ settings.SetSetting("some/property", Value);
+ // `settings.get("some/property", value)` also works as this class overrides `_get()` internally.
+ settings.GetSetting("some/property");
+ Godot.Collections.Array listOfSettings = settings.GetPropertyList();
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_editor_settings].
</description>
<tutorials>
@@ -27,8 +41,10 @@
- [code]type[/code]: [int] (see [enum Variant.Type])
- optionally [code]hint[/code]: [int] (see [enum PropertyHint]) and [code]hint_string[/code]: [String]
[b]Example:[/b]
- [codeblock]
- editor_settings.set("category/property_name", 0)
+ [codeblocks]
+ [gdscript]
+ var settings = EditorInterface.get_editor_settings()
+ settings.set("category/property_name", 0)
var property_info = {
"name": "category/property_name",
@@ -37,8 +53,23 @@
"hint_string": "one,two,three"
}
- editor_settings.add_property_info(property_info)
- [/codeblock]
+ settings.add_property_info(property_info)
+ [/gdscript]
+ [csharp]
+ var settings = GetEditorInterface().GetEditorSettings();
+ settings.Set("category/property_name", 0);
+
+ var propertyInfo = new Godot.Collections.Dictionary
+ {
+ {"name", "category/propertyName"},
+ {"type", Variant.Type.Int},
+ {"hint", PropertyHint.Enum},
+ {"hint_string", "one,two,three"}
+ };
+
+ settings.AddPropertyInfo(propertyInfo);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="erase">
@@ -47,14 +78,14 @@
<argument index="0" name="property" type="String">
</argument>
<description>
- Erase a given setting (pass full property path).
+ Erases the setting whose name is specified by [code]property[/code].
</description>
</method>
<method name="get_favorites" qualifiers="const">
<return type="PackedStringArray">
</return>
<description>
- Gets the list of favorite files and directories for this project.
+ Returns the list of favorite files and directories for this project.
</description>
</method>
<method name="get_project_metadata" qualifiers="const">
@@ -67,20 +98,21 @@
<argument index="2" name="default" type="Variant" default="null">
</argument>
<description>
+ Returns project-specific metadata for the [code]section[/code] and [code]key[/code] specified. If the metadata doesn't exist, [code]default[/code] will be returned instead. See also [method set_project_metadata].
</description>
</method>
<method name="get_project_settings_dir" qualifiers="const">
<return type="String">
</return>
<description>
- Gets the specific project settings path. Projects all have a unique sub-directory inside the settings path where project specific settings are saved.
+ Returns the project-specific settings path. Projects all have a unique subdirectory inside the settings path where project-specific settings are saved.
</description>
</method>
<method name="get_recent_dirs" qualifiers="const">
<return type="PackedStringArray">
</return>
<description>
- Gets the list of recently visited folders in the file dialog for this project.
+ Returns the list of recently visited folders in the file dialog for this project.
</description>
</method>
<method name="get_setting" qualifiers="const">
@@ -89,6 +121,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
+ Returns the value of the setting specified by [code]name[/code]. This is equivalent to using [method Object.get] on the EditorSettings instance.
</description>
</method>
<method name="get_settings_dir" qualifiers="const">
@@ -106,6 +139,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
+ Returns [code]true[/code] if the setting specified by [code]name[/code] exists, [code]false[/code] otherwise.
</description>
</method>
<method name="property_can_revert">
@@ -114,6 +148,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
+ Returns [code]true[/code] if the setting specified by [code]name[/code] can have its value reverted to the default value, [code]false[/code] otherwise. When this method returns [code]true[/code], a Revert button will display next to the setting in the Editor Settings.
</description>
</method>
<method name="property_get_revert">
@@ -122,6 +157,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
+ Returns the default value of the setting specified by [code]name[/code]. This is the value that would be applied when clicking the Revert button in the Editor Settings.
</description>
</method>
<method name="set_favorites">
@@ -143,6 +179,7 @@
<argument index="2" name="update_current" type="bool">
</argument>
<description>
+ Sets the initial value of the setting specified by [code]name[/code] to [code]value[/code]. This is used to provide a value for the Revert button in the Editor Settings. If [code]update_current[/code] is true, the current value of the setting will be set to [code]value[/code] as well.
</description>
</method>
<method name="set_project_metadata">
@@ -155,6 +192,7 @@
<argument index="2" name="data" type="Variant">
</argument>
<description>
+ Sets project-specific metadata with the [code]section[/code], [code]key[/code] and [code]data[/code] specified. This metadata is stored outside the project folder and therefore won't be checked into version control. See also [method get_project_metadata].
</description>
</method>
<method name="set_recent_dirs">
@@ -174,19 +212,20 @@
<argument index="1" name="value" type="Variant">
</argument>
<description>
+ Sets the [code]value[/code] of the setting specified by [code]name[/code]. This is equivalent to using [method Object.set] on the EditorSettings instance.
</description>
</method>
</methods>
<signals>
<signal name="settings_changed">
<description>
- Emitted when editor settings change.
+ Emitted after any editor setting has changed.
</description>
</signal>
</signals>
<constants>
<constant name="NOTIFICATION_EDITOR_SETTINGS_CHANGED" value="10000">
- Emitted when editor settings change. It used by various editor plugins to update their visuals on theme changes or logic on configuration changes.
+ Emitted after any editor setting has changed. It's used by various editor plugins to update their visuals on theme changes or logic on configuration changes.
</constant>
</constants>
</class>
diff --git a/doc/classes/EditorSyntaxHighlighter.xml b/doc/classes/EditorSyntaxHighlighter.xml
new file mode 100644
index 0000000000..103d95e1d6
--- /dev/null
+++ b/doc/classes/EditorSyntaxHighlighter.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EditorSyntaxHighlighter" inherits="SyntaxHighlighter" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="_get_name" qualifiers="virtual">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="_get_supported_extentions" qualifiers="virtual">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="_get_supported_languages" qualifiers="virtual">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml
new file mode 100644
index 0000000000..c97459d9dc
--- /dev/null
+++ b/doc/classes/EditorTranslationParserPlugin.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EditorTranslationParserPlugin" inherits="Reference" version="4.0">
+ <brief_description>
+ Plugin for adding custom parsers to extract strings that are to be translated from custom files (.csv, .json etc.).
+ </brief_description>
+ <description>
+ Plugins are registered via [method EditorPlugin.add_translation_parser_plugin] method. To define the parsing and string extraction logic, override the [method parse_file] method in script.
+ Add the extracted strings to argument [code]msgids[/code] or [code]msgids_context_plural[/code] if context or plural is used.
+ When adding to [code]msgids_context_plural[/code], you must add the data using the format [code]["A", "B", "C"][/code], where [code]A[/code] represents the extracted string, [code]B[/code] represents the context, and [code]C[/code] represents the plural version of the extracted string. If you want to add only context but not plural, put [code]""[/code] for the plural slot. The idea is the same if you only want to add plural but not context. See the code below for concrete examples.
+ The extracted strings will be written into a POT file selected by user under "POT Generation" in "Localization" tab in "Project Settings" menu.
+ Below shows an example of a custom parser that extracts strings from a CSV file to write into a POT.
+ [codeblocks]
+ [gdscript]
+ tool
+ extends EditorTranslationParserPlugin
+
+ func parse_file(path, msgids, msgids_context_plural):
+ var file = File.new()
+ file.open(path, File.READ)
+ var text = file.get_as_text()
+ var split_strs = text.split(",", false)
+ for s in split_strs:
+ msgids.append(s)
+ #print("Extracted string: " + s)
+
+ func get_recognized_extensions():
+ return ["csv"]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+
+ [Tool]
+ public class CustomParser : EditorTranslationParserPlugin
+ {
+ public override void ParseFile(string path, Godot.Collections.Array msgids, Godot.Collections.Array msgidsContextPlural)
+ {
+ var file = new File();
+ file.Open(path, File.ModeFlags.Read);
+ string text = file.GetAsText();
+ string[] splitStrs = text.Split(",", false);
+ foreach (var s in splitStrs)
+ {
+ msgids.Add(s);
+ //GD.Print("Extracted string: " + s)
+ }
+ }
+
+ public override Godot.Collections.Array GetRecognizedExtensions()
+ {
+ return new Godot.Collections.Array{"csv"};
+ }
+ }
+ [/csharp]
+ [/codeblocks]
+ To add a translatable string associated with context or plural, add it to [code]msgids_context_plural[/code]:
+ [codeblocks]
+ [gdscript]
+ # This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals".
+ msgids_context_plural.append(["Test 1", "context", "test 1 plurals"])
+ # This will add a message with msgid "A test without context" and msgid_plural "plurals".
+ msgids_context_plural.append(["A test without context", "", "plurals"])
+ # This will add a message with msgid "Only with context" and msgctxt "a friendly context".
+ msgids_context_plural.append(["Only with context", "a friendly context", ""])
+ [/gdscript]
+ [csharp]
+ // This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals".
+ msgidsContextPlural.Add(new Godot.Collections.Array{"Test 1", "context", "test 1 Plurals"});
+ // This will add a message with msgid "A test without context" and msgid_plural "plurals".
+ msgidsContextPlural.Add(new Godot.Collections.Array{"A test without context", "", "plurals"});
+ // This will add a message with msgid "Only with context" and msgctxt "a friendly context".
+ msgidsContextPlural.Add(new Godot.Collections.Array{"Only with context", "a friendly context", ""});
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] If you override parsing logic for standard script types (GDScript, C#, etc.), it would be better to load the [code]path[/code] argument using [method ResourceLoader.load]. This is because built-in scripts are loaded as [Resource] type, not [File] type.
+ For example:
+ [codeblocks]
+ [gdscript]
+ func parse_file(path, msgids, msgids_context_plural):
+ var res = ResourceLoader.load(path, "Script")
+ var text = res.source_code
+ # Parsing logic.
+
+ func get_recognized_extensions():
+ return ["gd"]
+ [/gdscript]
+ [csharp]
+ public override void ParseFile(string path, Godot.Collections.Array msgids, Godot.Collections.Array msgidsContextPlural)
+ {
+ var res = ResourceLoader.Load&lt;Script&gt;(path, "Script");
+ string text = res.SourceCode;
+ // Parsing logic.
+ }
+
+ public override Godot.Collections.Array GetRecognizedExtensions()
+ {
+ return new Godot.Collections.Array{"gd"};
+ }
+ [/csharp]
+ [/codeblocks]
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="get_recognized_extensions" qualifiers="virtual">
+ <return type="Array">
+ </return>
+ <description>
+ Gets the list of file extensions to associate with this parser, e.g. [code]["csv"][/code].
+ </description>
+ </method>
+ <method name="parse_file" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <argument index="1" name="msgids" type="Array">
+ </argument>
+ <argument index="2" name="msgids_context_plural" type="Array">
+ </argument>
+ <description>
+ Override this method to define a custom parsing logic to extract the translatable strings.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml
index 45c153b6dc..fab8512e4a 100644
--- a/doc/classes/Engine.xml
+++ b/doc/classes/Engine.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Engine" inherits="Object" version="4.0">
<brief_description>
- Access to basic engine properties.
+ Access to engine properties.
</brief_description>
<description>
- The [Engine] class allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others.
+ The [Engine] singleton allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others.
</description>
<tutorials>
</tutorials>
@@ -34,7 +34,7 @@
</return>
<description>
Returns a Dictionary of Arrays of donor names.
- {[code]platinum_sponsors[/code], [code]gold_sponsors[/code], [code]mini_sponsors[/code], [code]gold_donors[/code], [code]silver_donors[/code], [code]bronze_donors[/code]}
+ {[code]platinum_sponsors[/code], [code]gold_sponsors[/code], [code]silver_sponsors[/code], [code]bronze_sponsors[/code], [code]mini_sponsors[/code], [code]gold_donors[/code], [code]silver_donors[/code], [code]bronze_donors[/code]}
</description>
</method>
<method name="get_frames_drawn">
@@ -117,12 +117,24 @@
[code]year[/code] - Holds the year the version was released in as an int
[code]string[/code] - [code]major[/code] + [code]minor[/code] + [code]patch[/code] + [code]status[/code] + [code]build[/code] in a single String
The [code]hex[/code] value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be [code]0x03010C[/code]. [b]Note:[/b] It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code:
- [codeblock]
+ [codeblocks]
+ [gdscript]
if Engine.get_version_info().hex &gt;= 0x030200:
# Do things specific to version 3.2 or later
else:
# Do things specific to versions before 3.2
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ if ((int)Engine.GetVersionInfo()["hex"] &gt;= 0x030200)
+ {
+ // Do things specific to version 3.2 or later
+ }
+ else
+ {
+ // Do things specific to versions before 3.2
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="has_singleton" qualifiers="const">
diff --git a/doc/classes/EngineDebugger.xml b/doc/classes/EngineDebugger.xml
new file mode 100644
index 0000000000..7db36b89d0
--- /dev/null
+++ b/doc/classes/EngineDebugger.xml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EngineDebugger" inherits="Object" version="4.0">
+ <brief_description>
+ Exposes the internal debugger.
+ </brief_description>
+ <description>
+ [EngineDebugger] handles the communication between the editor and the running game. It is active in the running game. Messages can be sent/received through it. It also manages the profilers.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="has_capture">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <description>
+ Returns [code]true[/code] if a capture with the given name is present otherwise [code]false[/code].
+ </description>
+ </method>
+ <method name="has_profiler">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <description>
+ Returns [code]true[/code] if a profiler with the given name is present otherwise [code]false[/code].
+ </description>
+ </method>
+ <method name="is_active">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if the debugger is active otherwise [code]false[/code].
+ </description>
+ </method>
+ <method name="is_profiling">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <description>
+ Returns [code]true[/code] if a profiler with the given name is present and active otherwise [code]false[/code].
+ </description>
+ </method>
+ <method name="profiler_add_frame_data">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="data" type="Array">
+ </argument>
+ <description>
+ Calls the [code]add[/code] callable of the profiler with given [code]name[/code] and [code]data[/code].
+ </description>
+ </method>
+ <method name="profiler_enable">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <argument index="2" name="arguments" type="Array" default="[ ]">
+ </argument>
+ <description>
+ Calls the [code]toggle[/code] callable of the profiler with given [code]name[/code] and [code]arguments[/code]. Enables/Disables the same profiler depending on [code]enable[/code] argument.
+ </description>
+ </method>
+ <method name="register_message_capture">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="callable" type="Callable">
+ </argument>
+ <description>
+ Registers a message capture with given [code]name[/code]. If [code]name[/code] is "my_message" then messages starting with "my_message:" will be called with the given callable.
+ Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return [code]true[/code] otherwise [code]false[/code].
+ </description>
+ </method>
+ <method name="register_profiler">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="toggle" type="Callable">
+ </argument>
+ <argument index="2" name="add" type="Callable">
+ </argument>
+ <argument index="3" name="tick" type="Callable">
+ </argument>
+ <description>
+ Registers a profiler with the given [code]name[/code].
+ [code]toggle[/code] callable is called when the profiler is enabled/disabled. It must take an argument array as an argument.
+ [code]add[/code] callable is called when data is added to profiler using [method EngineDebugger.profiler_add_frame_data]. It must take a data array as argument.
+ [code]tick[/code] callable is called at every active profiler iteration. It must take frame time, idle time, physics time, and physics idle time as arguments.
+ </description>
+ </method>
+ <method name="send_message">
+ <return type="void">
+ </return>
+ <argument index="0" name="message" type="String">
+ </argument>
+ <argument index="1" name="data" type="Array">
+ </argument>
+ <description>
+ Sends a message with given [code]message[/code] and [code]data[/code] array.
+ </description>
+ </method>
+ <method name="unregister_message_capture">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <description>
+ Unregisters the message capture with given [code]name[/code].
+ </description>
+ </method>
+ <method name="unregister_profiler">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <description>
+ Unregisters a profiler with given [code]name[/code].
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml
index 3642d92771..104c149784 100644
--- a/doc/classes/Environment.xml
+++ b/doc/classes/Environment.xml
@@ -11,17 +11,20 @@
- Adjustments
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/high_dynamic_range.html</link>
+ <link title="Environment and post-processing">https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link>
+ <link title="Light transport in game engines">https://docs.godotengine.org/en/latest/tutorials/3d/high_dynamic_range.html</link>
+ <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
+ <link title="2D HDR Demo">https://godotengine.org/asset-library/asset/110</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
- <method name="is_glow_level_enabled" qualifiers="const">
- <return type="bool">
+ <method name="get_glow_level" qualifiers="const">
+ <return type="float">
</return>
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns [code]true[/code] if the glow level [code]idx[/code] is specified, [code]false[/code] otherwise.
+ Returns the intensity of the glow level [code]idx[/code].
</description>
</method>
<method name="set_glow_level">
@@ -29,10 +32,10 @@
</return>
<argument index="0" name="idx" type="int">
</argument>
- <argument index="1" name="enabled" type="bool">
+ <argument index="1" name="intensity" type="float">
</argument>
<description>
- Enables or disables the glow level at index [code]idx[/code]. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled.
+ Sets the intensity of the glow level [code]idx[/code]. A value above [code]0.0[/code] enables the level. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled.
</description>
</method>
</methods>
@@ -46,7 +49,7 @@
<member name="adjustment_contrast" type="float" setter="set_adjustment_contrast" getter="get_adjustment_contrast" default="1.0">
The global contrast value of the rendered scene (default value is 1). Effective only if [code]adjustment_enabled[/code] is [code]true[/code].
</member>
- <member name="adjustment_enabled" type="bool" setter="set_adjustment_enable" getter="is_adjustment_enabled" default="false">
+ <member name="adjustment_enabled" type="bool" setter="set_adjustment_enabled" getter="is_adjustment_enabled" default="false">
If [code]true[/code], enables the [code]adjustment_*[/code] properties provided by this resource. If [code]false[/code], modifications to the [code]adjustment_*[/code] properties will have no effect on the rendered scene.
</member>
<member name="adjustment_saturation" type="float" setter="set_adjustment_saturation" getter="get_adjustment_saturation" default="1.0">
@@ -65,7 +68,7 @@
</member>
<member name="ambient_light_source" type="int" setter="set_ambient_source" getter="get_ambient_source" enum="Environment.AmbientSource" default="0">
</member>
- <member name="auto_exposure_enabled" type="bool" setter="set_tonemap_auto_exposure" getter="get_tonemap_auto_exposure" default="false">
+ <member name="auto_exposure_enabled" type="bool" setter="set_tonemap_auto_exposure_enabled" getter="is_tonemap_auto_exposure_enabled" default="false">
If [code]true[/code], enables the tonemapping auto exposure mode of the scene renderer. If [code]true[/code], the renderer will automatically determine the exposure setting to adapt to the scene's illumination and the observed light.
</member>
<member name="auto_exposure_max_luma" type="float" setter="set_tonemap_auto_exposure_max" getter="get_tonemap_auto_exposure_max" default="8.0">
@@ -95,47 +98,24 @@
<member name="background_mode" type="int" setter="set_background" getter="get_background" enum="Environment.BGMode" default="0">
The background mode. See [enum BGMode] for possible values.
</member>
- <member name="fog_color" type="Color" setter="set_fog_color" getter="get_fog_color" default="Color( 0.5, 0.6, 0.7, 1 )">
- The fog's [Color].
+ <member name="fog_aerial_perspective" type="float" setter="set_fog_aerial_perspective" getter="get_fog_aerial_perspective" default="0.0">
+ Blend factor between the fog's color and the color of the background [Sky]. Must have [member background_mode] set to [constant BG_SKY].
+ This is useful to simulate [url=https://en.wikipedia.org/wiki/Aerial_perspective]aerial perspective[/url] in large scenes with low density fog. However, it is not very useful for high-density fog, as the sky will shine through. When set to [code]1.0[/code], the fog color comes completely from the [Sky]. If set to [code]0.0[/code], aerial perspective is disabled.
</member>
- <member name="fog_depth_begin" type="float" setter="set_fog_depth_begin" getter="get_fog_depth_begin" default="10.0">
- The fog's depth starting distance from the camera.
- </member>
- <member name="fog_depth_curve" type="float" setter="set_fog_depth_curve" getter="get_fog_depth_curve" default="1.0">
- The fog depth's intensity curve. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve.
- </member>
- <member name="fog_depth_enabled" type="bool" setter="set_fog_depth_enabled" getter="is_fog_depth_enabled" default="true">
- If [code]true[/code], the depth fog effect is enabled. When enabled, fog will appear in the distance (relative to the camera).
- </member>
- <member name="fog_depth_end" type="float" setter="set_fog_depth_end" getter="get_fog_depth_end" default="100.0">
- The fog's depth end distance from the camera. If this value is set to 0, it will be equal to the current camera's [member Camera3D.far] value.
+ <member name="fog_density" type="float" setter="set_fog_density" getter="get_fog_density" default="0.001">
</member>
<member name="fog_enabled" type="bool" setter="set_fog_enabled" getter="is_fog_enabled" default="false">
- If [code]true[/code], fog effects are enabled. [member fog_height_enabled] and/or [member fog_depth_enabled] must be set to [code]true[/code] to actually display fog.
- </member>
- <member name="fog_height_curve" type="float" setter="set_fog_height_curve" getter="get_fog_height_curve" default="1.0">
- The height fog's intensity. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve.
+ If [code]true[/code], fog effects are enabled.
</member>
- <member name="fog_height_enabled" type="bool" setter="set_fog_height_enabled" getter="is_fog_height_enabled" default="false">
- If [code]true[/code], the height fog effect is enabled. When enabled, fog will appear in a defined height range, regardless of the distance from the camera. This can be used to simulate "deep water" effects with a lower performance cost compared to a dedicated shader.
+ <member name="fog_height" type="float" setter="set_fog_height" getter="get_fog_height" default="0.0">
</member>
- <member name="fog_height_max" type="float" setter="set_fog_height_max" getter="get_fog_height_max" default="0.0">
- The Y coordinate where the height fog will be the most intense. If this value is greater than [member fog_height_min], fog will be displayed from bottom to top. Otherwise, it will be displayed from top to bottom.
+ <member name="fog_height_density" type="float" setter="set_fog_height_density" getter="get_fog_height_density" default="0.0">
</member>
- <member name="fog_height_min" type="float" setter="set_fog_height_min" getter="get_fog_height_min" default="10.0">
- The Y coordinate where the height fog will be the least intense. If this value is greater than [member fog_height_max], fog will be displayed from top to bottom. Otherwise, it will be displayed from bottom to top.
+ <member name="fog_light_color" type="Color" setter="set_fog_light_color" getter="get_fog_light_color" default="Color( 0.5, 0.6, 0.7, 1 )">
</member>
- <member name="fog_sun_amount" type="float" setter="set_fog_sun_amount" getter="get_fog_sun_amount" default="0.0">
- The intensity of the depth fog color transition when looking towards the sun. The sun's direction is determined automatically using the DirectionalLight3D node in the scene.
+ <member name="fog_light_energy" type="float" setter="set_fog_light_energy" getter="get_fog_light_energy" default="1.0">
</member>
- <member name="fog_sun_color" type="Color" setter="set_fog_sun_color" getter="get_fog_sun_color" default="Color( 1, 0.9, 0.7, 1 )">
- The depth fog's [Color] when looking towards the sun.
- </member>
- <member name="fog_transmit_curve" type="float" setter="set_fog_transmit_curve" getter="get_fog_transmit_curve" default="1.0">
- The intensity of the fog light transmittance effect. Amount of light that the fog transmits.
- </member>
- <member name="fog_transmit_enabled" type="bool" setter="set_fog_transmit_enabled" getter="is_fog_transmit_enabled" default="false">
- Enables fog's light transmission effect. If [code]true[/code], light will be more visible in the fog to simulate light scattering as in real life.
+ <member name="fog_sun_scatter" type="float" setter="set_fog_sun_scatter" getter="get_fog_sun_scatter" default="0.0">
</member>
<member name="glow_blend_mode" type="int" setter="set_glow_blend_mode" getter="get_glow_blend_mode" enum="Environment.GlowBlendMode" default="2">
The glow blending mode.
@@ -156,36 +136,63 @@
The lower threshold of the HDR glow. When using the GLES2 renderer (which doesn't support HDR), this needs to be below [code]1.0[/code] for glow to be visible. A value of [code]0.9[/code] works well in this case.
</member>
<member name="glow_intensity" type="float" setter="set_glow_intensity" getter="get_glow_intensity" default="0.8">
- The glow intensity. When using the GLES2 renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering.
+ The overall brightness multiplier of the glow effect. When using the GLES2 renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering.
</member>
- <member name="glow_levels/1" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" default="false">
- If [code]true[/code], the 1st level of glow is enabled. This is the most "local" level (least blurry).
+ <member name="glow_levels/1" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0">
+ The intensity of the 1st level of glow. This is the most "local" level (least blurry).
</member>
- <member name="glow_levels/2" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" default="false">
- If [code]true[/code], the 2th level of glow is enabled.
+ <member name="glow_levels/2" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0">
+ The intensity of the 2nd level of glow.
</member>
- <member name="glow_levels/3" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" default="true">
- If [code]true[/code], the 3th level of glow is enabled.
+ <member name="glow_levels/3" type="float" setter="set_glow_level" getter="get_glow_level" default="1.0">
+ The intensity of the 3rd level of glow.
</member>
- <member name="glow_levels/4" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" default="false">
- If [code]true[/code], the 4th level of glow is enabled.
+ <member name="glow_levels/4" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0">
+ The intensity of the 4th level of glow.
</member>
- <member name="glow_levels/5" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" default="true">
- If [code]true[/code], the 5th level of glow is enabled.
+ <member name="glow_levels/5" type="float" setter="set_glow_level" getter="get_glow_level" default="1.0">
+ The intensity of the 5th level of glow.
</member>
- <member name="glow_levels/6" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" default="false">
- If [code]true[/code], the 6th level of glow is enabled.
+ <member name="glow_levels/6" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0">
+ The intensity of the 6th level of glow.
</member>
- <member name="glow_levels/7" type="bool" setter="set_glow_level" getter="is_glow_level_enabled" default="false">
- If [code]true[/code], the 7th level of glow is enabled. This is the most "global" level (blurriest).
+ <member name="glow_levels/7" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0">
+ The intensity of the 7th level of glow. This is the most "global" level (blurriest).
</member>
<member name="glow_mix" type="float" setter="set_glow_mix" getter="get_glow_mix" default="0.05">
</member>
+ <member name="glow_normalized" type="bool" setter="set_glow_normalized" getter="is_glow_normalized" default="false">
+ If [code]true[/code], glow levels will be normalized so that summed together their intensities equal [code]1.0[/code].
+ </member>
<member name="glow_strength" type="float" setter="set_glow_strength" getter="get_glow_strength" default="1.0">
- The glow strength. When using the GLES2 renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering.
+ The strength of the glow effect. This applies as the glow is blurred across the screen and increases the distance and intensity of the blur. When using the GLES2 renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering.
</member>
<member name="reflected_light_source" type="int" setter="set_reflection_source" getter="get_reflection_source" enum="Environment.ReflectionSource" default="0">
</member>
+ <member name="sdfgi_cascade0_distance" type="float" setter="set_sdfgi_cascade0_distance" getter="get_sdfgi_cascade0_distance" default="12.8">
+ </member>
+ <member name="sdfgi_cascades" type="int" setter="set_sdfgi_cascades" getter="get_sdfgi_cascades" enum="Environment.SDFGICascades" default="1">
+ </member>
+ <member name="sdfgi_enabled" type="bool" setter="set_sdfgi_enabled" getter="is_sdfgi_enabled" default="false">
+ </member>
+ <member name="sdfgi_energy" type="float" setter="set_sdfgi_energy" getter="get_sdfgi_energy" default="1.0">
+ </member>
+ <member name="sdfgi_max_distance" type="float" setter="set_sdfgi_max_distance" getter="get_sdfgi_max_distance" default="819.2">
+ </member>
+ <member name="sdfgi_min_cell_size" type="float" setter="set_sdfgi_min_cell_size" getter="get_sdfgi_min_cell_size" default="0.2">
+ </member>
+ <member name="sdfgi_normal_bias" type="float" setter="set_sdfgi_normal_bias" getter="get_sdfgi_normal_bias" default="1.1">
+ </member>
+ <member name="sdfgi_probe_bias" type="float" setter="set_sdfgi_probe_bias" getter="get_sdfgi_probe_bias" default="1.1">
+ </member>
+ <member name="sdfgi_read_sky_light" type="bool" setter="set_sdfgi_read_sky_light" getter="is_sdfgi_reading_sky_light" default="false">
+ </member>
+ <member name="sdfgi_use_multi_bounce" type="bool" setter="set_sdfgi_use_multi_bounce" getter="is_sdfgi_using_multi_bounce" default="false">
+ </member>
+ <member name="sdfgi_use_occlusion" type="bool" setter="set_sdfgi_use_occlusion" getter="is_sdfgi_using_occlusion" default="false">
+ </member>
+ <member name="sdfgi_y_scale" type="int" setter="set_sdfgi_y_scale" getter="get_sdfgi_y_scale" enum="Environment.SDFGIYScale" default="0">
+ </member>
<member name="sky" type="Sky" setter="set_sky" getter="get_sky">
The [Sky] resource used for this [Environment].
</member>
@@ -241,6 +248,22 @@
<member name="tonemap_white" type="float" setter="set_tonemap_white" getter="get_tonemap_white" default="1.0">
The white reference value for tonemapping. Only effective if the [member tonemap_mode] isn't set to [constant TONE_MAPPER_LINEAR].
</member>
+ <member name="volumetric_fog_density" type="float" setter="set_volumetric_fog_density" getter="get_volumetric_fog_density" default="0.01">
+ </member>
+ <member name="volumetric_fog_detail_spread" type="float" setter="set_volumetric_fog_detail_spread" getter="get_volumetric_fog_detail_spread" default="2.0">
+ </member>
+ <member name="volumetric_fog_enabled" type="bool" setter="set_volumetric_fog_enabled" getter="is_volumetric_fog_enabled" default="false">
+ </member>
+ <member name="volumetric_fog_gi_inject" type="float" setter="set_volumetric_fog_gi_inject" getter="get_volumetric_fog_gi_inject" default="0.0">
+ </member>
+ <member name="volumetric_fog_length" type="float" setter="set_volumetric_fog_length" getter="get_volumetric_fog_length" default="64.0">
+ </member>
+ <member name="volumetric_fog_light" type="Color" setter="set_volumetric_fog_light" getter="get_volumetric_fog_light" default="Color( 0, 0, 0, 1 )">
+ </member>
+ <member name="volumetric_fog_light_energy" type="float" setter="set_volumetric_fog_light_energy" getter="get_volumetric_fog_light_energy" default="1.0">
+ </member>
+ <member name="volumetric_fog_shadow_filter" type="int" setter="set_volumetric_fog_shadow_filter" getter="get_volumetric_fog_shadow_filter" enum="Environment.VolumetricFogShadowFilter" default="1">
+ </member>
</members>
<constants>
<constant name="BG_CLEAR_COLOR" value="0" enum="BGMode">
@@ -285,6 +308,18 @@
<constant name="REFLECTION_SOURCE_SKY" value="2" enum="ReflectionSource">
Use the [Sky] for reflections regardless of what the background is.
</constant>
+ <constant name="TONE_MAPPER_LINEAR" value="0" enum="ToneMapper">
+ Linear tonemapper operator. Reads the linear data and passes it on unmodified.
+ </constant>
+ <constant name="TONE_MAPPER_REINHARDT" value="1" enum="ToneMapper">
+ Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: [code]color = color / (1 + color)[/code].
+ </constant>
+ <constant name="TONE_MAPPER_FILMIC" value="2" enum="ToneMapper">
+ Filmic tonemapper operator.
+ </constant>
+ <constant name="TONE_MAPPER_ACES" value="3" enum="ToneMapper">
+ Academy Color Encoding System tonemapper operator.
+ </constant>
<constant name="GLOW_BLEND_MODE_ADDITIVE" value="0" enum="GlowBlendMode">
Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright sources.
</constant>
@@ -300,18 +335,6 @@
<constant name="GLOW_BLEND_MODE_MIX" value="4" enum="GlowBlendMode">
Mixes the glow with the underlying color to avoid increasing brightness as much while still maintaining a glow effect.
</constant>
- <constant name="TONE_MAPPER_LINEAR" value="0" enum="ToneMapper">
- Linear tonemapper operator. Reads the linear data and passes it on unmodified.
- </constant>
- <constant name="TONE_MAPPER_REINHARDT" value="1" enum="ToneMapper">
- Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: [code]color = color / (1 + color)[/code].
- </constant>
- <constant name="TONE_MAPPER_FILMIC" value="2" enum="ToneMapper">
- Filmic tonemapper operator.
- </constant>
- <constant name="TONE_MAPPER_ACES" value="3" enum="ToneMapper">
- Academy Color Encoding System tonemapper operator.
- </constant>
<constant name="SSAO_BLUR_DISABLED" value="0" enum="SSAOBlur">
No blur for the screen-space ambient occlusion effect (fastest).
</constant>
@@ -324,5 +347,25 @@
<constant name="SSAO_BLUR_3x3" value="3" enum="SSAOBlur">
3×3 blur for the screen-space ambient occlusion effect. Increases the radius of the blur for a smoother look, but can result in checkerboard-like artifacts.
</constant>
+ <constant name="SDFGI_CASCADES_4" value="0" enum="SDFGICascades">
+ </constant>
+ <constant name="SDFGI_CASCADES_6" value="1" enum="SDFGICascades">
+ </constant>
+ <constant name="SDFGI_CASCADES_8" value="2" enum="SDFGICascades">
+ </constant>
+ <constant name="SDFGI_Y_SCALE_DISABLED" value="0" enum="SDFGIYScale">
+ </constant>
+ <constant name="SDFGI_Y_SCALE_75_PERCENT" value="1" enum="SDFGIYScale">
+ </constant>
+ <constant name="SDFGI_Y_SCALE_50_PERCENT" value="2" enum="SDFGIYScale">
+ </constant>
+ <constant name="VOLUMETRIC_FOG_SHADOW_FILTER_DISABLED" value="0" enum="VolumetricFogShadowFilter">
+ </constant>
+ <constant name="VOLUMETRIC_FOG_SHADOW_FILTER_LOW" value="1" enum="VolumetricFogShadowFilter">
+ </constant>
+ <constant name="VOLUMETRIC_FOG_SHADOW_FILTER_MEDIUM" value="2" enum="VolumetricFogShadowFilter">
+ </constant>
+ <constant name="VOLUMETRIC_FOG_SHADOW_FILTER_HIGH" value="3" enum="VolumetricFogShadowFilter">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml
index fcd1aa43c0..d777c6fd9d 100644
--- a/doc/classes/Expression.xml
+++ b/doc/classes/Expression.xml
@@ -5,23 +5,48 @@
</brief_description>
<description>
An expression can be made of any arithmetic operation, built-in math function call, method call of a passed instance, or built-in type construction call.
- An example expression text using the built-in math functions could be [code]sqrt(pow(3,2) + pow(4,2))[/code].
+ An example expression text using the built-in math functions could be [code]sqrt(pow(3, 2) + pow(4, 2))[/code].
In the following example we use a [LineEdit] node to write our expression and show the result.
- [codeblock]
- onready var expression = Expression.new()
+ [codeblocks]
+ [gdscript]
+ var expression = Expression.new()
func _ready():
$LineEdit.connect("text_entered", self, "_on_text_entered")
func _on_text_entered(command):
- var error = expression.parse(command, [])
+ var error = expression.parse(command)
if error != OK:
print(expression.get_error_text())
return
- var result = expression.execute([], null, true)
+ var result = expression.execute()
if not expression.has_execute_failed():
$LineEdit.text = str(result)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public Expression expression = new Expression();
+
+ public override void _Ready()
+ {
+ GetNode("LineEdit").Connect("text_entered", this, nameof(OnTextEntered));
+ }
+
+ private void OnTextEntered(string command)
+ {
+ Error error = expression.Parse(command);
+ if (error != Error.Ok)
+ {
+ GD.Print(expression.GetErrorText());
+ return;
+ }
+ object result = expression.Execute();
+ if (!expression.HasExecuteFailed())
+ {
+ GetNode&lt;LineEdit&gt;("LineEdit").Text = result.ToString();
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/File.xml b/doc/classes/File.xml
index 17c65731ff..ada57a8114 100644
--- a/doc/classes/File.xml
+++ b/doc/classes/File.xml
@@ -20,9 +20,12 @@
file.close()
return content
[/codeblock]
+ In the example above, the file will be saved in the user data folder as specified in the [url=https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html]Data paths[/url] documentation.
+ [b]Note:[/b] To access project resources once exported, it is recommended to use [ResourceLoader] instead of the [File] API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link>
+ <link title="File system">https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="close">
@@ -47,35 +50,35 @@
</argument>
<description>
Returns [code]true[/code] if the file exists in the given path.
- [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and that their source asset will not be included in the exported game, as only the imported version is used (in the [code]res://.import[/code] folder). To check for the existence of such resources while taking into account the remapping to their imported location, use [method ResourceLoader.exists]. Typically, using [code]File.file_exists[/code] on an imported resource would work while you are developing in the editor (the source asset is present in [code]res://[/code], but fail when exported).
+ [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See [method ResourceLoader.exists] for an alternative approach that takes resource remapping into account.
</description>
</method>
<method name="get_16" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the next 16 bits from the file as an integer.
+ Returns the next 16 bits from the file as an integer. See [method store_16] for details on what values can be stored and retrieved this way.
</description>
</method>
<method name="get_32" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the next 32 bits from the file as an integer.
+ Returns the next 32 bits from the file as an integer. See [method store_32] for details on what values can be stored and retrieved this way.
</description>
</method>
<method name="get_64" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the next 64 bits from the file as an integer.
+ Returns the next 64 bits from the file as an integer. See [method store_64] for details on what values can be stored and retrieved this way.
</description>
</method>
<method name="get_8" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the next 8 bits from the file as an integer.
+ Returns the next 8 bits from the file as an integer. See [method store_8] for details on what values can be stored and retrieved this way.
</description>
</method>
<method name="get_as_text" qualifiers="const">
@@ -256,6 +259,7 @@
</argument>
<description>
Opens an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it.
+ [b]Note:[/b] The provided key must be 32 bytes long.
</description>
</method>
<method name="open_encrypted_with_pass">
@@ -297,7 +301,26 @@
</argument>
<description>
Stores an integer as 16 bits in the file.
- [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 2^16 - 1][/code].
+ [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 2^16 - 1][/code]. Any other value will overflow and wrap around.
+ To store a signed integer, use [method store_64] or store a signed integer from the interval [code][-2^15, 2^15 - 1][/code] (i.e. keeping one bit for the signedness) and compute its sign manually when reading. For example:
+ [codeblock]
+ const MAX_15B = 1 &lt;&lt; 15
+ const MAX_16B = 1 &lt;&lt; 16
+
+ func unsigned16_to_signed(unsigned):
+ return (unsigned + MAX_15B) % MAX_16B - MAX_15B
+
+ func _ready():
+ var f = File.new()
+ f.open("user://file.dat", File.WRITE_READ)
+ f.store_16(-42) # This wraps around and stores 65494 (2^16 - 42).
+ f.store_16(121) # In bounds, will store 121.
+ f.seek(0) # Go back to start to read the stored value.
+ var read1 = f.get_16() # 65494
+ var read2 = f.get_16() # 121
+ var converted1 = unsigned16_to_signed(read1) # -42
+ var converted2 = unsigned16_to_signed(read2) # 121
+ [/codeblock]
</description>
</method>
<method name="store_32">
@@ -307,7 +330,8 @@
</argument>
<description>
Stores an integer as 32 bits in the file.
- [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 2^32 - 1][/code].
+ [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 2^32 - 1][/code]. Any other value will overflow and wrap around.
+ To store a signed integer, use [method store_64], or convert it manually (see [method store_16] for an example).
</description>
</method>
<method name="store_64">
@@ -327,7 +351,8 @@
</argument>
<description>
Stores an integer as 8 bits in the file.
- [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 255][/code].
+ [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 255][/code]. Any other value will overflow and wrap around.
+ To store a signed integer, use [method store_64], or convert it manually (see [method store_16] for an example).
</description>
</method>
<method name="store_buffer">
@@ -375,8 +400,7 @@
<argument index="0" name="line" type="String">
</argument>
<description>
- Stores the given [String] as a line in the file.
- Text will be encoded as UTF-8.
+ Appends [code]line[/code] to the file followed by a line return character ([code]\n[/code]), encoding the text as UTF-8.
</description>
</method>
<method name="store_pascal_string">
@@ -404,8 +428,7 @@
<argument index="0" name="string" type="String">
</argument>
<description>
- Stores the given [String] in the file.
- Text will be encoded as UTF-8.
+ Appends [code]string[/code] to the file without a line return, encoding the text as UTF-8.
</description>
</method>
<method name="store_var">
@@ -428,16 +451,16 @@
</members>
<constants>
<constant name="READ" value="1" enum="ModeFlags">
- Opens the file for read operations.
+ Opens the file for read operations. The cursor is positioned at the beginning of the file.
</constant>
<constant name="WRITE" value="2" enum="ModeFlags">
- Opens the file for write operations. Create it if the file does not exist and truncate if it exists.
+ Opens the file for write operations. The file is created if it does not exist, and truncated if it does.
</constant>
<constant name="READ_WRITE" value="3" enum="ModeFlags">
- Opens the file for read and write operations. Does not truncate the file.
+ Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file.
</constant>
<constant name="WRITE_READ" value="7" enum="ModeFlags">
- Opens the file for read and write operations. Create it if the file does not exist and truncate if it exists.
+ Opens the file for read and write operations. The file is created if it does not exist, and truncated if it does. The cursor is positioned at the beginning of the file.
</constant>
<constant name="COMPRESSION_FASTLZ" value="0" enum="CompressionMode">
Uses the [url=http://fastlz.org/]FastLZ[/url] compression method.
diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml
index 99563ee367..b4afee7610 100644
--- a/doc/classes/FileDialog.xml
+++ b/doc/classes/FileDialog.xml
@@ -4,7 +4,7 @@
Dialog for selecting files or directories in the filesystem.
</brief_description>
<description>
- FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks.
+ FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. The FileDialog automatically sets its window title according to the [member file_mode]. If you want to use a custom title, disable this by setting [member mode_overrides_title] to [code]false[/code].
</description>
<tutorials>
</tutorials>
@@ -57,6 +57,7 @@
<members>
<member name="access" type="int" setter="set_access" getter="get_access" enum="FileDialog.Access" default="0">
The file system access scope. See enum [code]Access[/code] constants.
+ [b]Warning:[/b] Currently, in sandboxed environments such as HTML5 builds or sandboxed macOS apps, FileDialog cannot access the host file system. See [url=https://github.com/godotengine/godot-proposals/issues/1123]godot-proposals#1123[/url].
</member>
<member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir" default="&quot;res://&quot;">
The current working directory of the file dialog.
@@ -132,6 +133,12 @@
</constant>
</constants>
<theme_items>
+ <theme_item name="file" type="Texture2D">
+ Custom icon for files.
+ </theme_item>
+ <theme_item name="file_icon_modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ The color modulation applied to the file icon.
+ </theme_item>
<theme_item name="files_disabled" type="Color" default="Color( 0, 0, 0, 0.7 )">
The color tint for disabled files (when the [FileDialog] is used in open folder mode).
</theme_item>
diff --git a/doc/classes/FileSystemDock.xml b/doc/classes/FileSystemDock.xml
index fdf29f89b2..c553f90e37 100644
--- a/doc/classes/FileSystemDock.xml
+++ b/doc/classes/FileSystemDock.xml
@@ -10,11 +10,11 @@
<method name="can_drop_data_fw" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="arg0" type="Vector2">
+ <argument index="0" name="position" type="Vector2">
</argument>
- <argument index="1" name="arg1" type="Variant">
+ <argument index="1" name="data" type="Variant">
</argument>
- <argument index="2" name="arg2" type="Control">
+ <argument index="2" name="from" type="Control">
</argument>
<description>
</description>
@@ -22,11 +22,11 @@
<method name="drop_data_fw">
<return type="void">
</return>
- <argument index="0" name="arg0" type="Vector2">
+ <argument index="0" name="position" type="Vector2">
</argument>
- <argument index="1" name="arg1" type="Variant">
+ <argument index="1" name="data" type="Variant">
</argument>
- <argument index="2" name="arg2" type="Control">
+ <argument index="2" name="from" type="Control">
</argument>
<description>
</description>
@@ -34,9 +34,9 @@
<method name="get_drag_data_fw">
<return type="Variant">
</return>
- <argument index="0" name="arg0" type="Vector2">
+ <argument index="0" name="position" type="Vector2">
</argument>
- <argument index="1" name="arg1" type="Control">
+ <argument index="1" name="from" type="Control">
</argument>
<description>
</description>
@@ -44,7 +44,7 @@
<method name="navigate_to_path">
<return type="void">
</return>
- <argument index="0" name="arg0" type="String">
+ <argument index="0" name="path" type="String">
</argument>
<description>
</description>
diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml
index 882f819e37..f49fbf0d2a 100644
--- a/doc/classes/Font.xml
+++ b/doc/classes/Font.xml
@@ -5,6 +5,8 @@
</brief_description>
<description>
Font contains a Unicode-compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts.
+ [b]Note:[/b] If a DynamicFont doesn't contain a character used in a string, the character in question will be replaced with codepoint [code]0xfffd[/code] if it's available in the DynamicFont. If this replacement character isn't available in the DynamicFont, the character will be hidden without displaying any replacement character in the string.
+ [b]Note:[/b] If a BitmapFont doesn't contain a character used in a string, the character in question will be hidden without displaying any replacement character in the string.
</description>
<tutorials>
</tutorials>
@@ -26,6 +28,7 @@
</argument>
<description>
Draw [code]string[/code] into a canvas item using the font at a given position, with [code]modulate[/code] color, and optionally clipping the width. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
+ See also [method CanvasItem.draw_string].
</description>
</method>
<method name="draw_char" qualifiers="const">
@@ -54,6 +57,17 @@
Returns the font ascent (number of pixels above the baseline).
</description>
</method>
+ <method name="get_char_size" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="char" type="int">
+ </argument>
+ <argument index="1" name="next" type="int" default="0">
+ </argument>
+ <description>
+ Returns the size of a character, optionally taking kerning into account if the next character is provided.
+ </description>
+ </method>
<method name="get_descent" qualifiers="const">
<return type="float">
</return>
diff --git a/doc/classes/FuncRef.xml b/doc/classes/FuncRef.xml
deleted file mode 100644
index bf0c0b0d34..0000000000
--- a/doc/classes/FuncRef.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="FuncRef" inherits="Reference" version="4.0">
- <brief_description>
- Reference to a function in an object.
- </brief_description>
- <description>
- In GDScript, functions are not [i]first-class objects[/i]. This means it is impossible to store them directly as variables, return them from another function, or pass them as arguments.
- However, by creating a [FuncRef] using the [method @GDScript.funcref] function, a reference to a function in a given object can be created, passed around and called.
- </description>
- <tutorials>
- </tutorials>
- <methods>
- <method name="call_func" qualifiers="vararg">
- <return type="Variant">
- </return>
- <description>
- Calls the referenced function previously set by [method set_function] or [method @GDScript.funcref].
- </description>
- </method>
- <method name="call_funcv">
- <return type="Variant">
- </return>
- <argument index="0" name="arg_array" type="Array">
- </argument>
- <description>
- Calls the referenced function previously set by [method set_function] or [method @GDScript.funcref]. Contrarily to [method call_func], this method does not support a variable number of arguments but expects all parameters to be passed via a single [Array].
- </description>
- </method>
- <method name="is_valid" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Returns whether the object still exists and has the function assigned.
- </description>
- </method>
- <method name="set_function">
- <return type="void">
- </return>
- <argument index="0" name="name" type="StringName">
- </argument>
- <description>
- The name of the referenced function to call on the object, without parentheses or any parameters.
- </description>
- </method>
- <method name="set_instance">
- <return type="void">
- </return>
- <argument index="0" name="instance" type="Object">
- </argument>
- <description>
- The object containing the referenced function. This object must be of a type actually inheriting from [Object], not a built-in type such as [int], [Vector2] or [Dictionary].
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
diff --git a/doc/classes/GIProbe.xml b/doc/classes/GIProbe.xml
index df50244c77..52d3698201 100644
--- a/doc/classes/GIProbe.xml
+++ b/doc/classes/GIProbe.xml
@@ -8,7 +8,8 @@
Having [GIProbe]s in a scene can be expensive, the quality of the probe can be turned down in exchange for better performance in the [ProjectSettings] using [member ProjectSettings.rendering/quality/gi_probes/quality].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/gi_probes.html</link>
+ <link title="GI probes">https://docs.godotengine.org/en/latest/tutorials/3d/gi_probes.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="bake">
@@ -19,7 +20,7 @@
<argument index="1" name="create_visual_debug" type="bool" default="false">
</argument>
<description>
- Bakes the effect from all [GeometryInstance3D]s marked with [member GeometryInstance3D.use_in_baked_light] and [Light3D]s marked with either [constant Light3D.BAKE_INDIRECT] or [constant Light3D.BAKE_ALL]. If [code]create_visual_debug[/code] is [code]true[/code], after baking the light, this will generate a [MultiMesh] that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the [GIProbe]'s data and debug any issues that may be occurring.
+ Bakes the effect from all [GeometryInstance3D]s marked with [constant GeometryInstance3D.GI_MODE_BAKED] and [Light3D]s marked with either [constant Light3D.BAKE_DYNAMIC] or [constant Light3D.BAKE_STATIC]. If [code]create_visual_debug[/code] is [code]true[/code], after baking the light, this will generate a [MultiMesh] that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the [GIProbe]'s data and debug any issues that may be occurring.
</description>
</method>
<method name="debug_bake">
diff --git a/doc/classes/GIProbeData.xml b/doc/classes/GIProbeData.xml
index 228e1afb4c..693df8f819 100644
--- a/doc/classes/GIProbeData.xml
+++ b/doc/classes/GIProbeData.xml
@@ -5,6 +5,7 @@
<description>
</description>
<tutorials>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="allocate">
diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml
index 64a2522f2f..c09151405a 100644
--- a/doc/classes/GPUParticles2D.xml
+++ b/doc/classes/GPUParticles2D.xml
@@ -8,7 +8,8 @@
Use the [code]process_material[/code] property to add a [ParticlesMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/particle_systems_2d.html</link>
+ <link title="Particle systems (2D)">https://docs.godotengine.org/en/latest/tutorials/2d/particle_systems_2d.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="capture_rect" qualifiers="const">
@@ -33,7 +34,7 @@
<member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="GPUParticles2D.DrawOrder" default="0">
Particle draw order. Uses [enum DrawOrder] values.
</member>
- <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="false">
+ <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="true">
If [code]true[/code], particles are being emitted.
</member>
<member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio" default="0.0">
@@ -51,9 +52,6 @@
<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true">
If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates.
</member>
- <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map">
- Normal map to be used for the [member texture] property.
- </member>
<member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false">
If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end.
</member>
diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml
index add8f28bf8..d1296c3418 100644
--- a/doc/classes/GPUParticles3D.xml
+++ b/doc/classes/GPUParticles3D.xml
@@ -8,7 +8,8 @@
Use the [code]process_material[/code] property to add a [ParticlesMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/controlling_thousands_of_fish.html</link>
+ <link title="Controlling thousands of fish with Particles">https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/controlling_thousands_of_fish.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="capture_aabb" qualifiers="const">
@@ -18,6 +19,22 @@
Returns the axis-aligned bounding box that contains all the particles that are active in the current frame.
</description>
</method>
+ <method name="emit_particle">
+ <return type="void">
+ </return>
+ <argument index="0" name="xform" type="Transform">
+ </argument>
+ <argument index="1" name="velocity" type="Vector3">
+ </argument>
+ <argument index="2" name="color" type="Color">
+ </argument>
+ <argument index="3" name="custom" type="Color">
+ </argument>
+ <argument index="4" name="flags" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_draw_pass_mesh" qualifiers="const">
<return type="Mesh">
</return>
@@ -50,6 +67,8 @@
<member name="amount" type="int" setter="set_amount" getter="get_amount" default="8">
Number of particles to emit.
</member>
+ <member name="collision_base_size" type="float" setter="set_collision_base_size" getter="get_collision_base_size" default="0.01">
+ </member>
<member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="GPUParticles3D.DrawOrder" default="0">
Particle draw order. Uses [enum DrawOrder] values.
</member>
@@ -68,7 +87,7 @@
<member name="draw_passes" type="int" setter="set_draw_passes" getter="get_draw_passes" default="1">
The number of draw passes when rendering particles.
</member>
- <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="false">
+ <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="true">
If [code]true[/code], particles are being emitted.
</member>
<member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio" default="0.0">
@@ -101,6 +120,8 @@
<member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0">
Speed scaling ratio. A value of [code]0[/code] can be used to pause the particles.
</member>
+ <member name="sub_emitter" type="NodePath" setter="set_sub_emitter" getter="get_sub_emitter" default="NodePath(&quot;&quot;)">
+ </member>
<member name="visibility_aabb" type="AABB" setter="set_visibility_aabb" getter="get_visibility_aabb" default="AABB( -4, -4, -4, 8, 8, 8 )">
The [AABB] that determines the area of the world part of which needs to be visible on screen for the particle system to be active.
</member>
@@ -115,6 +136,16 @@
<constant name="DRAW_ORDER_VIEW_DEPTH" value="2" enum="DrawOrder">
Particles are drawn in order of depth.
</constant>
+ <constant name="EMIT_FLAG_POSITION" value="1" enum="EmitFlags">
+ </constant>
+ <constant name="EMIT_FLAG_ROTATION_SCALE" value="2" enum="EmitFlags">
+ </constant>
+ <constant name="EMIT_FLAG_VELOCITY" value="4" enum="EmitFlags">
+ </constant>
+ <constant name="EMIT_FLAG_COLOR" value="8" enum="EmitFlags">
+ </constant>
+ <constant name="EMIT_FLAG_CUSTOM" value="16" enum="EmitFlags">
+ </constant>
<constant name="MAX_DRAW_PASSES" value="4">
Maximum number of draw passes supported.
</constant>
diff --git a/doc/classes/GPUParticlesAttractor3D.xml b/doc/classes/GPUParticlesAttractor3D.xml
new file mode 100644
index 0000000000..111827d294
--- /dev/null
+++ b/doc/classes/GPUParticlesAttractor3D.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesAttractor3D" inherits="VisualInstance3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="attenuation" type="float" setter="set_attenuation" getter="get_attenuation" default="1.0">
+ </member>
+ <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295">
+ </member>
+ <member name="directionality" type="float" setter="set_directionality" getter="get_directionality" default="0.0">
+ </member>
+ <member name="strength" type="float" setter="set_strength" getter="get_strength" default="1.0">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesAttractorBox.xml b/doc/classes/GPUParticlesAttractorBox.xml
new file mode 100644
index 0000000000..68616f9bbd
--- /dev/null
+++ b/doc/classes/GPUParticlesAttractorBox.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesAttractorBox" inherits="GPUParticlesAttractor3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesAttractorSphere.xml b/doc/classes/GPUParticlesAttractorSphere.xml
new file mode 100644
index 0000000000..6984427a96
--- /dev/null
+++ b/doc/classes/GPUParticlesAttractorSphere.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesAttractorSphere" inherits="GPUParticlesAttractor3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesAttractorVectorField.xml b/doc/classes/GPUParticlesAttractorVectorField.xml
new file mode 100644
index 0000000000..cf5e375ea3
--- /dev/null
+++ b/doc/classes/GPUParticlesAttractorVectorField.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesAttractorVectorField" inherits="GPUParticlesAttractor3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )">
+ </member>
+ <member name="texture" type="Texture3D" setter="set_texture" getter="get_texture">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesCollision3D.xml b/doc/classes/GPUParticlesCollision3D.xml
new file mode 100644
index 0000000000..dce9a32fc4
--- /dev/null
+++ b/doc/classes/GPUParticlesCollision3D.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesCollision3D" inherits="VisualInstance3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesCollisionBox.xml b/doc/classes/GPUParticlesCollisionBox.xml
new file mode 100644
index 0000000000..17fc124c41
--- /dev/null
+++ b/doc/classes/GPUParticlesCollisionBox.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesCollisionBox" inherits="GPUParticlesCollision3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesCollisionHeightField.xml b/doc/classes/GPUParticlesCollisionHeightField.xml
new file mode 100644
index 0000000000..c6987515a9
--- /dev/null
+++ b/doc/classes/GPUParticlesCollisionHeightField.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesCollisionHeightField" inherits="GPUParticlesCollision3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )">
+ </member>
+ <member name="follow_camera_enabled" type="bool" setter="set_follow_camera_mode" getter="is_follow_camera_mode_enabled" default="false">
+ </member>
+ <member name="follow_camera_push_ratio" type="float" setter="set_follow_camera_push_ratio" getter="get_follow_camera_push_ratio" default="0.1">
+ </member>
+ <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionHeightField.Resolution" default="2">
+ </member>
+ <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="GPUParticlesCollisionHeightField.UpdateMode" default="0">
+ </member>
+ </members>
+ <constants>
+ <constant name="RESOLUTION_256" value="0" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_512" value="1" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_1024" value="2" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_2048" value="3" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_4096" value="4" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_8192" value="5" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_MAX" value="6" enum="Resolution">
+ </constant>
+ <constant name="UPDATE_MODE_WHEN_MOVED" value="0" enum="UpdateMode">
+ </constant>
+ <constant name="UPDATE_MODE_ALWAYS" value="1" enum="UpdateMode">
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesCollisionSDF.xml b/doc/classes/GPUParticlesCollisionSDF.xml
new file mode 100644
index 0000000000..c3cbe4b1c6
--- /dev/null
+++ b/doc/classes/GPUParticlesCollisionSDF.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesCollisionSDF" inherits="GPUParticlesCollision3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )">
+ </member>
+ <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionSDF.Resolution" default="2">
+ </member>
+ <member name="texture" type="Texture3D" setter="set_texture" getter="get_texture">
+ </member>
+ <member name="thickness" type="float" setter="set_thickness" getter="get_thickness" default="1.0">
+ </member>
+ </members>
+ <constants>
+ <constant name="RESOLUTION_16" value="0" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_32" value="1" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_64" value="2" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_128" value="3" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_256" value="4" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_512" value="5" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_MAX" value="6" enum="Resolution">
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesCollisionSphere.xml b/doc/classes/GPUParticlesCollisionSphere.xml
new file mode 100644
index 0000000000..41150960d2
--- /dev/null
+++ b/doc/classes/GPUParticlesCollisionSphere.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesCollisionSphere" inherits="GPUParticlesCollision3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Generic6DOFJoint3D.xml b/doc/classes/Generic6DOFJoint3D.xml
index fae567dc58..ae86ab7365 100644
--- a/doc/classes/Generic6DOFJoint3D.xml
+++ b/doc/classes/Generic6DOFJoint3D.xml
@@ -373,6 +373,12 @@
<constant name="PARAM_LINEAR_MOTOR_FORCE_LIMIT" value="6" enum="Param">
The maximum force the linear motor will apply while trying to reach the velocity target.
</constant>
+ <constant name="PARAM_LINEAR_SPRING_STIFFNESS" value="7" enum="Param">
+ </constant>
+ <constant name="PARAM_LINEAR_SPRING_DAMPING" value="8" enum="Param">
+ </constant>
+ <constant name="PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT" value="9" enum="Param">
+ </constant>
<constant name="PARAM_ANGULAR_LOWER_LIMIT" value="10" enum="Param">
The minimum rotation in negative direction to break loose and rotate around the axes.
</constant>
@@ -400,6 +406,12 @@
<constant name="PARAM_ANGULAR_MOTOR_FORCE_LIMIT" value="18" enum="Param">
Maximum acceleration for the motor at the axes.
</constant>
+ <constant name="PARAM_ANGULAR_SPRING_STIFFNESS" value="19" enum="Param">
+ </constant>
+ <constant name="PARAM_ANGULAR_SPRING_DAMPING" value="20" enum="Param">
+ </constant>
+ <constant name="PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT" value="21" enum="Param">
+ </constant>
<constant name="PARAM_MAX" value="22" enum="Param">
Represents the size of the [enum Param] enum.
</constant>
diff --git a/doc/classes/Geometry.xml b/doc/classes/Geometry2D.xml
index 4d6f7b60a3..a6bcc1301b 100644
--- a/doc/classes/Geometry.xml
+++ b/doc/classes/Geometry2D.xml
@@ -1,67 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="Geometry" inherits="Object" version="4.0">
+<class name="Geometry2D" inherits="Object" version="4.0">
<brief_description>
- Helper node to calculate generic geometry operations.
+ Helper node to calculate generic geometry operations in 2D space.
</brief_description>
<description>
- Geometry provides users with a set of helper functions to create geometric shapes, compute intersections between shapes, and process various other geometric operations.
+ Geometry2D provides users with a set of helper functions to create geometric shapes, compute intersections between shapes, and process various other geometric operations.
</description>
<tutorials>
</tutorials>
<methods>
- <method name="build_box_planes">
- <return type="Array">
- </return>
- <argument index="0" name="extents" type="Vector3">
- </argument>
- <description>
- Returns an array with 6 [Plane]s that describe the sides of a box centered at the origin. The box size is defined by [code]extents[/code], which represents one (positive) corner of the box (i.e. half its actual size).
- </description>
- </method>
- <method name="build_capsule_planes">
- <return type="Array">
- </return>
- <argument index="0" name="radius" type="float">
- </argument>
- <argument index="1" name="height" type="float">
- </argument>
- <argument index="2" name="sides" type="int">
- </argument>
- <argument index="3" name="lats" type="int">
- </argument>
- <argument index="4" name="axis" type="int" enum="Vector3.Axis" default="2">
- </argument>
- <description>
- Returns an array of [Plane]s closely bounding a faceted capsule centered at the origin with radius [code]radius[/code] and height [code]height[/code]. The parameter [code]sides[/code] defines how many planes will be generated for the side part of the capsule, whereas [code]lats[/code] gives the number of latitudinal steps at the bottom and top of the capsule. The parameter [code]axis[/code] describes the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z).
- </description>
- </method>
- <method name="build_cylinder_planes">
- <return type="Array">
- </return>
- <argument index="0" name="radius" type="float">
- </argument>
- <argument index="1" name="height" type="float">
- </argument>
- <argument index="2" name="sides" type="int">
- </argument>
- <argument index="3" name="axis" type="int" enum="Vector3.Axis" default="2">
- </argument>
- <description>
- Returns an array of [Plane]s closely bounding a faceted cylinder centered at the origin with radius [code]radius[/code] and height [code]height[/code]. The parameter [code]sides[/code] defines how many planes will be generated for the round part of the cylinder. The parameter [code]axis[/code] describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z).
- </description>
- </method>
- <method name="clip_polygon">
- <return type="PackedVector3Array">
- </return>
- <argument index="0" name="points" type="PackedVector3Array">
- </argument>
- <argument index="1" name="plane" type="Plane">
- </argument>
- <description>
- Clips the polygon defined by the points in [code]points[/code] against the [code]plane[/code] and returns the points of the clipped polygon.
- </description>
- </method>
- <method name="clip_polygons_2d">
+ <method name="clip_polygons">
<return type="Array">
</return>
<argument index="0" name="polygon_a" type="PackedVector2Array">
@@ -73,7 +21,7 @@
If [code]polygon_b[/code] is enclosed by [code]polygon_a[/code], returns an outer polygon (boundary) and inner polygon (hole) which could be distinguished by calling [method is_polygon_clockwise].
</description>
</method>
- <method name="clip_polyline_with_polygon_2d">
+ <method name="clip_polyline_with_polygon">
<return type="Array">
</return>
<argument index="0" name="polyline" type="PackedVector2Array">
@@ -84,7 +32,7 @@
Clips [code]polyline[/code] against [code]polygon[/code] and returns an array of clipped polylines. This performs [constant OPERATION_DIFFERENCE] between the polyline and the polygon. This operation can be thought of as cutting a line with a closed shape.
</description>
</method>
- <method name="convex_hull_2d">
+ <method name="convex_hull">
<return type="PackedVector2Array">
</return>
<argument index="0" name="points" type="PackedVector2Array">
@@ -93,7 +41,7 @@
Given an array of [Vector2]s, returns the convex hull as a list of points in counterclockwise order. The last point is the same as the first one.
</description>
</method>
- <method name="exclude_polygons_2d">
+ <method name="exclude_polygons">
<return type="Array">
</return>
<argument index="0" name="polygon_a" type="PackedVector2Array">
@@ -101,24 +49,11 @@
<argument index="1" name="polygon_b" type="PackedVector2Array">
</argument>
<description>
- Mutually excludes common area defined by intersection of [code]polygon_a[/code] and [code]polygon_b[/code] (see [method intersect_polygons_2d]) and returns an array of excluded polygons. This performs [constant OPERATION_XOR] between polygons. In other words, returns all but common area between polygons.
+ Mutually excludes common area defined by intersection of [code]polygon_a[/code] and [code]polygon_b[/code] (see [method intersect_polygons]) and returns an array of excluded polygons. This performs [constant OPERATION_XOR] between polygons. In other words, returns all but common area between polygons.
The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise].
</description>
</method>
<method name="get_closest_point_to_segment">
- <return type="Vector3">
- </return>
- <argument index="0" name="point" type="Vector3">
- </argument>
- <argument index="1" name="s1" type="Vector3">
- </argument>
- <argument index="2" name="s2" type="Vector3">
- </argument>
- <description>
- Returns the 3D point on the 3D segment ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point will always be inside the specified segment.
- </description>
- </method>
- <method name="get_closest_point_to_segment_2d">
<return type="Vector2">
</return>
<argument index="0" name="point" type="Vector2">
@@ -132,19 +67,6 @@
</description>
</method>
<method name="get_closest_point_to_segment_uncapped">
- <return type="Vector3">
- </return>
- <argument index="0" name="point" type="Vector3">
- </argument>
- <argument index="1" name="s1" type="Vector3">
- </argument>
- <argument index="2" name="s2" type="Vector3">
- </argument>
- <description>
- Returns the 3D point on the 3D line defined by ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point can be inside the segment ([code]s1[/code], [code]s2[/code]) or outside of it, i.e. somewhere on the line extending from the segment.
- </description>
- </method>
- <method name="get_closest_point_to_segment_uncapped_2d">
<return type="Vector2">
</return>
<argument index="0" name="point" type="Vector2">
@@ -158,21 +80,6 @@
</description>
</method>
<method name="get_closest_points_between_segments">
- <return type="PackedVector3Array">
- </return>
- <argument index="0" name="p1" type="Vector3">
- </argument>
- <argument index="1" name="p2" type="Vector3">
- </argument>
- <argument index="2" name="q1" type="Vector3">
- </argument>
- <argument index="3" name="q2" type="Vector3">
- </argument>
- <description>
- Given the two 3D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector3Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]).
- </description>
- </method>
- <method name="get_closest_points_between_segments_2d">
<return type="PackedVector2Array">
</return>
<argument index="0" name="p1" type="Vector2">
@@ -187,16 +94,7 @@
Given the two 2D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector2Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]).
</description>
</method>
- <method name="get_uv84_normal_bit">
- <return type="int">
- </return>
- <argument index="0" name="normal" type="Vector3">
- </argument>
- <description>
- Used internally by the engine.
- </description>
- </method>
- <method name="intersect_polygons_2d">
+ <method name="intersect_polygons">
<return type="Array">
</return>
<argument index="0" name="polygon_a" type="PackedVector2Array">
@@ -208,7 +106,7 @@
The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise].
</description>
</method>
- <method name="intersect_polyline_with_polygon_2d">
+ <method name="intersect_polyline_with_polygon">
<return type="Array">
</return>
<argument index="0" name="polyline" type="PackedVector2Array">
@@ -252,7 +150,7 @@
Returns [code]true[/code] if [code]polygon[/code]'s vertices are ordered in clockwise order, otherwise returns [code]false[/code].
</description>
</method>
- <method name="line_intersects_line_2d">
+ <method name="line_intersects_line">
<return type="Variant">
</return>
<argument index="0" name="from_a" type="Vector2">
@@ -277,7 +175,7 @@
Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: [code]points[/code] is a vector of [Vector2] that specifies the positions of each tile, [code]size[/code] contains the overall size of the whole atlas as [Vector2].
</description>
</method>
- <method name="merge_polygons_2d">
+ <method name="merge_polygons">
<return type="Array">
</return>
<argument index="0" name="polygon_a" type="PackedVector2Array">
@@ -289,31 +187,38 @@
The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise].
</description>
</method>
- <method name="offset_polygon_2d">
+ <method name="offset_polygon">
<return type="Array">
</return>
<argument index="0" name="polygon" type="PackedVector2Array">
</argument>
<argument index="1" name="delta" type="float">
</argument>
- <argument index="2" name="join_type" type="int" enum="Geometry.PolyJoinType" default="0">
+ <argument index="2" name="join_type" type="int" enum="Geometry2D.PolyJoinType" default="0">
</argument>
<description>
Inflates or deflates [code]polygon[/code] by [code]delta[/code] units (pixels). If [code]delta[/code] is positive, makes the polygon grow outward. If [code]delta[/code] is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if [code]delta[/code] is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon.
Each polygon's vertices will be rounded as determined by [code]join_type[/code], see [enum PolyJoinType].
The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise].
+ [b]Note:[/b] To translate the polygon's vertices specifically, multiply them to a [Transform2D]:
+ [codeblock]
+ var polygon = PackedVector2Array([Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, 100)])
+ var offset = Vector2(50, 50)
+ polygon = Transform2D(0, offset) * polygon
+ print(polygon) # prints [Vector2(50, 50), Vector2(150, 50), Vector2(150, 150), Vector2(50, 150)]
+ [/codeblock]
</description>
</method>
- <method name="offset_polyline_2d">
+ <method name="offset_polyline">
<return type="Array">
</return>
<argument index="0" name="polyline" type="PackedVector2Array">
</argument>
<argument index="1" name="delta" type="float">
</argument>
- <argument index="2" name="join_type" type="int" enum="Geometry.PolyJoinType" default="0">
+ <argument index="2" name="join_type" type="int" enum="Geometry2D.PolyJoinType" default="0">
</argument>
- <argument index="3" name="end_type" type="int" enum="Geometry.PolyEndType" default="3">
+ <argument index="3" name="end_type" type="int" enum="Geometry2D.PolyEndType" default="3">
</argument>
<description>
Inflates or deflates [code]polyline[/code] by [code]delta[/code] units (pixels), producing polygons. If [code]delta[/code] is positive, makes the polyline grow outward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. If [code]delta[/code] is negative, returns an empty array.
@@ -337,67 +242,7 @@
Returns if [code]point[/code] is inside the triangle specified by [code]a[/code], [code]b[/code] and [code]c[/code].
</description>
</method>
- <method name="ray_intersects_triangle">
- <return type="Variant">
- </return>
- <argument index="0" name="from" type="Vector3">
- </argument>
- <argument index="1" name="dir" type="Vector3">
- </argument>
- <argument index="2" name="a" type="Vector3">
- </argument>
- <argument index="3" name="b" type="Vector3">
- </argument>
- <argument index="4" name="c" type="Vector3">
- </argument>
- <description>
- Tests if the 3D ray starting at [code]from[/code] with the direction of [code]dir[/code] intersects the triangle specified by [code]a[/code], [code]b[/code] and [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned.
- </description>
- </method>
- <method name="segment_intersects_circle">
- <return type="float">
- </return>
- <argument index="0" name="segment_from" type="Vector2">
- </argument>
- <argument index="1" name="segment_to" type="Vector2">
- </argument>
- <argument index="2" name="circle_position" type="Vector2">
- </argument>
- <argument index="3" name="circle_radius" type="float">
- </argument>
- <description>
- Given the 2D segment ([code]segment_from[/code], [code]segment_to[/code]), returns the position on the segment (as a number between 0 and 1) at which the segment hits the circle that is located at position [code]circle_position[/code] and has radius [code]circle_radius[/code]. If the segment does not intersect the circle, -1 is returned (this is also the case if the line extending the segment would intersect the circle, but the segment does not).
- </description>
- </method>
- <method name="segment_intersects_convex">
- <return type="PackedVector3Array">
- </return>
- <argument index="0" name="from" type="Vector3">
- </argument>
- <argument index="1" name="to" type="Vector3">
- </argument>
- <argument index="2" name="planes" type="Array">
- </argument>
- <description>
- Given a convex hull defined though the [Plane]s in the array [code]planes[/code], tests if the segment ([code]from[/code], [code]to[/code]) intersects with that hull. If an intersection is found, returns a [PackedVector3Array] containing the point the intersection and the hull's normal. If no intersecion is found, an the returned array is empty.
- </description>
- </method>
- <method name="segment_intersects_cylinder">
- <return type="PackedVector3Array">
- </return>
- <argument index="0" name="from" type="Vector3">
- </argument>
- <argument index="1" name="to" type="Vector3">
- </argument>
- <argument index="2" name="height" type="float">
- </argument>
- <argument index="3" name="radius" type="float">
- </argument>
- <description>
- Checks if the segment ([code]from[/code], [code]to[/code]) intersects the cylinder with height [code]height[/code] that is centered at the origin and has radius [code]radius[/code]. If no, returns an empty [PackedVector3Array]. If an intersection takes place, the returned array contains the point of intersection and the cylinder's normal at the point of intersection.
- </description>
- </method>
- <method name="segment_intersects_segment_2d">
+ <method name="segment_intersects_segment">
<return type="Variant">
</return>
<argument index="0" name="from_a" type="Vector2">
@@ -412,39 +257,7 @@
Checks if the two segments ([code]from_a[/code], [code]to_a[/code]) and ([code]from_b[/code], [code]to_b[/code]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns an empty [Variant].
</description>
</method>
- <method name="segment_intersects_sphere">
- <return type="PackedVector3Array">
- </return>
- <argument index="0" name="from" type="Vector3">
- </argument>
- <argument index="1" name="to" type="Vector3">
- </argument>
- <argument index="2" name="sphere_position" type="Vector3">
- </argument>
- <argument index="3" name="sphere_radius" type="float">
- </argument>
- <description>
- Checks if the segment ([code]from[/code], [code]to[/code]) intersects the sphere that is located at [code]sphere_position[/code] and has radius [code]sphere_radius[/code]. If no, returns an empty [PackedVector3Array]. If yes, returns a [PackedVector3Array] containing the point of intersection and the sphere's normal at the point of intersection.
- </description>
- </method>
- <method name="segment_intersects_triangle">
- <return type="Variant">
- </return>
- <argument index="0" name="from" type="Vector3">
- </argument>
- <argument index="1" name="to" type="Vector3">
- </argument>
- <argument index="2" name="a" type="Vector3">
- </argument>
- <argument index="3" name="b" type="Vector3">
- </argument>
- <argument index="4" name="c" type="Vector3">
- </argument>
- <description>
- Tests if the segment ([code]from[/code], [code]to[/code]) intersects the triangle [code]a[/code], [code]b[/code], [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned.
- </description>
- </method>
- <method name="triangulate_delaunay_2d">
+ <method name="triangulate_delaunay">
<return type="PackedInt32Array">
</return>
<argument index="0" name="points" type="PackedVector2Array">
diff --git a/doc/classes/Geometry3D.xml b/doc/classes/Geometry3D.xml
new file mode 100644
index 0000000000..d0b930defb
--- /dev/null
+++ b/doc/classes/Geometry3D.xml
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="Geometry3D" inherits="Object" version="4.0">
+ <brief_description>
+ Helper node to calculate generic geometry operations in 3D space.
+ </brief_description>
+ <description>
+ Geometry3D provides users with a set of helper functions to create geometric shapes, compute intersections between shapes, and process various other geometric operations.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="build_box_planes">
+ <return type="Array">
+ </return>
+ <argument index="0" name="extents" type="Vector3">
+ </argument>
+ <description>
+ Returns an array with 6 [Plane]s that describe the sides of a box centered at the origin. The box size is defined by [code]extents[/code], which represents one (positive) corner of the box (i.e. half its actual size).
+ </description>
+ </method>
+ <method name="build_capsule_planes">
+ <return type="Array">
+ </return>
+ <argument index="0" name="radius" type="float">
+ </argument>
+ <argument index="1" name="height" type="float">
+ </argument>
+ <argument index="2" name="sides" type="int">
+ </argument>
+ <argument index="3" name="lats" type="int">
+ </argument>
+ <argument index="4" name="axis" type="int" enum="Vector3.Axis" default="2">
+ </argument>
+ <description>
+ Returns an array of [Plane]s closely bounding a faceted capsule centered at the origin with radius [code]radius[/code] and height [code]height[/code]. The parameter [code]sides[/code] defines how many planes will be generated for the side part of the capsule, whereas [code]lats[/code] gives the number of latitudinal steps at the bottom and top of the capsule. The parameter [code]axis[/code] describes the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z).
+ </description>
+ </method>
+ <method name="build_cylinder_planes">
+ <return type="Array">
+ </return>
+ <argument index="0" name="radius" type="float">
+ </argument>
+ <argument index="1" name="height" type="float">
+ </argument>
+ <argument index="2" name="sides" type="int">
+ </argument>
+ <argument index="3" name="axis" type="int" enum="Vector3.Axis" default="2">
+ </argument>
+ <description>
+ Returns an array of [Plane]s closely bounding a faceted cylinder centered at the origin with radius [code]radius[/code] and height [code]height[/code]. The parameter [code]sides[/code] defines how many planes will be generated for the round part of the cylinder. The parameter [code]axis[/code] describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z).
+ </description>
+ </method>
+ <method name="clip_polygon">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="points" type="PackedVector3Array">
+ </argument>
+ <argument index="1" name="plane" type="Plane">
+ </argument>
+ <description>
+ Clips the polygon defined by the points in [code]points[/code] against the [code]plane[/code] and returns the points of the clipped polygon.
+ </description>
+ </method>
+ <method name="get_closest_point_to_segment">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="point" type="Vector3">
+ </argument>
+ <argument index="1" name="s1" type="Vector3">
+ </argument>
+ <argument index="2" name="s2" type="Vector3">
+ </argument>
+ <description>
+ Returns the 3D point on the 3D segment ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point will always be inside the specified segment.
+ </description>
+ </method>
+ <method name="get_closest_point_to_segment_uncapped">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="point" type="Vector3">
+ </argument>
+ <argument index="1" name="s1" type="Vector3">
+ </argument>
+ <argument index="2" name="s2" type="Vector3">
+ </argument>
+ <description>
+ Returns the 3D point on the 3D line defined by ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point can be inside the segment ([code]s1[/code], [code]s2[/code]) or outside of it, i.e. somewhere on the line extending from the segment.
+ </description>
+ </method>
+ <method name="get_closest_points_between_segments">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="p1" type="Vector3">
+ </argument>
+ <argument index="1" name="p2" type="Vector3">
+ </argument>
+ <argument index="2" name="q1" type="Vector3">
+ </argument>
+ <argument index="3" name="q2" type="Vector3">
+ </argument>
+ <description>
+ Given the two 3D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector3Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]).
+ </description>
+ </method>
+ <method name="ray_intersects_triangle">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <argument index="1" name="dir" type="Vector3">
+ </argument>
+ <argument index="2" name="a" type="Vector3">
+ </argument>
+ <argument index="3" name="b" type="Vector3">
+ </argument>
+ <argument index="4" name="c" type="Vector3">
+ </argument>
+ <description>
+ Tests if the 3D ray starting at [code]from[/code] with the direction of [code]dir[/code] intersects the triangle specified by [code]a[/code], [code]b[/code] and [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned.
+ </description>
+ </method>
+ <method name="segment_intersects_convex">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <argument index="1" name="to" type="Vector3">
+ </argument>
+ <argument index="2" name="planes" type="Array">
+ </argument>
+ <description>
+ Given a convex hull defined though the [Plane]s in the array [code]planes[/code], tests if the segment ([code]from[/code], [code]to[/code]) intersects with that hull. If an intersection is found, returns a [PackedVector3Array] containing the point the intersection and the hull's normal. If no intersecion is found, an the returned array is empty.
+ </description>
+ </method>
+ <method name="segment_intersects_cylinder">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <argument index="1" name="to" type="Vector3">
+ </argument>
+ <argument index="2" name="height" type="float">
+ </argument>
+ <argument index="3" name="radius" type="float">
+ </argument>
+ <description>
+ Checks if the segment ([code]from[/code], [code]to[/code]) intersects the cylinder with height [code]height[/code] that is centered at the origin and has radius [code]radius[/code]. If no, returns an empty [PackedVector3Array]. If an intersection takes place, the returned array contains the point of intersection and the cylinder's normal at the point of intersection.
+ </description>
+ </method>
+ <method name="segment_intersects_sphere">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <argument index="1" name="to" type="Vector3">
+ </argument>
+ <argument index="2" name="sphere_position" type="Vector3">
+ </argument>
+ <argument index="3" name="sphere_radius" type="float">
+ </argument>
+ <description>
+ Checks if the segment ([code]from[/code], [code]to[/code]) intersects the sphere that is located at [code]sphere_position[/code] and has radius [code]sphere_radius[/code]. If no, returns an empty [PackedVector3Array]. If yes, returns a [PackedVector3Array] containing the point of intersection and the sphere's normal at the point of intersection.
+ </description>
+ </method>
+ <method name="segment_intersects_triangle">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <argument index="1" name="to" type="Vector3">
+ </argument>
+ <argument index="2" name="a" type="Vector3">
+ </argument>
+ <argument index="3" name="b" type="Vector3">
+ </argument>
+ <argument index="4" name="c" type="Vector3">
+ </argument>
+ <description>
+ Tests if the segment ([code]from[/code], [code]to[/code]) intersects the triangle [code]a[/code], [code]b[/code], [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml
index 518a172973..cc85ce295b 100644
--- a/doc/classes/GeometryInstance3D.xml
+++ b/doc/classes/GeometryInstance3D.xml
@@ -9,15 +9,6 @@
<tutorials>
</tutorials>
<methods>
- <method name="get_flag" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="flag" type="int" enum="GeometryInstance3D.Flags">
- </argument>
- <description>
- Returns the [enum GeometryInstance3D.Flags] that have been set for this object.
- </description>
- </method>
<method name="get_shader_instance_uniform" qualifiers="const">
<return type="Variant">
</return>
@@ -35,17 +26,6 @@
Overrides the bounding box of this node with a custom one. To remove it, set an [AABB] with all fields set to zero.
</description>
</method>
- <method name="set_flag">
- <return type="void">
- </return>
- <argument index="0" name="flag" type="int" enum="GeometryInstance3D.Flags">
- </argument>
- <argument index="1" name="value" type="bool">
- </argument>
- <description>
- Sets the [enum GeometryInstance3D.Flags] specified. See [enum GeometryInstance3D.Flags] for options.
- </description>
- </method>
<method name="set_shader_instance_uniform">
<return type="void">
</return>
@@ -64,6 +44,10 @@
<member name="extra_cull_margin" type="float" setter="set_extra_cull_margin" getter="get_extra_cull_margin" default="0.0">
The extra distance added to the GeometryInstance3D's bounding box ([AABB]) to increase its cull box.
</member>
+ <member name="gi_lightmap_scale" type="int" setter="set_lightmap_scale" getter="get_lightmap_scale" enum="GeometryInstance3D.LightmapScale" default="0">
+ </member>
+ <member name="gi_mode" type="int" setter="set_gi_mode" getter="get_gi_mode" enum="GeometryInstance3D.GIMode" default="0">
+ </member>
<member name="lod_max_distance" type="float" setter="set_lod_max_distance" getter="get_lod_max_distance" default="0.0">
The GeometryInstance3D's max LOD distance.
[b]Note:[/b] This property currently has no effect.
@@ -84,11 +68,6 @@
The material override for the whole geometry.
If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh.
</member>
- <member name="use_dynamic_gi" type="bool" setter="set_flag" getter="get_flag" default="false">
- </member>
- <member name="use_in_baked_light" type="bool" setter="set_flag" getter="get_flag" default="false">
- If [code]true[/code], this GeometryInstance3D will be used when baking lights using a [GIProbe].
- </member>
</members>
<constants>
<constant name="SHADOW_CASTING_SETTING_OFF" value="0" enum="ShadowCastingSetting">
@@ -106,16 +85,21 @@
Will only show the shadows casted from this object.
In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be.
</constant>
- <constant name="FLAG_USE_BAKED_LIGHT" value="0" enum="Flags">
- Will allow the GeometryInstance3D to be used when baking lights using a [GIProbe].
+ <constant name="GI_MODE_DISABLED" value="0" enum="GIMode">
+ </constant>
+ <constant name="GI_MODE_BAKED" value="1" enum="GIMode">
+ </constant>
+ <constant name="GI_MODE_DYNAMIC" value="2" enum="GIMode">
+ </constant>
+ <constant name="LIGHTMAP_SCALE_1X" value="0" enum="LightmapScale">
+ </constant>
+ <constant name="LIGHTMAP_SCALE_2X" value="1" enum="LightmapScale">
</constant>
- <constant name="FLAG_USE_DYNAMIC_GI" value="1" enum="Flags">
+ <constant name="LIGHTMAP_SCALE_4X" value="2" enum="LightmapScale">
</constant>
- <constant name="FLAG_DRAW_NEXT_FRAME_IF_VISIBLE" value="2" enum="Flags">
- Unused in this class, exposed for consistency with [enum RenderingServer.InstanceFlags].
+ <constant name="LIGHTMAP_SCALE_8X" value="3" enum="LightmapScale">
</constant>
- <constant name="FLAG_MAX" value="3" enum="Flags">
- Represents the size of the [enum Flags] enum.
+ <constant name="LIGHTMAP_SCALE_MAX" value="4" enum="LightmapScale">
</constant>
</constants>
</class>
diff --git a/doc/classes/Gradient.xml b/doc/classes/Gradient.xml
index 05aebef9de..4ccbdee144 100644
--- a/doc/classes/Gradient.xml
+++ b/doc/classes/Gradient.xml
@@ -4,7 +4,7 @@
A color interpolator resource which can be used to generate colors between user-defined color points.
</brief_description>
<description>
- Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the ramp will interpolate from color 1 to color 2 and from color 2 to color 3. The ramp will initially have 2 colors (black and white), one (black) at ramp lower offset 0 and the other (white) at the ramp higher offset 1.
+ Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the gradient will interpolate from color 1 to color 2 and from color 2 to color 3. The gradient will initially have 2 colors (black and white), one (black) at gradient lower offset 0 and the other (white) at the gradient higher offset 1.
</description>
<tutorials>
</tutorials>
@@ -17,32 +17,32 @@
<argument index="1" name="color" type="Color">
</argument>
<description>
- Adds the specified color to the end of the ramp, with the specified offset.
+ Adds the specified color to the end of the gradient, with the specified offset.
</description>
</method>
- <method name="get_color" qualifiers="const">
+ <method name="get_color">
<return type="Color">
</return>
<argument index="0" name="point" type="int">
</argument>
<description>
- Returns the color of the ramp color at index [code]point[/code].
+ Returns the color of the gradient color at index [code]point[/code].
</description>
</method>
- <method name="get_offset" qualifiers="const">
+ <method name="get_offset">
<return type="float">
</return>
<argument index="0" name="point" type="int">
</argument>
<description>
- Returns the offset of the ramp color at index [code]point[/code].
+ Returns the offset of the gradient color at index [code]point[/code].
</description>
</method>
<method name="get_point_count" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the number of colors in the ramp.
+ Returns the number of colors in the gradient.
</description>
</method>
<method name="interpolate">
@@ -71,7 +71,7 @@
<argument index="1" name="color" type="Color">
</argument>
<description>
- Sets the color of the ramp color at index [code]point[/code].
+ Sets the color of the gradient color at index [code]point[/code].
</description>
</method>
<method name="set_offset">
@@ -82,7 +82,7 @@
<argument index="1" name="offset" type="float">
</argument>
<description>
- Sets the offset for the ramp color at index [code]point[/code].
+ Sets the offset for the gradient color at index [code]point[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml
index 750ac8085c..77bd2c60cc 100644
--- a/doc/classes/GraphEdit.xml
+++ b/doc/classes/GraphEdit.xml
@@ -193,16 +193,11 @@
</member>
</members>
<signals>
- <signal name="_begin_node_move">
+ <signal name="begin_node_move">
<description>
Emitted at the beginning of a GraphNode movement.
</description>
</signal>
- <signal name="_end_node_move">
- <description>
- Emitted at the end of a GraphNode movement.
- </description>
- </signal>
<signal name="connection_from_empty">
<argument index="0" name="to" type="StringName">
</argument>
@@ -240,7 +235,7 @@
</signal>
<signal name="copy_nodes_request">
<description>
- Emitted when the user presses [code]Ctrl + C[/code].
+ Emitted when the user presses [kbd]Ctrl + C[/kbd].
</description>
</signal>
<signal name="delete_nodes_request">
@@ -266,6 +261,11 @@
Emitted when a GraphNode is attempted to be duplicated in the GraphEdit.
</description>
</signal>
+ <signal name="end_node_move">
+ <description>
+ Emitted at the end of a GraphNode movement.
+ </description>
+ </signal>
<signal name="node_selected">
<argument index="0" name="node" type="Node">
</argument>
@@ -281,7 +281,7 @@
</signal>
<signal name="paste_nodes_request">
<description>
- Emitted when the user presses [code]Ctrl + V[/code].
+ Emitted when the user presses [kbd]Ctrl + V[/kbd].
</description>
</signal>
<signal name="popup_request">
diff --git a/doc/classes/GridContainer.xml b/doc/classes/GridContainer.xml
index e13dc43104..ca6b4e69c3 100644
--- a/doc/classes/GridContainer.xml
+++ b/doc/classes/GridContainer.xml
@@ -1,19 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GridContainer" inherits="Container" version="4.0">
<brief_description>
- Grid container used to arrange elements in a grid like layout.
+ Grid container used to arrange Control-derived children in a grid like layout.
</brief_description>
<description>
- Grid container will arrange its children in a grid like structure, the grid columns are specified using the [member columns] property and the number of rows will be equal to the number of children in the container divided by the number of columns. For example, if the container has 5 children, and 2 columns, there will be 3 rows in the container.
+ GridContainer will arrange its Control-derived children in a grid like structure, the grid columns are specified using the [member columns] property and the number of rows will be equal to the number of children in the container divided by the number of columns. For example, if the container has 5 children, and 2 columns, there will be 3 rows in the container.
Notice that grid layout will preserve the columns and rows for every size of the container, and that empty columns will be expanded automatically.
+ [b]Note:[/b] GridContainer only works with child nodes inheriting from Control. It won't rearrange child nodes inheriting from Node2D.
</description>
<tutorials>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
</methods>
<members>
<member name="columns" type="int" setter="set_columns" getter="get_columns" default="1">
- The number of columns in the [GridContainer]. If modified, [GridContainer] reorders its children to accommodate the new layout.
+ The number of columns in the [GridContainer]. If modified, [GridContainer] reorders its Control-derived children to accommodate the new layout.
</member>
</members>
<constants>
diff --git a/doc/classes/HSlider.xml b/doc/classes/HSlider.xml
index afe9d10d2e..0cbb4fd455 100644
--- a/doc/classes/HSlider.xml
+++ b/doc/classes/HSlider.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Horizontal slider. See [Slider]. This one goes from left (min) to right (max).
+ [b]Note:[/b] The [signal Range.changed] and [signal Range.value_changed] signals are part of the [Range] class which this class inherits from.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index 76153ae041..ec8ca7456a 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -1,17 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="HTTPClient" inherits="Reference" version="4.0">
<brief_description>
- Hyper-text transfer protocol client.
+ Low-level hyper-text transfer protocol client.
</brief_description>
<description>
- Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases. See [HTTPRequest] for an higher-level alternative.
+ Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases. [b]See the [HTTPRequest] node for an higher-level alternative.[/b]
[b]Note:[/b] This client only needs to connect to a host once (see [method connect_to_host]) to send multiple requests. Because of this, methods that take URLs usually take just the part after the host instead of the full URL, as the client is already connected to a host. See [method request] for a full example and to get started.
A [HTTPClient] should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side.
For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616).
+ [b]Note:[/b] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header.
+ [b]Note:[/b] SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/networking/http_client_class.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link>
+ <link title="HTTP client class">https://docs.godotengine.org/en/latest/tutorials/networking/http_client_class.html</link>
+ <link title="SSL certificates">https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link>
</tutorials>
<methods>
<method name="close">
@@ -151,6 +153,7 @@
var headers = ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(query_string.length())]
var result = http_client.request(http_client.METHOD_POST, "index.php", headers, query_string)
[/codeblock]
+ [b]Note:[/b] The [code]request_data[/code] parameter is ignored if [code]method[/code] is [constant HTTPClient.METHOD_GET]. This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See [method String.http_escape] for an example.
</description>
</method>
<method name="request_raw">
@@ -178,7 +181,7 @@
<member name="connection" type="StreamPeer" setter="set_connection" getter="get_connection">
The connection to use for this client.
</member>
- <member name="read_chunk_size" type="int" setter="set_read_chunk_size" getter="get_read_chunk_size" default="4096">
+ <member name="read_chunk_size" type="int" setter="set_read_chunk_size" getter="get_read_chunk_size" default="65536">
The size of the buffer used and maximum bytes to read per iteration. See [method read_response_body_chunk].
</member>
</members>
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml
index 53ca1fc6a9..6eae881ffe 100644
--- a/doc/classes/HTTPRequest.xml
+++ b/doc/classes/HTTPRequest.xml
@@ -14,11 +14,19 @@
add_child(http_request)
http_request.connect("request_completed", self, "_http_request_completed")
- # Perform the HTTP request. The URL below returns some JSON as of writing.
+ # Perform a GET request. The URL below returns JSON as of writing.
var error = http_request.request("https://httpbin.org/get")
if error != OK:
push_error("An error occurred in the HTTP request.")
+ # Perform a POST request. The URL below returns JSON as of writing.
+ # Note: Don't make simultaneous requests using a single HTTPRequest node.
+ # The snippet below is provided for reference only.
+ var body = {"name": "Godette"}
+ error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body)
+ if error != OK:
+ push_error("An error occurred in the HTTP request.")
+
# Called when the HTTP request is completed.
func _http_request_completed(result, response_code, headers, body):
@@ -56,10 +64,14 @@
add_child(texture_rect)
texture_rect.texture = texture
[/codeblock]
+
+ [b]Gzipped response bodies[/b]: HTTPRequest will automatically handle decompression of response bodies. A [code]Accept-Encoding[/code] header will be automatically added to each of your requests, unless one is already specified. Any response with a [code]Content-Encoding: gzip[/code] header will automatically be decompressed and delivered to you as uncompressed bytes.
+ [b]Note:[/b] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header.
+ [b]Note:[/b] SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/networking/http_request_class.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link>
+ <link title="Making HTTP requests">https://docs.godotengine.org/en/latest/tutorials/networking/http_request_class.html</link>
+ <link title="SSL certificates">https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link>
</tutorials>
<methods>
<method name="cancel_request">
@@ -107,16 +119,41 @@
<description>
Creates request on the underlying [HTTPClient]. If there is no configuration errors, it tries to connect using [method HTTPClient.connect_to_host] and passes parameters onto [method HTTPClient.request].
Returns [constant OK] if request is successfully created. (Does not imply that the server has responded), [constant ERR_UNCONFIGURED] if not in the tree, [constant ERR_BUSY] if still processing previous request, [constant ERR_INVALID_PARAMETER] if given string is not a valid URL format, or [constant ERR_CANT_CONNECT] if not using thread and the [HTTPClient] cannot connect to host.
+ [b]Note:[/b] The [code]request_data[/code] parameter is ignored if [code]method[/code] is [constant HTTPClient.METHOD_GET]. This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See [method String.http_escape] for an example.
+ </description>
+ </method>
+ <method name="request_raw">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="url" type="String">
+ </argument>
+ <argument index="1" name="custom_headers" type="PackedStringArray" default="PackedStringArray( )">
+ </argument>
+ <argument index="2" name="ssl_validate_domain" type="bool" default="true">
+ </argument>
+ <argument index="3" name="method" type="int" enum="HTTPClient.Method" default="0">
+ </argument>
+ <argument index="4" name="request_data_raw" type="PackedByteArray" default="PackedByteArray( )">
+ </argument>
+ <description>
+ Creates request on the underlying [HTTPClient] using a raw array of bytes for the request body. If there is no configuration errors, it tries to connect using [method HTTPClient.connect_to_host] and passes parameters onto [method HTTPClient.request].
+ Returns [constant OK] if request is successfully created. (Does not imply that the server has responded), [constant ERR_UNCONFIGURED] if not in the tree, [constant ERR_BUSY] if still processing previous request, [constant ERR_INVALID_PARAMETER] if given string is not a valid URL format, or [constant ERR_CANT_CONNECT] if not using thread and the [HTTPClient] cannot connect to host.
</description>
</method>
</methods>
<members>
+ <member name="accept_gzip" type="bool" setter="set_accept_gzip" getter="is_accepting_gzip" default="true">
+ If [code]true[/code], this header will be added to each request: [code]Accept-Encoding: gzip, deflate[/code] telling servers that it's okay to compress response bodies.
+ Any Response body declaring a [code]Content-Encoding[/code] of either [code]gzip[/code] or [code]deflate[/code] will then be automatically decompressed, and the uncompressed bytes will be delivered via [code]request_completed[/code].
+ If the user has specified their own [code]Accept-Encoding[/code] header, then no header will be added regaurdless of [code]accept_gzip[/code].
+ If [code]false[/code] no header will be added, and no decompression will be performed on response bodies. The raw bytes of the response body will be returned via [code]request_completed[/code].
+ </member>
<member name="body_size_limit" type="int" setter="set_body_size_limit" getter="get_body_size_limit" default="-1">
- Maximum allowed size for response bodies.
+ Maximum allowed size for response bodies. If the response body is compressed, this will be used as the maximum allowed size for the decompressed body.
</member>
- <member name="download_chunk_size" type="int" setter="set_download_chunk_size" getter="get_download_chunk_size" default="4096">
+ <member name="download_chunk_size" type="int" setter="set_download_chunk_size" getter="get_download_chunk_size" default="65536">
The size of the buffer used and maximum bytes to read per iteration. See [member HTTPClient.read_chunk_size].
- Set this to a higher value (e.g. 65536 for 64 KiB) when downloading large files to achieve better speeds at the cost of memory.
+ Set this to a lower value (e.g. 4096 for 4 KiB) when downloading small files to decrease memory usage at the cost of download speeds.
</member>
<member name="download_file" type="String" setter="set_download_file" getter="get_download_file" default="&quot;&quot;">
The file to download into. Will output any received file into it.
@@ -169,19 +206,21 @@
<constant name="RESULT_BODY_SIZE_LIMIT_EXCEEDED" value="7" enum="Result">
Request exceeded its maximum size limit, see [member body_size_limit].
</constant>
- <constant name="RESULT_REQUEST_FAILED" value="8" enum="Result">
+ <constant name="RESULT_BODY_DECOMPRESS_FAILED" value="8" enum="Result">
+ </constant>
+ <constant name="RESULT_REQUEST_FAILED" value="9" enum="Result">
Request failed (currently unused).
</constant>
- <constant name="RESULT_DOWNLOAD_FILE_CANT_OPEN" value="9" enum="Result">
+ <constant name="RESULT_DOWNLOAD_FILE_CANT_OPEN" value="10" enum="Result">
HTTPRequest couldn't open the download file.
</constant>
- <constant name="RESULT_DOWNLOAD_FILE_WRITE_ERROR" value="10" enum="Result">
+ <constant name="RESULT_DOWNLOAD_FILE_WRITE_ERROR" value="11" enum="Result">
HTTPRequest couldn't write to the download file.
</constant>
- <constant name="RESULT_REDIRECT_LIMIT_REACHED" value="11" enum="Result">
+ <constant name="RESULT_REDIRECT_LIMIT_REACHED" value="12" enum="Result">
Request reached its maximum redirect limit, see [member max_redirects].
</constant>
- <constant name="RESULT_TIMEOUT" value="12" enum="Result">
+ <constant name="RESULT_TIMEOUT" value="13" enum="Result">
</constant>
</constants>
</class>
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index 8cffe07fc0..3b108468de 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -154,7 +154,7 @@
<argument index="4" name="data" type="PackedByteArray">
</argument>
<description>
- Creates a new image of given size and format. See [enum Format] constants. Fills the image with the given raw data. If [code]use_mipmaps[/code] is [code]true[/code] then generate mipmaps for this image. See the [method generate_mipmaps].
+ Creates a new image of given size and format. See [enum Format] constants. Fills the image with the given raw data. If [code]use_mipmaps[/code] is [code]true[/code] then loads mipmaps for this image from [code]data[/code]. See [method generate_mipmaps].
</description>
</method>
<method name="crop">
@@ -190,13 +190,6 @@
<description>
</description>
</method>
- <method name="expand_x2_hq2x">
- <return type="void">
- </return>
- <description>
- Stretches the image and enlarges it by a factor of 2. No interpolation is done.
- </description>
- </method>
<method name="fill">
<return type="void">
</return>
@@ -240,7 +233,7 @@
<return type="PackedByteArray">
</return>
<description>
- Returns the image's raw data.
+ Returns a copy of the image's raw data.
</description>
</method>
<method name="get_format" qualifiers="const">
@@ -350,7 +343,17 @@
<argument index="0" name="path" type="String">
</argument>
<description>
- Loads an image from file [code]path[/code].
+ Loads an image from file [code]path[/code]. See [url=https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_images.html#supported-image-formats]Supported image formats[/url] for a list of supported image formats and limitations.
+ </description>
+ </method>
+ <method name="load_bmp_from_buffer">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="buffer" type="PackedByteArray">
+ </argument>
+ <description>
+ Loads an image from the binary contents of a BMP file.
+ [b]Note:[/b] Godot's BMP module doesn't support 16-bit per pixel images. Only 1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported.
</description>
</method>
<method name="load_jpg_from_buffer">
@@ -371,6 +374,15 @@
Loads an image from the binary contents of a PNG file.
</description>
</method>
+ <method name="load_tga_from_buffer">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="buffer" type="PackedByteArray">
+ </argument>
+ <description>
+ Loads an image from the binary contents of a TGA file.
+ </description>
+ </method>
<method name="load_webp_from_buffer">
<return type="int" enum="Error">
</return>
@@ -443,6 +455,12 @@
Saves the image as a PNG file to [code]path[/code].
</description>
</method>
+ <method name="save_png_to_buffer" qualifiers="const">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="set_pixel">
<return type="void">
</return>
diff --git a/doc/classes/ImageTexture3D.xml b/doc/classes/ImageTexture3D.xml
new file mode 100644
index 0000000000..d05082487d
--- /dev/null
+++ b/doc/classes/ImageTexture3D.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="ImageTexture3D" inherits="Texture3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="create">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="format" type="int" enum="Image.Format">
+ </argument>
+ <argument index="1" name="width" type="int">
+ </argument>
+ <argument index="2" name="height" type="int">
+ </argument>
+ <argument index="3" name="depth" type="int">
+ </argument>
+ <argument index="4" name="use_mipmaps" type="bool">
+ </argument>
+ <argument index="5" name="data" type="Image[]">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="update">
+ <return type="void">
+ </return>
+ <argument index="0" name="data" type="Image[]">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/ImageTextureLayered.xml b/doc/classes/ImageTextureLayered.xml
new file mode 100644
index 0000000000..d06b44afa9
--- /dev/null
+++ b/doc/classes/ImageTextureLayered.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="ImageTextureLayered" inherits="TextureLayered" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="create_from_images">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="images" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="update_layer">
+ <return type="void">
+ </return>
+ <argument index="0" name="image" type="Image">
+ </argument>
+ <argument index="1" name="layer" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/InputFilter.xml b/doc/classes/Input.xml
index 54184ae8a3..eafae7310c 100644
--- a/doc/classes/InputFilter.xml
+++ b/doc/classes/Input.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="InputFilter" inherits="Object" version="4.0">
+<class name="Input" inherits="Object" version="4.0">
<brief_description>
A singleton that deals with inputs.
</brief_description>
@@ -7,7 +7,9 @@
A singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions. Actions and their events can be set in the [b]Input Map[/b] tab in the [b]Project &gt; Project Settings[/b], or with the [InputMap] class.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/index.html</link>
+ <link title="Inputs tutorial index">https://docs.godotengine.org/en/latest/tutorials/inputs/index.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="action_press">
@@ -47,8 +49,18 @@
<return type="Vector3">
</return>
<description>
- If the device has an accelerometer, this will return the acceleration. Otherwise, it returns an empty [Vector3].
+ Returns the acceleration of the device's accelerometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
Note this method returns an empty [Vector3] when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer.
+ [b]Note:[/b] This method only works on iOS, Android, and UWP. On other platforms, it always returns [constant Vector3.ZERO].
+ </description>
+ </method>
+ <method name="get_action_raw_strength" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="action" type="StringName">
+ </argument>
+ <description>
+ Returns a value between 0 and 1 representing the raw intensity of the given action, ignoring the action's deadzone. In most cases, you should use [method get_action_strength] instead.
</description>
</method>
<method name="get_action_strength" qualifiers="const">
@@ -60,6 +72,18 @@
Returns a value between 0 and 1 representing the intensity of the given action. In a joypad, for example, the further away the axis (analog sticks or L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If the action is mapped to a control that has no axis as the keyboard, the value returned will be 0 or 1.
</description>
</method>
+ <method name="get_axis" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="negative_action" type="StringName">
+ </argument>
+ <argument index="1" name="positive_action" type="StringName">
+ </argument>
+ <description>
+ Get axis input by specifying two actions, one negative and one positive.
+ This is a horthand for writing [code]Input.get_action_strength("positive_action") - Input.get_action_strength("negative_action")[/code].
+ </description>
+ </method>
<method name="get_connected_joypads">
<return type="Array">
</return>
@@ -68,7 +92,7 @@
</description>
</method>
<method name="get_current_cursor_shape" qualifiers="const">
- <return type="int" enum="InputFilter.CursorShape">
+ <return type="int" enum="Input.CursorShape">
</return>
<description>
Returns the currently assigned cursor shape (see [enum CursorShape]).
@@ -78,14 +102,16 @@
<return type="Vector3">
</return>
<description>
- If the device has an accelerometer, this will return the gravity. Otherwise, it returns an empty [Vector3].
+ Returns the gravity of the device's accelerometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
+ [b]Note:[/b] This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_gyroscope" qualifiers="const">
<return type="Vector3">
</return>
<description>
- If the device has a gyroscope, this will return the rate of rotation in rad/s around a device's X, Y, and Z axes. Otherwise, it returns an empty [Vector3].
+ Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
+ [b]Note:[/b] This method only works on Android. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_joy_axis" qualifiers="const">
@@ -96,7 +122,7 @@
<argument index="1" name="axis" type="int">
</argument>
<description>
- Returns the current value of the joypad axis at given index (see [enum JoystickList]).
+ Returns the current value of the joypad axis at given index (see [enum JoyAxisList]).
</description>
</method>
<method name="get_joy_axis_index_from_string">
@@ -114,7 +140,7 @@
<argument index="0" name="axis_index" type="int">
</argument>
<description>
- Receives a [enum JoystickList] axis and returns its equivalent name as a string.
+ Receives a [enum JoyAxisList] axis and returns its equivalent name as a string.
</description>
</method>
<method name="get_joy_button_index_from_string">
@@ -132,7 +158,7 @@
<argument index="0" name="button_index" type="int">
</argument>
<description>
- Receives a gamepad button from [enum JoystickList] and returns its equivalent name as a string.
+ Receives a gamepad button from [enum JoyButtonList] and returns its equivalent name as a string.
</description>
</method>
<method name="get_joy_guid" qualifiers="const">
@@ -182,7 +208,8 @@
<return type="Vector3">
</return>
<description>
- If the device has a magnetometer, this will return the magnetic field strength in micro-Tesla for all axes.
+ Returns the the magnetic field strength in micro-Tesla for all axes of the device's magnetometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
+ [b]Note:[/b] This method only works on Android and UWP. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_mouse_button_mask" qualifiers="const">
@@ -193,12 +220,31 @@
</description>
</method>
<method name="get_mouse_mode" qualifiers="const">
- <return type="int" enum="InputFilter.MouseMode">
+ <return type="int" enum="Input.MouseMode">
</return>
<description>
Returns the mouse mode. See the constants for more information.
</description>
</method>
+ <method name="get_vector" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="negative_x" type="StringName">
+ </argument>
+ <argument index="1" name="positive_x" type="StringName">
+ </argument>
+ <argument index="2" name="negative_y" type="StringName">
+ </argument>
+ <argument index="3" name="positive_y" type="StringName">
+ </argument>
+ <argument index="4" name="deadzone" type="float" default="-1.0">
+ </argument>
+ <description>
+ Get vector input by specifying four actions, two for the X axis and two for the Y axis, negative and positive.
+ This method is useful when getting vector input, such as from a joystick, directional pad, arrows, or WASD. The vector has its length limited to 1 and has a circular deadzone, which is useful for using vector input as movement.
+ By default, the deadzone is automatically calculated from the average of the action deadzones. However, you can override the deadzone to be whatever you want (on the range of 0 to 1).
+ </description>
+ </method>
<method name="is_action_just_pressed" qualifiers="const">
<return type="bool">
</return>
@@ -235,7 +281,7 @@
<argument index="1" name="button" type="int">
</argument>
<description>
- Returns [code]true[/code] if you are pressing the joypad button (see [enum JoystickList]).
+ Returns [code]true[/code] if you are pressing the joypad button (see [enum JoyButtonList]).
</description>
</method>
<method name="is_joy_known">
@@ -244,7 +290,7 @@
<argument index="0" name="device" type="int">
</argument>
<description>
- Returns [code]true[/code] if the system knows the specified device. This means that it sets all button and axis indices exactly as defined in [enum JoystickList]. Unknown joypads are not expected to match these constants, but you can still retrieve events from them.
+ Returns [code]true[/code] if the system knows the specified device. This means that it sets all button and axis indices. Unknown joypads are not expected to match these constants, but you can still retrieve events from them.
</description>
</method>
<method name="is_key_pressed" qualifiers="const">
@@ -277,7 +323,7 @@
<argument index="3" name="guid" type="String">
</argument>
<description>
- Notifies the [InputFilter] singleton that a connection has changed, to update the state for the [code]device[/code] index.
+ Notifies the [Input] singleton that a connection has changed, to update the state for the [code]device[/code] index.
This is used internally and should not have to be called from user scripts. See [signal joy_connection_changed] for the signal emitted when this is triggered internally.
</description>
</method>
@@ -293,7 +339,7 @@
var a = InputEventAction.new()
a.action = "ui_cancel"
a.pressed = true
- InputFilter.parse_input_event(a)
+ Input.parse_input_event(a)
[/codeblock]
</description>
</method>
@@ -311,7 +357,7 @@
</return>
<argument index="0" name="image" type="Resource">
</argument>
- <argument index="1" name="shape" type="int" enum="InputFilter.CursorShape" default="0">
+ <argument index="1" name="shape" type="int" enum="Input.CursorShape" default="0">
</argument>
<argument index="2" name="hotspot" type="Vector2" default="Vector2( 0, 0 )">
</argument>
@@ -326,7 +372,7 @@
<method name="set_default_cursor_shape">
<return type="void">
</return>
- <argument index="0" name="shape" type="int" enum="InputFilter.CursorShape" default="0">
+ <argument index="0" name="shape" type="int" enum="Input.CursorShape" default="0">
</argument>
<description>
Sets the default cursor shape to be used in the viewport instead of [constant CURSOR_ARROW].
@@ -337,7 +383,7 @@
<method name="set_mouse_mode">
<return type="void">
</return>
- <argument index="0" name="mode" type="int" enum="InputFilter.MouseMode">
+ <argument index="0" name="mode" type="int" enum="Input.MouseMode">
</argument>
<description>
Sets the mouse mode. See the constants for more information.
@@ -417,7 +463,8 @@
Makes the mouse cursor hidden if it is visible.
</constant>
<constant name="MOUSE_MODE_CAPTURED" value="2" enum="MouseMode">
- Captures the mouse. The mouse will be hidden and unable to leave the game window, but it will still register movement and mouse button presses. On Windows and Linux, the mouse will use raw input mode, which means the reported movement will be unaffected by the OS' mouse acceleration settings.
+ Captures the mouse. The mouse will be hidden and its position locked at the center of the screen.
+ [b]Note:[/b] If you want to process the mouse's movement in this mode, you need to use [member InputEventMouseMotion.relative].
</constant>
<constant name="MOUSE_MODE_CONFINED" value="3" enum="MouseMode">
Makes the mouse cursor visible but confines it to the game window.
diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml
index 413e217b45..8c6063bd67 100644
--- a/doc/classes/InputEvent.xml
+++ b/doc/classes/InputEvent.xml
@@ -7,8 +7,10 @@
Base class of all sort of input event. See [method Node._input].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
+ <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
+ <link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="accumulate">
diff --git a/doc/classes/InputEventAction.xml b/doc/classes/InputEventAction.xml
index 1c38ff8e8f..1fe85a5ae8 100644
--- a/doc/classes/InputEventAction.xml
+++ b/doc/classes/InputEventAction.xml
@@ -7,7 +7,9 @@
Contains a generic action which can be targeted from several types of inputs. Actions can be created from the [b]Input Map[/b] tab in the [b]Project &gt; Project Settings[/b] menu. See [method Node._input].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#actions</link>
+ <link title="InputEvent: Actions">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#actions</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/InputEventJoypadButton.xml b/doc/classes/InputEventJoypadButton.xml
index 19aa97e1ec..6ab4942f85 100644
--- a/doc/classes/InputEventJoypadButton.xml
+++ b/doc/classes/InputEventJoypadButton.xml
@@ -7,13 +7,13 @@
Input event type for gamepad buttons. For gamepad analog sticks and joysticks, see [InputEventJoypadMotion].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
+ <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
</tutorials>
<methods>
</methods>
<members>
<member name="button_index" type="int" setter="set_button_index" getter="get_button_index" default="0">
- Button identifier. One of the [enum JoystickList] button constants.
+ Button identifier. One of the [enum JoyButtonList] button constants.
</member>
<member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false">
If [code]true[/code], the button's state is pressed. If [code]false[/code], the button's state is released.
diff --git a/doc/classes/InputEventJoypadMotion.xml b/doc/classes/InputEventJoypadMotion.xml
index 01e02b79b1..2d7787b568 100644
--- a/doc/classes/InputEventJoypadMotion.xml
+++ b/doc/classes/InputEventJoypadMotion.xml
@@ -7,13 +7,13 @@
Stores information about joystick motions. One [InputEventJoypadMotion] represents one axis at a time.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
+ <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
</tutorials>
<methods>
</methods>
<members>
<member name="axis" type="int" setter="set_axis" getter="get_axis" default="0">
- Axis identifier. Use one of the [enum JoystickList] axis constants.
+ Axis identifier. Use one of the [enum JoyAxisList] axis constants.
</member>
<member name="axis_value" type="float" setter="set_axis_value" getter="get_axis_value" default="0.0">
Current position of the joystick on the given axis. The value ranges from [code]-1.0[/code] to [code]1.0[/code]. A value of [code]0[/code] means the axis is in its resting position.
diff --git a/doc/classes/InputEventKey.xml b/doc/classes/InputEventKey.xml
index 34afa90553..fe91b9c13e 100644
--- a/doc/classes/InputEventKey.xml
+++ b/doc/classes/InputEventKey.xml
@@ -7,14 +7,14 @@
Stores key presses on the keyboard. Supports key presses, key releases and [member echo] events.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
+ <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
</tutorials>
<methods>
<method name="get_keycode_with_modifiers" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the keycode combined with modifier keys such as [code]Shift[/code] or [code]Alt[/code]. See also [InputEventWithModifiers].
+ Returns the keycode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers].
To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_keycode_string(event.get_keycode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].
</description>
</method>
@@ -22,7 +22,7 @@
<return type="int">
</return>
<description>
- Returns the physical keycode combined with modifier keys such as [code]Shift[/code] or [code]Alt[/code]. See also [InputEventWithModifiers].
+ Returns the physical keycode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers].
To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_keycode_string(event.get_physical_keycode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].
</description>
</method>
diff --git a/doc/classes/InputEventMouse.xml b/doc/classes/InputEventMouse.xml
index e3c9d688d2..31e82bbaed 100644
--- a/doc/classes/InputEventMouse.xml
+++ b/doc/classes/InputEventMouse.xml
@@ -7,7 +7,7 @@
Stores general mouse events information.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
+ <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/InputEventMouseButton.xml b/doc/classes/InputEventMouseButton.xml
index b83588a877..d7b64a9a2d 100644
--- a/doc/classes/InputEventMouseButton.xml
+++ b/doc/classes/InputEventMouseButton.xml
@@ -7,7 +7,7 @@
Contains mouse click information. See [method Node._input].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link>
+ <link title="Mouse and input coordinates">https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml
index 97b9d5247a..0f9e71adb4 100644
--- a/doc/classes/InputEventMouseMotion.xml
+++ b/doc/classes/InputEventMouseMotion.xml
@@ -5,9 +5,11 @@
</brief_description>
<description>
Contains mouse and pen motion information. Supports relative, absolute positions and speed. See [method Node._input].
+ [b]Note:[/b] By default, this event is only emitted once per frame rendered at most. If you need more precise input reporting, call [method Input.set_use_accumulated_input] with [code]false[/code] to make events emitted as often as possible. If you use InputEventMouseMotion to draw lines, consider implementing [url=https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to avoid visible gaps in lines if the user is moving the mouse quickly.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link>
+ <link title="Mouse and input coordinates">https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
@@ -16,7 +18,7 @@
Represents the pressure the user puts on the pen. Ranges from [code]0.0[/code] to [code]1.0[/code].
</member>
<member name="relative" type="Vector2" setter="set_relative" getter="get_relative" default="Vector2( 0, 0 )">
- The mouse position relative to the previous position (position at the last frame).
+ The mouse position relative to the previous position (position at the last frame).
[b]Note:[/b] Since [InputEventMouseMotion] is only emitted when the mouse moves, the last event won't have a relative position of [code]Vector2(0, 0)[/code] when the user stops moving the mouse.
</member>
<member name="speed" type="Vector2" setter="set_speed" getter="get_speed" default="Vector2( 0, 0 )">
diff --git a/doc/classes/InputEventScreenDrag.xml b/doc/classes/InputEventScreenDrag.xml
index a315e4ddfb..d69f175be8 100644
--- a/doc/classes/InputEventScreenDrag.xml
+++ b/doc/classes/InputEventScreenDrag.xml
@@ -7,7 +7,7 @@
Contains screen drag information. See [method Node._input].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
+ <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/InputEventScreenTouch.xml b/doc/classes/InputEventScreenTouch.xml
index 16a3cf8353..f497f2fecc 100644
--- a/doc/classes/InputEventScreenTouch.xml
+++ b/doc/classes/InputEventScreenTouch.xml
@@ -8,7 +8,7 @@
Stores multi-touch press/release information. Supports touch press, touch release and [member index] for multi-touch count and order.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
+ <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/InputEventWithModifiers.xml b/doc/classes/InputEventWithModifiers.xml
index 34faf18e24..667879a922 100644
--- a/doc/classes/InputEventWithModifiers.xml
+++ b/doc/classes/InputEventWithModifiers.xml
@@ -4,28 +4,28 @@
Base class for keys events with modifiers.
</brief_description>
<description>
- Contains keys events information with modifiers support like [code]Shift[/code] or [code]Alt[/code]. See [method Node._input].
+ Contains keys events information with modifiers support like [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See [method Node._input].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
+ <link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
</tutorials>
<methods>
</methods>
<members>
<member name="alt" type="bool" setter="set_alt" getter="get_alt" default="false">
- State of the [code]Alt[/code] modifier.
+ State of the [kbd]Alt[/kbd] modifier.
</member>
<member name="command" type="bool" setter="set_command" getter="get_command" default="false">
- State of the [code]Command[/code] modifier.
+ State of the [kbd]Cmd[/kbd] modifier.
</member>
<member name="control" type="bool" setter="set_control" getter="get_control" default="false">
- State of the [code]Ctrl[/code] modifier.
+ State of the [kbd]Ctrl[/kbd] modifier.
</member>
<member name="meta" type="bool" setter="set_metakey" getter="get_metakey" default="false">
- State of the [code]Meta[/code] modifier.
+ State of the [kbd]Meta[/kbd] modifier.
</member>
<member name="shift" type="bool" setter="set_shift" getter="get_shift" default="false">
- State of the [code]Shift[/code] modifier.
+ State of the [kbd]Shift[/kbd] modifier.
</member>
</members>
<constants>
diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml
index da93d7fb53..062ac3869d 100644
--- a/doc/classes/InputMap.xml
+++ b/doc/classes/InputMap.xml
@@ -7,7 +7,7 @@
Manages all [InputEventAction] which can be created/modified from the project settings menu [b]Project &gt; Project Settings &gt; Input Map[/b] or in code with [method add_action] and [method action_add_event]. See [method Node._input].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#inputmap</link>
+ <link title="InputEvent: InputMap">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#inputmap</link>
</tutorials>
<methods>
<method name="action_add_event">
@@ -41,6 +41,15 @@
Removes all events from an action.
</description>
</method>
+ <method name="action_get_events">
+ <return type="Array">
+ </return>
+ <argument index="0" name="action" type="StringName">
+ </argument>
+ <description>
+ Returns an array of [InputEvent]s associated with a given action.
+ </description>
+ </method>
<method name="action_has_event">
<return type="bool">
</return>
@@ -95,15 +104,6 @@
Returns [code]true[/code] if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior.
</description>
</method>
- <method name="get_action_list">
- <return type="Array">
- </return>
- <argument index="0" name="action" type="StringName">
- </argument>
- <description>
- Returns an array of [InputEvent]s associated with a given action.
- </description>
- </method>
<method name="get_actions">
<return type="Array">
</return>
diff --git a/doc/classes/InstancePlaceholder.xml b/doc/classes/InstancePlaceholder.xml
index 39827f6604..defd23afb1 100644
--- a/doc/classes/InstancePlaceholder.xml
+++ b/doc/classes/InstancePlaceholder.xml
@@ -18,13 +18,14 @@
<argument index="1" name="custom_scene" type="PackedScene" default="null">
</argument>
<description>
+ Not thread-safe. Use [method Object.call_deferred] if calling from a thread.
</description>
</method>
<method name="get_instance_path" qualifiers="const">
<return type="String">
</return>
<description>
- Gets the path to the [PackedScene] resource file that is loaded by default when calling [method create_instance].
+ Gets the path to the [PackedScene] resource file that is loaded by default when calling [method create_instance]. Not thread-safe. Use [method Object.call_deferred] if calling from a thread.
</description>
</method>
<method name="get_stored_values">
diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml
index c6ed1e22ed..25420bd77b 100644
--- a/doc/classes/ItemList.xml
+++ b/doc/classes/ItemList.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
This control provides a selectable list of items that may be in a single (or multiple columns) with option of text, icons, or both text and icon. Tooltips are supported and may be different for every item in the list.
- Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing Enter.
+ Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing [kbd]Enter[/kbd].
Item text only supports single-line strings, newline characters (e.g. [code]\n[/code]) in the string won't produce a newline. Text wrapping is enabled in [constant ICON_MODE_TOP] mode, but column's width is adjusted to fully fit its content by default. You need to set [member fixed_column_width] greater than zero to wrap the text.
</description>
<tutorials>
@@ -278,7 +278,7 @@
</argument>
<description>
Disables (or enables) the item at the specified index.
- Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing Enter).
+ Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing [kbd]Enter[/kbd]).
</description>
</method>
<method name="set_item_icon">
@@ -452,7 +452,7 @@
<argument index="0" name="index" type="int">
</argument>
<description>
- Triggered when specified list item is activated via double-clicking or by pressing Enter.
+ Triggered when specified list item is activated via double-clicking or by pressing [kbd]Enter[/kbd].
</description>
</signal>
<signal name="item_rmb_selected">
@@ -508,7 +508,7 @@
Only allow selecting a single item.
</constant>
<constant name="SELECT_MULTI" value="1" enum="SelectMode">
- Allows selecting multiple items by holding Ctrl or Shift.
+ Allows selecting multiple items by holding [kbd]Ctrl[/kbd] or [kbd]Shift[/kbd].
</constant>
</constants>
<theme_items>
diff --git a/doc/classes/JSON.xml b/doc/classes/JSON.xml
index 7bd2edcb1c..a9fb50c262 100644
--- a/doc/classes/JSON.xml
+++ b/doc/classes/JSON.xml
@@ -15,7 +15,7 @@
<argument index="0" name="json" type="String">
</argument>
<description>
- Parses a JSON encoded string and returns a [JSONParseResult] containing the result.
+ Parses a JSON-encoded string and returns a [JSONParseResult] containing the result.
</description>
</method>
<method name="print">
@@ -29,6 +29,29 @@
</argument>
<description>
Converts a [Variant] var to JSON text and returns the result. Useful for serializing data to store or send over the network.
+ [b]Note:[/b] The JSON specification does not define integer or float types, but only a [i]number[/i] type. Therefore, converting a Variant to JSON text will convert all numerical values to [float] types.
+ Use [code]indent[/code] parameter to pretty print the output.
+ [b]Example output:[/b]
+ [codeblock]
+ ## JSON.print(my_dictionary)
+ {"name":"my_dictionary","version":"1.0.0","entities":[{"name":"entity_0","value":"value_0"},{"name":"entity_1","value":"value_1"}]}
+
+ ## JSON.print(my_dictionary, "\t")
+ {
+ "name": "my_dictionary",
+ "version": "1.0.0",
+ "entities": [
+ {
+ "name": "entity_0",
+ "value": "value_0"
+ },
+ {
+ "name": "entity_1",
+ "value": "value_1"
+ }
+ ]
+ }
+ [/codeblock]
</description>
</method>
</methods>
diff --git a/doc/classes/JSONParseResult.xml b/doc/classes/JSONParseResult.xml
index 4444e08593..4dbceb35e9 100644
--- a/doc/classes/JSONParseResult.xml
+++ b/doc/classes/JSONParseResult.xml
@@ -15,21 +15,21 @@
The error type if the JSON source was not successfully parsed. See the [enum Error] constants.
</member>
<member name="error_line" type="int" setter="set_error_line" getter="get_error_line" default="-1">
- The line number where the error occurred if JSON source was not successfully parsed.
+ The line number where the error occurred if the JSON source was not successfully parsed.
</member>
<member name="error_string" type="String" setter="set_error_string" getter="get_error_string" default="&quot;&quot;">
- The error message if JSON source was not successfully parsed. See the [enum Error] constants.
+ The error message if the JSON source was not successfully parsed. See the [enum Error] constants.
</member>
<member name="result" type="Variant" setter="set_result" getter="get_result">
- A [Variant] containing the parsed JSON. Use [method @GDScript.typeof] or the [code]is[/code] keyword to check if it is what you expect. For example, if the JSON source starts with curly braces ([code]{}[/code]), a [Dictionary] will be returned. If the JSON source starts with braces ([code][][/code]), an [Array] will be returned.
- [b]Note:[/b] The JSON specification does not define integer or float types, but only a number type. Therefore, parsing a JSON text will convert all numerical values to float types.
+ A [Variant] containing the parsed JSON. Use [method @GDScript.typeof] or the [code]is[/code] keyword to check if it is what you expect. For example, if the JSON source starts with curly braces ([code]{}[/code]), a [Dictionary] will be returned. If the JSON source starts with brackets ([code][][/code]), an [Array] will be returned.
+ [b]Note:[/b] The JSON specification does not define integer or float types, but only a [i]number[/i] type. Therefore, parsing a JSON text will convert all numerical values to [float] types.
[b]Note:[/b] JSON objects do not preserve key order like Godot dictionaries, thus, you should not rely on keys being in a certain order if a dictionary is constructed from JSON. In contrast, JSON arrays retain the order of their elements:
[codeblock]
var p = JSON.parse('["hello", "world", "!"]')
if typeof(p.result) == TYPE_ARRAY:
print(p.result[0]) # Prints "hello"
else:
- print("unexpected results")
+ push_error("Unexpected results.")
[/codeblock]
</member>
</members>
diff --git a/doc/classes/JSONParser.xml b/doc/classes/JSONParser.xml
new file mode 100644
index 0000000000..31ba295418
--- /dev/null
+++ b/doc/classes/JSONParser.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="JSONParser" inherits="Reference" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="decode_data">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="data" type="Variant">
+ </argument>
+ <argument index="1" name="indent" type="String" default="&quot;&quot;">
+ </argument>
+ <argument index="2" name="sort_keys" type="bool" default="true">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_data" qualifiers="const">
+ <return type="Variant">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_error_line" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_error_text" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_string" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="parse_string">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="json_string" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/JavaScript.xml b/doc/classes/JavaScript.xml
index 68f6c32a53..c707a72ee8 100644
--- a/doc/classes/JavaScript.xml
+++ b/doc/classes/JavaScript.xml
@@ -5,9 +5,10 @@
</brief_description>
<description>
The JavaScript singleton is implemented only in the HTML5 export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs.
+ [b]Note:[/b] This singleton can be disabled at build-time to improve security. By default, the JavaScript singleton is enabled. Official export templates also have the JavaScript singleton enabled. See [url=https://docs.godotengine.org/en/latest/development/compiling/compiling_for_web.html]Compiling for the Web[/url] in the documentation for more information.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/workflow/export/exporting_for_web.html#calling-javascript-from-script</link>
+ <link title="Exporting for the Web: Calling JavaScript from script">https://docs.godotengine.org/en/latest/getting_started/workflow/export/exporting_for_web.html#calling-javascript-from-script</link>
</tutorials>
<methods>
<method name="eval">
diff --git a/doc/classes/Joint2D.xml b/doc/classes/Joint2D.xml
index fb0e184c26..b055293b9d 100644
--- a/doc/classes/Joint2D.xml
+++ b/doc/classes/Joint2D.xml
@@ -15,7 +15,7 @@
When [member node_a] and [member node_b] move in different directions the [code]bias[/code] controls how fast the joint pulls them back to their original position. The lower the [code]bias[/code] the more the two bodies can pull on the joint.
</member>
<member name="disable_collision" type="bool" setter="set_exclude_nodes_from_collision" getter="get_exclude_nodes_from_collision" default="true">
- If [code]true[/code], [member node_a] and [member node_b] can collide.
+ If [code]true[/code], [member node_a] and [member node_b] can not collide.
</member>
<member name="node_a" type="NodePath" setter="set_node_a" getter="get_node_a" default="NodePath(&quot;&quot;)">
The first body attached to the joint. Must derive from [PhysicsBody2D].
diff --git a/doc/classes/Joint3D.xml b/doc/classes/Joint3D.xml
index 15bef960f6..107c638b9e 100644
--- a/doc/classes/Joint3D.xml
+++ b/doc/classes/Joint3D.xml
@@ -7,6 +7,7 @@
Joints are used to bind together two physics bodies. They have a solver priority and can define if the bodies of the two attached nodes should be able to collide with each other.
</description>
<tutorials>
+ <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml
index 6b2bbeb895..425df00b6f 100644
--- a/doc/classes/KinematicBody2D.xml
+++ b/doc/classes/KinematicBody2D.xml
@@ -6,11 +6,13 @@
<description>
Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses:
[b]Simulated motion:[/b] When these bodies are moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
- [b]Kinematic characters:[/b] KinematicBody2D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics.
+ [b]Kinematic characters:[/b] KinematicBody2D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/using_kinematic_body_2d.html</link>
+ <link title="Kinematic character (2D)">https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link>
+ <link title="Using KinematicBody2D">https://docs.godotengine.org/en/latest/tutorials/physics/using_kinematic_body_2d.html</link>
+ <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
+ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
</tutorials>
<methods>
<method name="get_floor_normal" qualifiers="const">
@@ -33,7 +35,7 @@
<argument index="0" name="slide_idx" type="int">
</argument>
<description>
- Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last [method move_and_slide] call. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_count] - 1).
+ Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide] or [method move_and_slide_with_snap]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_count] - 1).
[b]Example usage:[/b]
[codeblock]
for i in get_slide_count():
@@ -46,28 +48,28 @@
<return type="int">
</return>
<description>
- Returns the number of times the body collided and changed direction during the last call to [method move_and_slide].
+ Returns the number of times the body collided and changed direction during the last call to [method move_and_slide] or [method move_and_slide_with_snap].
</description>
</method>
<method name="is_on_ceiling" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on the ceiling. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with the ceiling on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="is_on_floor" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on the floor. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with the floor on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="is_on_wall" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on a wall. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with a wall on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="move_and_collide">
@@ -102,9 +104,9 @@
<argument index="5" name="infinite_inertia" type="bool" default="true">
</argument>
<description>
- Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes.
+ Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
- [code]linear_velocity[/code] is the velocity vector in pixels per second. Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
+ [code]linear_velocity[/code] is the velocity vector in pixels per second. Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
[code]up_direction[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games.
If [code]stop_on_slope[/code] is [code]true[/code], body will not slide on slopes when you include gravity in [code]linear_velocity[/code] and the body is standing still.
If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops.
diff --git a/doc/classes/KinematicBody3D.xml b/doc/classes/KinematicBody3D.xml
index 5f9b36f97d..a21496de54 100644
--- a/doc/classes/KinematicBody3D.xml
+++ b/doc/classes/KinematicBody3D.xml
@@ -6,10 +6,14 @@
<description>
Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses:
[b]Simulated motion:[/b] When these bodies are moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
- [b]Kinematic characters:[/b] KinematicBody3D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics.
+ [b]Kinematic characters:[/b] KinematicBody3D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link>
+ <link title="Kinematic character (2D)">https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="get_axis_lock" qualifiers="const">
@@ -18,7 +22,7 @@
<argument index="0" name="axis" type="int" enum="PhysicsServer3D.BodyAxis">
</argument>
<description>
- Returns [code]true[/code] if the specified [code]axis[/code] is locked. See also [member move_lock_x], [member move_lock_y] and [member move_lock_z].
+ Returns [code]true[/code] if the specified [code]axis[/code] is locked. See also [member axis_lock_motion_x], [member axis_lock_motion_y] and [member axis_lock_motion_z].
</description>
</method>
<method name="get_floor_normal" qualifiers="const">
@@ -41,35 +45,35 @@
<argument index="0" name="slide_idx" type="int">
</argument>
<description>
- Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last [method move_and_slide] call. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_count] - 1).
+ Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last call to [method move_and_slide] or [method move_and_slide_with_snap]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_count] - 1).
</description>
</method>
<method name="get_slide_count" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the number of times the body collided and changed direction during the last call to [method move_and_slide].
+ Returns the number of times the body collided and changed direction during the last call to [method move_and_slide] or [method move_and_slide_with_snap].
</description>
</method>
<method name="is_on_ceiling" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on the ceiling. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with the ceiling on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="is_on_floor" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on the floor. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with the floor on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="is_on_wall" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on a wall. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with a wall on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="move_and_collide">
@@ -104,11 +108,11 @@
<argument index="5" name="infinite_inertia" type="bool" default="true">
</argument>
<description>
- Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes.
+ Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
- [code]linear_velocity[/code] is the velocity vector (typically meters per second). Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
+ [code]linear_velocity[/code] is the velocity vector (typically meters per second). Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
[code]up_direction[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector3(0, 0, 0)[/code], everything is considered a wall.
- If [code]stop_on_slope[/code] is [code]true[/code], body will not slide on slopes if you include gravity in [code]linear_velocity[/code].
+ If [code]stop_on_slope[/code] is [code]true[/code], body will not slide on slopes when you include gravity in [code]linear_velocity[/code] and the body is standing still.
If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops.
[code]floor_max_angle[/code] is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees.
If [code]infinite_inertia[/code] is [code]true[/code], body will be able to push [RigidBody3D] nodes, but it won't also detect any collisions with them. If [code]false[/code], it will interact with [RigidBody3D] nodes like with [StaticBody3D].
@@ -145,7 +149,7 @@
<argument index="1" name="lock" type="bool">
</argument>
<description>
- Locks or unlocks the specified [code]axis[/code] depending on the value of [code]lock[/code]. See also [member move_lock_x], [member move_lock_y] and [member move_lock_z].
+ Locks or unlocks the specified [code]axis[/code] depending on the value of [code]lock[/code]. See also [member axis_lock_motion_x], [member axis_lock_motion_y] and [member axis_lock_motion_z].
</description>
</method>
<method name="test_move">
@@ -163,18 +167,18 @@
</method>
</methods>
<members>
- <member name="collision/safe_margin" type="float" setter="set_safe_margin" getter="get_safe_margin" default="0.001">
- If the body is at least this close to another body, this body will consider them to be colliding.
- </member>
- <member name="move_lock_x" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
+ <member name="axis_lock_motion_x" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
Lock the body's X axis movement.
</member>
- <member name="move_lock_y" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
+ <member name="axis_lock_motion_y" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
Lock the body's Y axis movement.
</member>
- <member name="move_lock_z" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
+ <member name="axis_lock_motion_z" type="bool" setter="set_axis_lock" getter="get_axis_lock" default="false">
Lock the body's Z axis movement.
</member>
+ <member name="collision/safe_margin" type="float" setter="set_safe_margin" getter="get_safe_margin" default="0.001">
+ If the body is at least this close to another body, this body will consider them to be colliding.
+ </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml
index 263fb6c022..570d7f075b 100644
--- a/doc/classes/Label.xml
+++ b/doc/classes/Label.xml
@@ -8,6 +8,7 @@
[b]Note:[/b] Contrarily to most other [Control]s, Label's [member Control.mouse_filter] defaults to [constant Control.MOUSE_FILTER_IGNORE] (i.e. it doesn't react to mouse input events). This implies that a label won't display any configured [member Control.hint_tooltip], unless you change its mouse filter.
</description>
<tutorials>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="get_line_count" qualifiers="const">
@@ -57,7 +58,7 @@
</member>
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" override="true" enum="Control.MouseFilter" default="2" />
<member name="percent_visible" type="float" setter="set_percent_visible" getter="get_percent_visible" default="1.0">
- Limits the count of visible characters. If you set [code]percent_visible[/code] to 50, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
+ Limits the amount of visible characters. If you set [code]percent_visible[/code] to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" override="true" default="4" />
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml
index 2862190d4d..f6698352ab 100644
--- a/doc/classes/Light2D.xml
+++ b/doc/classes/Light2D.xml
@@ -8,11 +8,28 @@
[b]Note:[/b] Light2D can also be used as a mask.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link>
+ <link title="2D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link>
</tutorials>
<methods>
+ <method name="get_height" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_height">
+ <return type="void">
+ </return>
+ <argument index="0" name="height" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<members>
+ <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="Light2D.BlendMode" default="0">
+ The Light2D's blend mode. See [enum BlendMode] constants for values.
+ </member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
The Light2D's [Color].
</member>
@@ -25,15 +42,6 @@
<member name="energy" type="float" setter="set_energy" getter="get_energy" default="1.0">
The Light2D's energy value. The larger the value, the stronger the light.
</member>
- <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="Light2D.Mode" default="0">
- The Light2D's mode. See [enum Mode] constants for values.
- </member>
- <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )">
- The offset of the Light2D's [code]texture[/code].
- </member>
- <member name="range_height" type="float" setter="set_height" getter="get_height" default="0.0">
- The height of the Light2D. Used with 2D normal mapping.
- </member>
<member name="range_item_cull_mask" type="int" setter="set_item_cull_mask" getter="get_item_cull_mask" default="1">
The layer mask. Only objects with a matching mask will be affected by the Light2D.
</member>
@@ -49,9 +57,6 @@
<member name="range_z_min" type="int" setter="set_z_range_min" getter="get_z_range_min" default="-1024">
Minimum [code]z[/code] value of objects that are affected by the Light2D.
</member>
- <member name="shadow_buffer_size" type="int" setter="set_shadow_buffer_size" getter="get_shadow_buffer_size" default="2048">
- Shadow buffer size.
- </member>
<member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color( 0, 0, 0, 0 )">
[Color] of shadows cast by the Light2D.
</member>
@@ -67,26 +72,8 @@
<member name="shadow_item_cull_mask" type="int" setter="set_item_shadow_cull_mask" getter="get_item_shadow_cull_mask" default="1">
The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching light mask will cast shadows.
</member>
- <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
- [Texture2D] used for the Light2D's appearance.
- </member>
- <member name="texture_scale" type="float" setter="set_texture_scale" getter="get_texture_scale" default="1.0">
- The [code]texture[/code]'s scale factor.
- </member>
</members>
<constants>
- <constant name="MODE_ADD" value="0" enum="Mode">
- Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light.
- </constant>
- <constant name="MODE_SUB" value="1" enum="Mode">
- Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect.
- </constant>
- <constant name="MODE_MIX" value="2" enum="Mode">
- Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation.
- </constant>
- <constant name="MODE_MASK" value="3" enum="Mode">
- The light texture of the Light2D is used as a mask, hiding or revealing parts of the screen underneath depending on the value of each pixel of the light (mask) texture.
- </constant>
<constant name="SHADOW_FILTER_NONE" value="0" enum="ShadowFilter">
No filter applies to the shadow map. See [member shadow_filter].
</constant>
@@ -96,5 +83,14 @@
<constant name="SHADOW_FILTER_PCF13" value="2" enum="ShadowFilter">
Percentage closer filtering (13 samples) applies to the shadow map. See [member shadow_filter].
</constant>
+ <constant name="BLEND_MODE_ADD" value="0" enum="BlendMode">
+ Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light.
+ </constant>
+ <constant name="BLEND_MODE_SUB" value="1" enum="BlendMode">
+ Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect.
+ </constant>
+ <constant name="BLEND_MODE_MIX" value="2" enum="BlendMode">
+ Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml
index cb21db2d00..6c008e4f7e 100644
--- a/doc/classes/Light3D.xml
+++ b/doc/classes/Light3D.xml
@@ -4,10 +4,11 @@
Provides a base class for different kinds of light nodes.
</brief_description>
<description>
- Light3D is the abstract base class for light nodes, so it shouldn't be used directly (it can't be instanced). Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting.
+ Light3D is the [i]abstract[/i] base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
+ <link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="get_param" qualifiers="const">
@@ -36,19 +37,19 @@
If [code]true[/code], the light only appears in the editor and will not be visible at runtime.
</member>
<member name="light_angular_distance" type="float" setter="set_param" getter="get_param" default="0.0">
- Angular size of the light in degrees. Only available for [DirectionalLight3D]s. For reference, the sun from earth is approximately [code]0.5[/code].
+ The light's angular size in degrees. Only available for [DirectionalLight3D]s. For reference, the Sun from the Earth is approximately [code]0.5[/code].
</member>
<member name="light_bake_mode" type="int" setter="set_bake_mode" getter="get_bake_mode" enum="Light3D.BakeMode" default="1">
The light's bake mode. See [enum BakeMode].
</member>
<member name="light_color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
- The light's color.
+ The light's color. An [i]overbright[/i] color can be used to achieve a result equivalent to increasing the light's [member light_energy].
</member>
<member name="light_cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295">
The light will affect objects in the selected layers.
</member>
<member name="light_energy" type="float" setter="set_param" getter="get_param" default="1.0">
- The light's strength multiplier.
+ The light's strength multiplier (this is not a physical unit). For [OmniLight3D] and [SpotLight3D], changing this value will only change the light color's intensity, not the light's radius.
</member>
<member name="light_indirect_energy" type="float" setter="set_param" getter="get_param" default="1.0">
Secondary multiplier used with indirect light (light bounces). Used with [GIProbe].
@@ -60,16 +61,16 @@
[Texture2D] projected by light. [member shadow_enabled] must be on for the projector to work. Light projectors make the light appear as if it is shining through a colored but transparent object, almost like light shining through stained glass.
</member>
<member name="light_size" type="float" setter="set_param" getter="get_param" default="0.0">
- The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s.
+ The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s. Increasing this value will make the light fade out slower and shadows appear blurrier. This can be used to simulate area lights to an extent.
</member>
<member name="light_specular" type="float" setter="set_param" getter="get_param" default="0.5">
- The intensity of the specular blob in objects affected by the light. At [code]0[/code] the light becomes a pure diffuse light.
+ The intensity of the specular blob in objects affected by the light. At [code]0[/code], the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface.
</member>
- <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.02">
- Used to adjust shadow appearance. Too small a value results in self-shadowing, while too large a value causes shadows to separate from casters. Adjust as needed.
+ <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.1">
+ Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed.
</member>
<member name="shadow_blur" type="float" setter="set_param" getter="get_param" default="1.0">
- Blurs the edges of the shadow. Can be used to hide pixel artifacts in low resolution shadow maps. A high value can make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible.
+ Blurs the edges of the shadow. Can be used to hide pixel artifacts in low-resolution shadow maps. A high value can impact performance, make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible.
</member>
<member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color( 0, 0, 0, 1 )">
The color of shadows cast by this light.
@@ -77,8 +78,10 @@
<member name="shadow_enabled" type="bool" setter="set_shadow" getter="has_shadow" default="false">
If [code]true[/code], the light will cast shadows.
</member>
- <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="1.0">
- Offsets the lookup into the shadow map by the objects normal. This can be used reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible.
+ <member name="shadow_fog_fade" type="float" setter="set_param" getter="get_param" default="1.0">
+ </member>
+ <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="2.0">
+ Offsets the lookup into the shadow map by the object's normal. This can be used to reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible.
</member>
<member name="shadow_reverse_cull_face" type="bool" setter="set_shadow_reverse_cull_face" getter="get_shadow_reverse_cull_face" default="false">
If [code]true[/code], reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with [constant GeometryInstance3D.SHADOW_CASTING_SETTING_DOUBLE_SIDED].
@@ -138,22 +141,21 @@
<constant name="PARAM_SHADOW_BLUR" value="16" enum="Param">
Constant for accessing [member shadow_blur].
</constant>
- <constant name="PARAM_TRANSMITTANCE_BIAS" value="17" enum="Param">
+ <constant name="PARAM_SHADOW_VOLUMETRIC_FOG_FADE" value="17" enum="Param">
+ </constant>
+ <constant name="PARAM_TRANSMITTANCE_BIAS" value="18" enum="Param">
Constant for accessing [member shadow_transmittance_bias].
</constant>
- <constant name="PARAM_MAX" value="18" enum="Param">
+ <constant name="PARAM_MAX" value="19" enum="Param">
Represents the size of the [enum Param] enum.
</constant>
<constant name="BAKE_DISABLED" value="0" enum="BakeMode">
Light is ignored when baking.
[b]Note:[/b] Hiding a light does [i]not[/i] affect baking.
</constant>
- <constant name="BAKE_INDIRECT" value="1" enum="BakeMode">
- Only indirect lighting will be baked (default).
+ <constant name="BAKE_DYNAMIC" value="1" enum="BakeMode">
</constant>
- <constant name="BAKE_ALL" value="2" enum="BakeMode">
- Both direct and indirect light will be baked.
- [b]Note:[/b] You should hide the light if you don't want it to appear twice (dynamic and baked).
+ <constant name="BAKE_STATIC" value="2" enum="BakeMode">
</constant>
</constants>
</class>
diff --git a/doc/classes/LightOccluder2D.xml b/doc/classes/LightOccluder2D.xml
index a02f7a0f75..9f128e5942 100644
--- a/doc/classes/LightOccluder2D.xml
+++ b/doc/classes/LightOccluder2D.xml
@@ -7,7 +7,7 @@
Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an [OccluderPolygon2D] in order for the shadow to be computed.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link>
+ <link title="2D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/LightmapProbe.xml b/doc/classes/LightmapProbe.xml
new file mode 100644
index 0000000000..3af71f3774
--- /dev/null
+++ b/doc/classes/LightmapProbe.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="LightmapProbe" inherits="Node3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Lightmapper.xml b/doc/classes/Lightmapper.xml
new file mode 100644
index 0000000000..e80194858a
--- /dev/null
+++ b/doc/classes/Lightmapper.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="Lightmapper" inherits="Reference" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/LightmapperRD.xml b/doc/classes/LightmapperRD.xml
new file mode 100644
index 0000000000..0993b28f19
--- /dev/null
+++ b/doc/classes/LightmapperRD.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="LightmapperRD" inherits="Lightmapper" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml
index 68cec3e624..dec5d60cbb 100644
--- a/doc/classes/Line2D.xml
+++ b/doc/classes/Line2D.xml
@@ -7,6 +7,8 @@
A line through several points in 2D space.
</description>
<tutorials>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link>
</tutorials>
<methods>
<method name="add_point">
@@ -72,7 +74,7 @@
<member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="Line2D.LineCapMode" default="0">
Controls the style of the line's first point. Use [enum LineCapMode] constants.
</member>
- <member name="default_color" type="Color" setter="set_default_color" getter="get_default_color" default="Color( 0.4, 0.5, 1, 1 )">
+ <member name="default_color" type="Color" setter="set_default_color" getter="get_default_color" default="Color( 1, 1, 1, 1 )">
The line's color. Will not be used if a gradient is set.
</member>
<member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode" default="0">
@@ -85,7 +87,7 @@
The style for the points between the start and the end.
</member>
<member name="points" type="PackedVector2Array" setter="set_points" getter="get_points" default="PackedVector2Array( )">
- The points that form the lines. The line is drawn between every point set in this array.
+ The points that form the lines. The line is drawn between every point set in this array. Points are interpreted as local vectors.
</member>
<member name="round_precision" type="int" setter="set_round_precision" getter="get_round_precision" default="8">
The smoothness of the rounded joints and caps. This is only used if a cap or joint is set as round.
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index 447446ba10..5c2dffd538 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -5,27 +5,27 @@
</brief_description>
<description>
LineEdit provides a single-line string editor, used for text fields.
- It features many built-in shortcuts which will always be available ([code]Ctrl[/code] here maps to [code]Command[/code] on macOS):
- - Ctrl + C: Copy
- - Ctrl + X: Cut
- - Ctrl + V or Ctrl + Y: Paste/"yank"
- - Ctrl + Z: Undo
- - Ctrl + Shift + Z: Redo
- - Ctrl + U: Delete text from the cursor position to the beginning of the line
- - Ctrl + K: Delete text from the cursor position to the end of the line
- - Ctrl + A: Select all text
- - Up/Down arrow: Move the cursor to the beginning/end of the line
+ It features many built-in shortcuts which will always be available ([kbd]Ctrl[/kbd] here maps to [kbd]Cmd[/kbd] on macOS):
+ - [kbd]Ctrl + C[/kbd]: Copy
+ - [kbd]Ctrl + X[/kbd]: Cut
+ - [kbd]Ctrl + V[/kbd] or [kbd]Ctrl + Y[/kbd]: Paste/"yank"
+ - [kbd]Ctrl + Z[/kbd]: Undo
+ - [kbd]Ctrl + Shift + Z[/kbd]: Redo
+ - [kbd]Ctrl + U[/kbd]: Delete text from the cursor position to the beginning of the line
+ - [kbd]Ctrl + K[/kbd]: Delete text from the cursor position to the end of the line
+ - [kbd]Ctrl + A[/kbd]: Select all text
+ - [kbd]Up Arrow[/kbd]/[kbd]Down Arrow[/kbd]: Move the cursor to the beginning/end of the line
On macOS, some extra keyboard shortcuts are available:
- - Ctrl + F: Like the right arrow key, move the cursor one character right
- - Ctrl + B: Like the left arrow key, move the cursor one character left
- - Ctrl + P: Like the up arrow key, move the cursor to the previous line
- - Ctrl + N: Like the down arrow key, move the cursor to the next line
- - Ctrl + D: Like the Delete key, delete the character on the right side of cursor
- - Ctrl + H: Like the Backspace key, delete the character on the left side of the cursor
- - Ctrl + A: Like the Home key, move the cursor to the beginning of the line
- - Ctrl + E: Like the End key, move the cursor to the end of the line
- - Command + Left arrow: Like the Home key, move the cursor to the beginning of the line
- - Command + Right arrow: Like the End key, move the cursor to the end of the line
+ - [kbd]Ctrl + F[/kbd]: Same as [kbd]Right Arrow[/kbd], move the cursor one character right
+ - [kbd]Ctrl + B[/kbd]: Same as [kbd]Left Arrow[/kbd], move the cursor one character left
+ - [kbd]Ctrl + P[/kbd]: Same as [kbd]Up Arrow[/kbd], move the cursor to the previous line
+ - [kbd]Ctrl + N[/kbd]: Same as [kbd]Down Arrow[/kbd], move the cursor to the next line
+ - [kbd]Ctrl + D[/kbd]: Same as [kbd]Delete[/kbd], delete the character on the right side of cursor
+ - [kbd]Ctrl + H[/kbd]: Same as [kbd]Backspace[/kbd], delete the character on the left side of the cursor
+ - [kbd]Ctrl + A[/kbd]: Same as [kbd]Home[/kbd], move the cursor to the beginning of the line
+ - [kbd]Ctrl + E[/kbd]: Same as [kbd]End[/kbd], move the cursor to the end of the line
+ - [kbd]Cmd + Left Arrow[/kbd]: Same as [kbd]Home[/kbd], move the cursor to the beginning of the line
+ - [kbd]Cmd + Right Arrow[/kbd]: Same as [kbd]End[/kbd], move the cursor to the end of the line
</description>
<tutorials>
</tutorials>
@@ -43,7 +43,25 @@
<return type="void">
</return>
<description>
- Erases the [LineEdit] text.
+ Erases the [LineEdit]'s [member text].
+ </description>
+ </method>
+ <method name="delete_char_at_cursor">
+ <return type="void">
+ </return>
+ <description>
+ Deletes one character at the cursor's current position (equivalent to pressing [kbd]Delete[/kbd]).
+ </description>
+ </method>
+ <method name="delete_text">
+ <return type="void">
+ </return>
+ <argument index="0" name="from_column" type="int">
+ </argument>
+ <argument index="1" name="to_column" type="int">
+ </argument>
+ <description>
+ Deletes a section of the [member text] going from position [code]from_column[/code] to [code]to_column[/code]. Both parameters should be within the text's length.
</description>
</method>
<method name="deselect">
@@ -60,6 +78,13 @@
Returns the [PopupMenu] of this [LineEdit]. By default, this menu is displayed when right-clicking on the [LineEdit].
</description>
</method>
+ <method name="get_scroll_offset" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the scroll offset due to [member caret_position], as a number of characters.
+ </description>
+ </method>
<method name="menu_option">
<return type="void">
</return>
@@ -104,6 +129,8 @@
<member name="caret_blink_speed" type="float" setter="cursor_set_blink_speed" getter="cursor_get_blink_speed" default="0.65">
Duration (in seconds) of a caret's blinking cycle.
</member>
+ <member name="caret_force_displayed" type="bool" setter="cursor_set_force_displayed" getter="cursor_get_force_displayed" default="false">
+ </member>
<member name="caret_position" type="int" setter="set_cursor_position" getter="get_cursor_position" default="0">
The cursor's position inside the [LineEdit]. When set, the text may scroll to accommodate it.
</member>
@@ -149,6 +176,9 @@
String value of the [LineEdit].
[b]Note:[/b] Changing text using this property won't emit the [signal text_changed] signal.
</member>
+ <member name="virtual_keyboard_enabled" type="bool" setter="set_virtual_keyboard_enabled" getter="is_virtual_keyboard_enabled" default="true">
+ If [code]true[/code], the native virtual keyboard is shown when focused on platforms that support it.
+ </member>
</members>
<signals>
<signal name="text_change_rejected">
diff --git a/doc/classes/LineShape2D.xml b/doc/classes/LineShape2D.xml
index d3cfc94a8c..58caf1b1de 100644
--- a/doc/classes/LineShape2D.xml
+++ b/doc/classes/LineShape2D.xml
@@ -11,7 +11,7 @@
<methods>
</methods>
<members>
- <member name="d" type="float" setter="set_d" getter="get_d" default="0.0">
+ <member name="distance" type="float" setter="set_distance" getter="get_distance" default="0.0">
The line's distance from the origin.
</member>
<member name="normal" type="Vector2" setter="set_normal" getter="get_normal" default="Vector2( 0, 1 )">
diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml
index 13d3355da5..15307de897 100644
--- a/doc/classes/LinkButton.xml
+++ b/doc/classes/LinkButton.xml
@@ -5,14 +5,13 @@
</brief_description>
<description>
This kind of button is primarily used when the interaction with the button causes a context change (like linking to a web page).
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
</tutorials>
<methods>
</methods>
<members>
- <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" override="true" enum="Control.FocusMode" default="0" />
- <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" />
<member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" override="true" enum="Control.CursorShape" default="2" />
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
The button's text that will be displayed inside the button's area.
diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml
index 7bb478fce2..3c3cbbfa29 100644
--- a/doc/classes/MainLoop.xml
+++ b/doc/classes/MainLoop.xml
@@ -78,38 +78,6 @@
If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame.
</description>
</method>
- <method name="finish">
- <return type="void">
- </return>
- <description>
- Should not be called manually, override [method _finalize] instead. Will be removed in Godot 4.0.
- </description>
- </method>
- <method name="idle">
- <return type="bool">
- </return>
- <argument index="0" name="delta" type="float">
- </argument>
- <description>
- Should not be called manually, override [method _idle] instead. Will be removed in Godot 4.0.
- </description>
- </method>
- <method name="init">
- <return type="void">
- </return>
- <description>
- Should not be called manually, override [method _initialize] instead. Will be removed in Godot 4.0.
- </description>
- </method>
- <method name="iteration">
- <return type="bool">
- </return>
- <argument index="0" name="delta" type="float">
- </argument>
- <description>
- Should not be called manually, override [method _iteration] instead. Will be removed in Godot 4.0.
- </description>
- </method>
</methods>
<signals>
<signal name="on_request_permissions_result">
@@ -142,13 +110,21 @@
Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
Specific to the macOS platform.
</constant>
- <constant name="NOTIFICATION_APP_RESUMED" value="2014">
- Notification received from the OS when the app is resumed.
+ <constant name="NOTIFICATION_APPLICATION_RESUMED" value="2014">
+ Notification received from the OS when the application is resumed.
Specific to the Android platform.
</constant>
- <constant name="NOTIFICATION_APP_PAUSED" value="2015">
- Notification received from the OS when the app is paused.
+ <constant name="NOTIFICATION_APPLICATION_PAUSED" value="2015">
+ Notification received from the OS when the application is paused.
Specific to the Android platform.
</constant>
+ <constant name="NOTIFICATION_APPLICATION_FOCUS_IN" value="2016">
+ Notification received from the OS when the application is focused, i.e. when changing the focus from the OS desktop or a thirdparty application to any open window of the Godot instance.
+ Implemented on desktop platforms.
+ </constant>
+ <constant name="NOTIFICATION_APPLICATION_FOCUS_OUT" value="2017">
+ Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
+ Implemented on desktop platforms.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/MarginContainer.xml b/doc/classes/MarginContainer.xml
index fb5f437239..c8eebd4677 100644
--- a/doc/classes/MarginContainer.xml
+++ b/doc/classes/MarginContainer.xml
@@ -6,13 +6,22 @@
<description>
Adds a top, left, bottom, and right margin to all [Control] nodes that are direct children of the container. To control the [MarginContainer]'s margin, use the [code]margin_*[/code] theme properties listed below.
[b]Note:[/b] Be careful, [Control] margin values are different than the constant margin values. If you want to change the custom margin values of the [MarginContainer] by code, you should use the following examples:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var margin_value = 100
set("custom_constants/margin_top", margin_value)
set("custom_constants/margin_left", margin_value)
set("custom_constants/margin_bottom", margin_value)
set("custom_constants/margin_right", margin_value)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ int marginValue = 100;
+ Set("custom_constants/margin_top", marginValue);
+ Set("custom_constants/margin_left", marginValue);
+ Set("custom_constants/margin_bottom", marginValue);
+ Set("custom_constants/margin_right", marginValue);
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml
index a37c8127f0..10a7061bef 100644
--- a/doc/classes/Material.xml
+++ b/doc/classes/Material.xml
@@ -7,6 +7,8 @@
Material is a base [Resource] used for coloring and shading geometry. All materials inherit from it and almost all [VisualInstance3D] derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here.
</description>
<tutorials>
+ <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
@@ -17,7 +19,7 @@
</member>
<member name="render_priority" type="int" setter="set_render_priority" getter="get_render_priority" default="0">
Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.
- [b]Note:[/b] this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are sorted based on depth, while transparent objects are sorted from back to front (subject to priority).
+ [b]Note:[/b] this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).
</member>
</members>
<constants>
diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml
index 316315f777..fe38c08280 100644
--- a/doc/classes/MenuButton.xml
+++ b/doc/classes/MenuButton.xml
@@ -6,6 +6,7 @@
<description>
Special button that brings up a [PopupMenu] when clicked.
New items can be created inside this [PopupMenu] using [code]get_popup().add_item("My Item Name")[/code]. You can also create them directly from the editor. To do so, select the [MenuButton] node, then in the toolbar at the top of the 2D editor, click [b]Items[/b] then click [b]Add[/b] in the popup. You will be able to give each items new properties.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
</tutorials>
@@ -29,9 +30,7 @@
</methods>
<members>
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" override="true" enum="BaseButton.ActionMode" default="0" />
- <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" override="true" enum="Control.FocusMode" default="0" />
<member name="flat" type="bool" setter="set_flat" getter="is_flat" override="true" default="true" />
- <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" />
<member name="switch_on_hover" type="bool" setter="set_switch_on_hover" getter="is_switch_on_hover" default="false">
If [code]true[/code], when the cursor hovers above another [MenuButton] within the same parent which also has [code]switch_on_hover[/code] enabled, it will close the current [MenuButton] and open the other one.
</member>
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml
index 6958c815a6..78db09feee 100644
--- a/doc/classes/Mesh.xml
+++ b/doc/classes/Mesh.xml
@@ -7,6 +7,10 @@
Mesh is a type of [Resource] that contains vertex array-based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.
</description>
<tutorials>
+ <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="create_convex_shape" qualifiers="const">
@@ -44,7 +48,7 @@
<return type="AABB">
</return>
<description>
- Returns the smallest [AABB] enclosing this mesh. Not affected by [code]custom_aabb[/code].
+ Returns the smallest [AABB] enclosing this mesh in local space. Not affected by [code]custom_aabb[/code]. See also [method VisualInstance3D.get_transformed_aabb].
[b]Note:[/b] This is only implemented for [ArrayMesh] and [PrimitiveMesh].
</description>
</method>
@@ -102,7 +106,7 @@
</method>
</methods>
<members>
- <member name="lightmap_size_hint" type="Vector2" setter="set_lightmap_size_hint" getter="get_lightmap_size_hint" default="Vector2( 0, 0 )">
+ <member name="lightmap_size_hint" type="Vector2i" setter="set_lightmap_size_hint" getter="get_lightmap_size_hint" default="Vector2i( 0, 0 )">
Sets a hint to be used for lightmap resolution.
</member>
</members>
diff --git a/doc/classes/MeshDataTool.xml b/doc/classes/MeshDataTool.xml
index dcc3bbf2a6..e107b1a108 100644
--- a/doc/classes/MeshDataTool.xml
+++ b/doc/classes/MeshDataTool.xml
@@ -7,16 +7,44 @@
MeshDataTool provides access to individual vertices in a [Mesh]. It allows users to read and edit vertex data of meshes. It also creates an array of faces and edges.
To use MeshDataTool, load a mesh with [method create_from_surface]. When you are finished editing the data commit the data to a mesh with [method commit_to_surface].
Below is an example of how MeshDataTool may be used.
- [codeblock]
+ [codeblocks]
+ [gdscript]
+ var mesh = ArrayMesh.new()
+ mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, CubeMesh.new().get_mesh_arrays())
var mdt = MeshDataTool.new()
mdt.create_from_surface(mesh, 0)
for i in range(mdt.get_vertex_count()):
var vertex = mdt.get_vertex(i)
- ...
+ # In this example we extend the mesh by one unit, which results in seperated faces as it is flat shaded.
+ vertex += mdt.get_vertex_normal(i)
+ # Save your change.
mdt.set_vertex(i, vertex)
mesh.surface_remove(0)
mdt.commit_to_surface(mesh)
- [/codeblock]
+ var mi = MeshInstance.new()
+ mi.mesh = mesh
+ add_child(mi)
+ [/gdscript]
+ [csharp]
+ var mesh = new ArrayMesh();
+ mesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, new CubeMesh().GetMeshArrays());
+ var mdt = new MeshDataTool();
+ mdt.CreateFromSurface(mesh, 0);
+ for (var i = 0; i &lt; mdt.GetVertexCount(); i++)
+ {
+ Vector3 vertex = mdt.GetVertex(i);
+ // In this example we extend the mesh by one unit, which results in seperated faces as it is flat shaded.
+ vertex += mdt.GetVertexNormal(i);
+ // Save your change.
+ mdt.SetVertex(i, vertex);
+ }
+ mesh.SurfaceRemove(0);
+ mdt.CommitToSurface(mesh);
+ var mi = new MeshInstance();
+ mi.Mesh = mesh;
+ AddChild(mi);
+ [/csharp]
+ [/codeblocks]
See also [ArrayMesh], [ImmediateGeometry3D] and [SurfaceTool] for procedural geometry generation.
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
</description>
diff --git a/doc/classes/MeshInstance2D.xml b/doc/classes/MeshInstance2D.xml
index 0cfc8deb0a..59b312f69a 100644
--- a/doc/classes/MeshInstance2D.xml
+++ b/doc/classes/MeshInstance2D.xml
@@ -7,7 +7,7 @@
Node used for displaying a [Mesh] in 2D. Can be constructed from an existing [Sprite2D] via a tool in the editor toolbar. Select "Sprite2D" then "Convert to Mesh2D", select settings in popup and press "Create Mesh2D".
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_meshes.html</link>
+ <link title="2D meshes">https://docs.godotengine.org/en/latest/tutorials/2d/2d_meshes.html</link>
</tutorials>
<methods>
</methods>
@@ -17,6 +17,7 @@
</member>
<member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map">
The normal map that will be used if using the default [CanvasItemMaterial].
+ [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
</member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
The [Texture2D] that will be used if using the default [CanvasItemMaterial]. Can be accessed as [code]TEXTURE[/code] in CanvasItem shader.
diff --git a/doc/classes/MeshInstance3D.xml b/doc/classes/MeshInstance3D.xml
index c569da2df1..82cd392cd3 100644
--- a/doc/classes/MeshInstance3D.xml
+++ b/doc/classes/MeshInstance3D.xml
@@ -7,6 +7,10 @@
MeshInstance3D is a node that takes a [Mesh] resource and adds it to the current scenario by creating an instance of it. This is the class most often used render 3D geometry and can be used to instance a single [Mesh] in many places. This allows reuse of geometry which can save on resources. When a [Mesh] has to be instanced more than thousands of times at close proximity, consider using a [MultiMesh] in a [MultiMeshInstance3D] instead.
</description>
<tutorials>
+ <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="create_convex_collision">
diff --git a/doc/classes/MeshLibrary.xml b/doc/classes/MeshLibrary.xml
index ccf6172017..ad8bd6991d 100644
--- a/doc/classes/MeshLibrary.xml
+++ b/doc/classes/MeshLibrary.xml
@@ -7,6 +7,8 @@
A library of meshes. Contains a list of [Mesh] resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in [GridMap].
</description>
<tutorials>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
</tutorials>
<methods>
<method name="clear">
diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml
index 0f56ab4b95..6ebfc946dc 100644
--- a/doc/classes/MultiMesh.xml
+++ b/doc/classes/MultiMesh.xml
@@ -10,15 +10,15 @@
Since instances may have any behavior, the AABB used for visibility must be provided by the user.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/optimization/using_multimesh.html</link>
+ <link title="Animating thousands of fish with MultiMeshInstance">https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link>
+ <link title="Optimization using MultiMeshes">https://docs.godotengine.org/en/latest/tutorials/optimization/using_multimesh.html</link>
</tutorials>
<methods>
<method name="get_aabb" qualifiers="const">
<return type="AABB">
</return>
<description>
- Returns the visibility axis-aligned bounding box.
+ Returns the visibility axis-aligned bounding box in local space. See also [method VisualInstance3D.get_transformed_aabb].
</description>
</method>
<method name="get_instance_color" qualifiers="const">
@@ -65,7 +65,7 @@
<argument index="1" name="color" type="Color">
</argument>
<description>
- Sets the color of a specific instance.
+ Sets the color of a specific instance by [i]multiplying[/i] the mesh's existing vertex colors.
For the color to take effect, ensure that [member use_colors] is [code]true[/code] on the [MultiMesh] and [member BaseMaterial3D.vertex_color_use_as_albedo] is [code]true[/code] on the material.
</description>
</method>
diff --git a/doc/classes/MultiMeshInstance2D.xml b/doc/classes/MultiMeshInstance2D.xml
index 07f21514ef..a461c8e056 100644
--- a/doc/classes/MultiMeshInstance2D.xml
+++ b/doc/classes/MultiMeshInstance2D.xml
@@ -17,6 +17,7 @@
</member>
<member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map">
The normal map that will be used if using the default [CanvasItemMaterial].
+ [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
</member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
The [Texture2D] that will be used if using the default [CanvasItemMaterial]. Can be accessed as [code]TEXTURE[/code] in CanvasItem shader.
diff --git a/doc/classes/MultiMeshInstance3D.xml b/doc/classes/MultiMeshInstance3D.xml
index cab17c952e..7d8035ba77 100644
--- a/doc/classes/MultiMeshInstance3D.xml
+++ b/doc/classes/MultiMeshInstance3D.xml
@@ -8,9 +8,9 @@
This is useful to optimize the rendering of a high amount of instances of a given mesh (for example trees in a forest or grass strands).
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_multi_mesh_instance.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/optimization/using_multimesh.html</link>
+ <link title="Animating thousands of fish with MultiMeshInstance">https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link>
+ <link title="Using MultiMeshInstance">https://docs.godotengine.org/en/latest/tutorials/3d/using_multi_mesh_instance.html</link>
+ <link title="Optimization using MultiMeshes">https://docs.godotengine.org/en/latest/tutorials/optimization/using_multimesh.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Mutex.xml b/doc/classes/Mutex.xml
index 2de1f71867..f5f6308401 100644
--- a/doc/classes/Mutex.xml
+++ b/doc/classes/Mutex.xml
@@ -7,7 +7,7 @@
A synchronization mutex (mutual exclusion). This is used to synchronize multiple [Thread]s, and is equivalent to a binary [Semaphore]. It guarantees that only one thread can ever acquire the lock at a time. A mutex can be used to protect a critical section; however, be careful to avoid deadlocks.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link>
+ <link title="Using multiple threads">https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link>
</tutorials>
<methods>
<method name="lock">
diff --git a/doc/classes/Navigation2D.xml b/doc/classes/Navigation2D.xml
index dcbfbc2350..abac29bdb7 100644
--- a/doc/classes/Navigation2D.xml
+++ b/doc/classes/Navigation2D.xml
@@ -7,6 +7,7 @@
Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of [NavigationPolygon] resources. These are automatically collected from child [NavigationRegion2D] nodes.
</description>
<tutorials>
+ <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link>
</tutorials>
<methods>
<method name="get_closest_point" qualifiers="const">
diff --git a/doc/classes/Navigation3D.xml b/doc/classes/Navigation3D.xml
index 807f0ad309..e7a4fe3c43 100644
--- a/doc/classes/Navigation3D.xml
+++ b/doc/classes/Navigation3D.xml
@@ -7,6 +7,7 @@
Provides navigation and pathfinding within a collection of [NavigationMesh]es. These will be automatically collected from child [NavigationRegion3D] nodes. In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on.
</description>
<tutorials>
+ <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link>
</tutorials>
<methods>
<method name="get_closest_point" qualifiers="const">
diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml
index 6deca4394f..dd7464ac0e 100644
--- a/doc/classes/NavigationMesh.xml
+++ b/doc/classes/NavigationMesh.xml
@@ -5,6 +5,7 @@
<description>
</description>
<tutorials>
+ <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link>
</tutorials>
<methods>
<method name="add_polygon">
@@ -80,14 +81,17 @@
<member name="agent/height" type="float" setter="set_agent_height" getter="get_agent_height" default="2.0">
</member>
<member name="agent/max_climb" type="float" setter="set_agent_max_climb" getter="get_agent_max_climb" default="0.9">
+ The maximum height difference between two areas for navigation to be generated between them.
</member>
<member name="agent/max_slope" type="float" setter="set_agent_max_slope" getter="get_agent_max_slope" default="45.0">
+ The maximum angle a slope can be at for navigation to be generated on it.
</member>
<member name="agent/radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="0.6">
</member>
<member name="cell/height" type="float" setter="set_cell_height" getter="get_cell_height" default="0.2">
</member>
<member name="cell/size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.3">
+ The size of cells in the [NavigationMesh].
</member>
<member name="detail/sample_distance" type="float" setter="set_detail_sample_distance" getter="get_detail_sample_distance" default="6.0">
</member>
@@ -104,18 +108,25 @@
<member name="filter/low_hanging_obstacles" type="bool" setter="set_filter_low_hanging_obstacles" getter="get_filter_low_hanging_obstacles" default="false">
</member>
<member name="geometry/collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask">
+ The physics layers used to generate the [NavigationMesh].
</member>
<member name="geometry/parsed_geometry_type" type="int" setter="set_parsed_geometry_type" getter="get_parsed_geometry_type" default="0">
+ What kind of geomerty is used to generate the [NavigationMesh].
</member>
<member name="geometry/source_geometry_mode" type="int" setter="set_source_geometry_mode" getter="get_source_geometry_mode" default="0">
+ Which geometry is used to generate the [NavigationMesh].
</member>
<member name="geometry/source_group_name" type="StringName" setter="set_source_group_name" getter="get_source_group_name">
+ The name of the group that is used to generate the [NavigationMesh].
</member>
<member name="polygon/verts_per_poly" type="float" setter="set_verts_per_poly" getter="get_verts_per_poly" default="6.0">
+ The number of vertices to use per polygon. Higher values will improve performance at the cost of lower precision.
</member>
<member name="region/merge_size" type="float" setter="set_region_merge_size" getter="get_region_merge_size" default="20.0">
+ If two adjacent regions' edges are separated by a distance lower than this value, the regions will be merged together.
</member>
<member name="region/min_size" type="float" setter="set_region_min_size" getter="get_region_min_size" default="8.0">
+ The minimum size of a region for it to be created.
</member>
<member name="sample_partition_type/sample_partition_type" type="int" setter="set_sample_partition_type" getter="get_sample_partition_type" default="0">
</member>
diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml
index b0f77dff83..38921078d7 100644
--- a/doc/classes/NavigationPolygon.xml
+++ b/doc/classes/NavigationPolygon.xml
@@ -6,24 +6,44 @@
<description>
There are two ways to create polygons. Either by using the [method add_outline] method, or using the [method add_polygon] method.
Using [method add_outline]:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var polygon = NavigationPolygon.new()
var outline = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)])
polygon.add_outline(outline)
polygon.make_polygons_from_outlines()
$NavigationRegion2D.navpoly = polygon
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var polygon = new NavigationPolygon();
+ var outline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) };
+ polygon.AddOutline(outline);
+ polygon.MakePolygonsFromOutlines();
+ GetNode&lt;NavigationRegion2D&gt;("NavigationRegion2D").Navpoly = polygon;
+ [/csharp]
+ [/codeblocks]
Using [method add_polygon] and indices of the vertices array.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var polygon = NavigationPolygon.new()
var vertices = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)])
- polygon.set_vertices(vertices)
+ polygon.vertices = vertices
var indices = PackedInt32Array(0, 3, 1)
polygon.add_polygon(indices)
$NavigationRegion2D.navpoly = polygon
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var polygon = new NavigationPolygon();
+ var vertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) };
+ polygon.Vertices = vertices;
+ var indices = new int[] { 0, 3, 1 };
+ polygon.AddPolygon(indices);
+ GetNode&lt;NavigationRegion2D&gt;("NavigationRegion2D").Navpoly = polygon;
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
+ <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link>
</tutorials>
<methods>
<method name="add_outline">
diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml
index 1b9099336c..5f0b04487e 100644
--- a/doc/classes/NavigationServer2D.xml
+++ b/doc/classes/NavigationServer2D.xml
@@ -7,6 +7,7 @@
NavigationServer2D is the server responsible for all 2D navigation. It creates the agents, maps, and regions for navigation to work as expected. This keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying.
</description>
<tutorials>
+ <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link>
</tutorials>
<methods>
<method name="agent_create" qualifiers="const">
diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml
index 1f621c3c81..95890c4b4c 100644
--- a/doc/classes/NavigationServer3D.xml
+++ b/doc/classes/NavigationServer3D.xml
@@ -7,6 +7,7 @@
NavigationServer3D is the server responsible for all 3D navigation. It creates the agents, maps, and regions for navigation to work as expected. This keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying.
</description>
<tutorials>
+ <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link>
</tutorials>
<methods>
<method name="agent_create" qualifiers="const">
diff --git a/doc/classes/NetworkedMultiplayerPeer.xml b/doc/classes/NetworkedMultiplayerPeer.xml
index ff97ea926d..954d31794a 100644
--- a/doc/classes/NetworkedMultiplayerPeer.xml
+++ b/doc/classes/NetworkedMultiplayerPeer.xml
@@ -7,7 +7,8 @@
Manages the connection to network peers. Assigns unique IDs to each client connected to the server.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/networking/high_level_multiplayer.html</link>
+ <link title="High-level multiplayer">https://docs.godotengine.org/en/latest/tutorials/networking/high_level_multiplayer.html</link>
+ <link title="WebRTC Signaling Demo">https://godotengine.org/asset-library/asset/537</link>
</tutorials>
<methods>
<method name="get_connection_status" qualifiers="const">
diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml
index 9c3acc9b0a..b2e0442be8 100644
--- a/doc/classes/NinePatchRect.xml
+++ b/doc/classes/NinePatchRect.xml
@@ -32,10 +32,10 @@
</methods>
<members>
<member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode" default="0">
- Doesn't do anything at the time of writing.
+ The stretch mode to use for horizontal stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values.
</member>
<member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode" default="0">
- Doesn't do anything at the time of writing.
+ The stretch mode to use for vertical stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values.
</member>
<member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true">
If [code]true[/code], draw the panel's center. Else, only draw the 9-slice's borders.
@@ -45,13 +45,13 @@
The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
</member>
<member name="patch_margin_left" type="int" setter="set_patch_margin" getter="get_patch_margin" default="0">
- The height of the 9-slice's left column.
+ The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
</member>
<member name="patch_margin_right" type="int" setter="set_patch_margin" getter="get_patch_margin" default="0">
- The height of the 9-slice's right column.
+ The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
</member>
<member name="patch_margin_top" type="int" setter="set_patch_margin" getter="get_patch_margin" default="0">
- The height of the 9-slice's top row.
+ The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
</member>
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )">
Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture.
@@ -69,13 +69,15 @@
</signals>
<constants>
<constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode">
- Doesn't do anything at the time of writing.
+ Stretches the center texture across the NinePatchRect. This may cause the texture to be distorted.
</constant>
<constant name="AXIS_STRETCH_MODE_TILE" value="1" enum="AxisStretchMode">
- Doesn't do anything at the time of writing.
+ Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. The texture must be seamless for this to work without displaying artifacts between edges.
+ [b]Note:[/b] Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like [constant AXIS_STRETCH_MODE_STRETCH].
</constant>
<constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2" enum="AxisStretchMode">
- Doesn't do anything at the time of writing.
+ Repeats the center texture across the NinePatchRect, but will also stretch the texture to make sure each tile is visible in full. This may cause the texture to be distorted, but less than [constant AXIS_STRETCH_MODE_STRETCH]. The texture must be seamless for this to work without displaying artifacts between edges.
+ [b]Note:[/b] Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like [constant AXIS_STRETCH_MODE_STRETCH].
</constant>
</constants>
</class>
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 1c745de7f0..3f212fa0f6 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -17,7 +17,8 @@
[b]Networking with nodes:[/b] After connecting to a server (or making one, see [NetworkedMultiplayerENet]), it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling [method rpc] with a method name, it will be called locally and in all connected peers (peers = clients and the server that accepts connections). To identify which node receives the RPC call, Godot will use its [NodePath] (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/scenes_and_nodes.html</link>
+ <link title="Scenes and nodes">https://docs.godotengine.org/en/latest/getting_started/step_by_step/scenes_and_nodes.html</link>
+ <link title="All Demos">https://github.com/godotengine/godot-demo-projects/</link>
</tutorials>
<methods>
<method name="_enter_tree" qualifiers="virtual">
@@ -55,6 +56,7 @@
It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_input].
To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called.
For gameplay input, [method _unhandled_input] and [method _unhandled_key_input] are usually a better fit as they allow the GUI to intercept the events first.
+ [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
</description>
</method>
<method name="_physics_process" qualifiers="virtual">
@@ -66,6 +68,7 @@
Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [code]delta[/code] variable should be constant.
It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process].
Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification].
+ [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
</description>
</method>
<method name="_process" qualifiers="virtual">
@@ -77,6 +80,7 @@
Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [code]delta[/code] time since the previous frame is not constant.
It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process].
Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification].
+ [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
</description>
</method>
<method name="_ready" qualifiers="virtual">
@@ -99,6 +103,7 @@
It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_input].
To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called.
For gameplay input, this and [method _unhandled_key_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first.
+ [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
</description>
</method>
<method name="_unhandled_key_input" qualifiers="virtual">
@@ -111,6 +116,7 @@
It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input].
To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called.
For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first.
+ [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
</description>
</method>
<method name="add_child">
@@ -124,26 +130,35 @@
Adds a child node. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
If [code]legible_unique_name[/code] is [code]true[/code], the child node will have an human-readable name based on the name of the node being instanced instead of its type.
[b]Note:[/b] If the child node already has a parent, the function will fail. Use [method remove_child] first to remove the node from its current parent. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
+ var child_node = get_child(0)
if child_node.get_parent():
child_node.get_parent().remove_child(child_node)
add_child(child_node)
- [/codeblock]
- If you need the child node to be added below a specific node in the list of children, use [method add_child_below_node] instead of this method.
+ [/gdscript]
+ [csharp]
+ Node childNode = GetChild(0);
+ if (childNode.GetParent() != null)
+ {
+ childNode.GetParent().RemoveChild(childNode);
+ }
+ AddChild(childNode);
+ [/csharp]
+ [/codeblocks]
+ If you need the child node to be added below a specific node in the list of children, use [method add_sibling] instead of this method.
[b]Note:[/b] If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=https://godot.readthedocs.io/en/latest/tutorials/misc/running_code_in_the_editor.html]tool scripts[/url] and [url=https://godot.readthedocs.io/en/latest/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view.
</description>
</method>
- <method name="add_child_below_node">
+ <method name="add_sibling">
<return type="void">
</return>
- <argument index="0" name="preceding_node" type="Node">
+ <argument index="0" name="sibling" type="Node">
</argument>
- <argument index="1" name="node" type="Node">
- </argument>
- <argument index="2" name="legible_unique_name" type="bool" default="false">
+ <argument index="1" name="legible_unique_name" type="bool" default="false">
</argument>
<description>
- Adds a child node below the [code]preceding_node[/code].
+ Adds a [code]sibling[/code] node to current's node parent, at the the same level as that node, right below it.
If [code]legible_unique_name[/code] is [code]true[/code], the child node will have an human-readable name based on the name of the node being instanced instead of its type.
Use [method add_child] instead of this method if you don't need the child node to be added below a specific node in the list of children.
</description>
@@ -191,6 +206,7 @@
Finds a descendant of this node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]).
[b]Note:[/b] It does not match against the full path, just against individual node names.
If [code]owned[/code] is [code]true[/code], this method only finds nodes whose owner is this node. This is especially important for scenes instantiated through a script, because those scenes don't have an owner.
+ [b]Note:[/b] As this method walks through all the descendants of the node, it is the slowest way to get a reference to another node. Whenever possible, consider using [method get_node] instead. To avoid using [method find_node] too often, consider caching the node reference into a variable.
</description>
</method>
<method name="find_parent" qualifiers="const">
@@ -201,6 +217,7 @@
<description>
Finds the first parent of the current node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]).
[b]Note:[/b] It does not match against the full path, just against individual node names.
+ [b]Note:[/b] As this method walks upwards in the scene tree, it can be slow in large, deeply nested scene trees. Whenever possible, consider using [method get_node] instead. To avoid using [method find_parent] too often, consider caching the node reference into a variable.
</description>
</method>
<method name="get_child" qualifiers="const">
@@ -210,6 +227,7 @@
</argument>
<description>
Returns a child node by its index (see [method get_child_count]). This method is often used for iterating all children of a node.
+ Negative indices access the children from the last one.
To access a child node via its name, use [method get_node].
</description>
</method>
@@ -268,12 +286,20 @@
/root/Swamp/Goblin
[/codeblock]
Possible paths are:
- [codeblock]
+ [codeblocks]
+ [gdscript]
get_node("Sword")
get_node("Backpack/Dagger")
get_node("../Swamp/Alligator")
get_node("/root/MyGame")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GetNode("Sword");
+ GetNode("Backpack/Dagger");
+ GetNode("../Swamp/Alligator");
+ GetNode("/root/MyGame");
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_node_and_resource">
@@ -285,11 +311,18 @@
Fetches a node and one of its resources as specified by the [NodePath]'s subname (e.g. [code]Area2D/CollisionShape2D:shape[/code]). If several nested resources are specified in the [NodePath], the last one will be fetched.
The return value is an array of size 3: the first index points to the [Node] (or [code]null[/code] if not found), the second index points to the [Resource] (or [code]null[/code] if not found), and the third index is the remaining [NodePath], if any.
For example, assuming that [code]Area2D/CollisionShape2D[/code] is a valid node and that its [code]shape[/code] property has been assigned a [RectangleShape2D] resource, one could have this kind of output:
- [codeblock]
+ [codeblocks]
+ [gdscript]
print(get_node_and_resource("Area2D/CollisionShape2D")) # [[CollisionShape2D:1161], Null, ]
print(get_node_and_resource("Area2D/CollisionShape2D:shape")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
print(get_node_and_resource("Area2D/CollisionShape2D:shape:extents")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.Print(GetNodeAndResource("Area2D/CollisionShape2D")); // [[CollisionShape2D:1161], Null, ]
+ GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
+ GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape:extents")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_node_or_null" qualifiers="const">
@@ -305,7 +338,7 @@
<return type="Node">
</return>
<description>
- Returns the parent node of the current node, or an empty [Node] if the node lacks a parent.
+ Returns the parent node of the current node, or a [code]null instance[/code] if the node lacks a parent.
</description>
</method>
<method name="get_path" qualifiers="const">
@@ -519,7 +552,7 @@
â” â•´Menu
┃ ┠╴Label
┃ ┖╴Camera2D
- â”–-SplashScreen
+ â”–â•´SplashScreen
â”–â•´Camera2D
[/codeblock]
</description>
@@ -827,6 +860,7 @@
</member>
<member name="name" type="StringName" setter="set_name" getter="get_name">
The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed.
+ [b]Note:[/b] Auto-generated names might include the [code]@[/code] character, which is reserved for unique names when using [method add_child]. When setting the name manually, any [code]@[/code] will be removed.
</member>
<member name="owner" type="Node" setter="set_owner" getter="get_owner">
The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using [PackedScene]), all the nodes it owns will be saved with it. This allows for the creation of complex [SceneTree]s, with instancing and subinstancing.
@@ -915,6 +949,9 @@
<constant name="NOTIFICATION_INTERNAL_PHYSICS_PROCESS" value="26">
Notification received every frame when the internal physics process flag is set (see [method set_physics_process_internal]).
</constant>
+ <constant name="NOTIFICATION_POST_ENTER_TREE" value="27">
+ Notification received when the node is ready, just before [constant NOTIFICATION_READY] is received. Unlike the latter, it's sent every time the node enters tree, instead of only once.
+ </constant>
<constant name="NOTIFICATION_WM_MOUSE_ENTER" value="1002">
Notification received from the OS when the mouse enters the game window.
Implemented on desktop and web platforms.
@@ -923,16 +960,14 @@
Notification received from the OS when the mouse leaves the game window.
Implemented on desktop and web platforms.
</constant>
- <constant name="NOTIFICATION_WM_FOCUS_IN" value="1004">
- Notification received from the OS when the game window is focused.
- Implemented on all platforms.
+ <constant name="NOTIFICATION_WM_WINDOW_FOCUS_IN" value="1004">
+ Notification received from the OS when the node's parent [Window] is focused. This may be a change of focus between two windows of the same engine instance, or from the OS desktop or a third-party application to a window of the game (in which case [constant NOTIFICATION_APPLICATION_FOCUS_IN] is also emitted).
</constant>
- <constant name="NOTIFICATION_WM_FOCUS_OUT" value="1005">
- Notification received from the OS when the game window is unfocused.
- Implemented on all platforms.
+ <constant name="NOTIFICATION_WM_WINDOW_FOCUS_OUT" value="1005">
+ Notification received from the OS when the node's parent [Window] is defocused. This may be a change of focus between two windows of the same engine instance, or from a window of the game to the OS desktop or a third-party application (in which case [constant NOTIFICATION_APPLICATION_FOCUS_OUT] is also emitted).
</constant>
<constant name="NOTIFICATION_WM_CLOSE_REQUEST" value="1006">
- Notification received from the OS when a close request is sent (e.g. closing the window with a "Close" button or Alt+F4).
+ Notification received from the OS when a close request is sent (e.g. closing the window with a "Close" button or [kbd]Alt + F4[/kbd]).
Implemented on desktop platforms.
</constant>
<constant name="NOTIFICATION_WM_GO_BACK_REQUEST" value="1007">
@@ -960,14 +995,22 @@
Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
Specific to the macOS platform.
</constant>
- <constant name="NOTIFICATION_APP_RESUMED" value="2014">
- Notification received from the OS when the app is resumed.
+ <constant name="NOTIFICATION_APPLICATION_RESUMED" value="2014">
+ Notification received from the OS when the application is resumed.
Specific to the Android platform.
</constant>
- <constant name="NOTIFICATION_APP_PAUSED" value="2015">
- Notification received from the OS when the app is paused.
+ <constant name="NOTIFICATION_APPLICATION_PAUSED" value="2015">
+ Notification received from the OS when the application is paused.
Specific to the Android platform.
</constant>
+ <constant name="NOTIFICATION_APPLICATION_FOCUS_IN" value="2016">
+ Notification received from the OS when the application is focused, i.e. when changing the focus from the OS desktop or a thirdparty application to any open window of the Godot instance.
+ Implemented on desktop platforms.
+ </constant>
+ <constant name="NOTIFICATION_APPLICATION_FOCUS_OUT" value="2017">
+ Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
+ Implemented on desktop platforms.
+ </constant>
<constant name="PAUSE_MODE_INHERIT" value="0" enum="PauseMode">
Inherits pause mode from the node's parent. For the root node, it is equivalent to [constant PAUSE_MODE_STOP]. Default.
</constant>
diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml
index 9f017e9aed..eed0ec8d7e 100644
--- a/doc/classes/Node2D.xml
+++ b/doc/classes/Node2D.xml
@@ -7,7 +7,8 @@
A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
+ <link title="Custom drawing in 2D">https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
+ <link title="All 2D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/2d</link>
</tutorials>
<methods>
<method name="apply_scale">
@@ -92,7 +93,7 @@
<argument index="0" name="local_point" type="Vector2">
</argument>
<description>
- Converts a local point's coordinates to global coordinates.
+ Transforms the provided local position into a position in global coordinate space. The input is expected to be local relative to the [Node2D] it is called on. e.g. Applying this method to the positions of child nodes will correctly transform their positions into the global coordinate space, but applying it to a node's own position will give an incorrect result, as it will incorporate the node's own transformation into its global position.
</description>
</method>
<method name="to_local" qualifiers="const">
@@ -101,7 +102,7 @@
<argument index="0" name="global_point" type="Vector2">
</argument>
<description>
- Converts a global point's coordinates to local coordinates.
+ Transforms the provided global position into a position in local coordinate space. The output will be local relative to the [Node2D] it is called on. e.g. It is appropriate for determining the positions of child nodes, but it is not appropriate for determining its own position relative to its parent.
</description>
</method>
<method name="translate">
@@ -142,6 +143,10 @@
<member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2( 1, 1 )">
The node's scale. Unscaled value: [code](1, 1)[/code].
</member>
+ <member name="skew" type="float" setter="set_skew" getter="get_skew" default="0.0">
+ </member>
+ <member name="skew_degrees" type="float" setter="set_skew_degrees" getter="get_skew_degrees" default="0.0">
+ </member>
<member name="transform" type="Transform2D" setter="set_transform" getter="get_transform">
Local [Transform2D].
</member>
diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml
index 3e7d4d4c05..f6ff514474 100644
--- a/doc/classes/Node3D.xml
+++ b/doc/classes/Node3D.xml
@@ -9,7 +9,8 @@
[b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GDScript.deg2rad].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/introduction_to_3d.html</link>
+ <link title="Introduction to 3D">https://docs.godotengine.org/en/latest/tutorials/3d/introduction_to_3d.html</link>
+ <link title="All 3D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/3d</link>
</tutorials>
<methods>
<method name="force_update_transform">
@@ -26,7 +27,7 @@
Returns the parent [Node3D], or an empty [Object] if no parent exists or parent is not of type [Node3D].
</description>
</method>
- <method name="get_world" qualifiers="const">
+ <method name="get_world_3d" qualifiers="const">
<return type="World3D">
</return>
<description>
@@ -83,13 +84,6 @@
Returns whether this node uses a scale of [code](1, 1, 1)[/code] or its local transformation scale.
</description>
</method>
- <method name="is_set_as_toplevel" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Returns whether this node is set as Toplevel, that is whether it ignores its parent nodes transformations.
- </description>
- </method>
<method name="is_transform_notification_enabled" qualifiers="const">
<return type="bool">
</return>
@@ -101,7 +95,7 @@
<return type="bool">
</return>
<description>
- Returns whether the node is visible, taking into consideration that its parents visibility.
+ Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree.
</description>
</method>
<method name="look_at">
@@ -195,15 +189,6 @@
Scales the local transformation by given 3D scale factors in object-local coordinate system.
</description>
</method>
- <method name="set_as_toplevel">
- <return type="void">
- </return>
- <argument index="0" name="enable" type="bool">
- </argument>
- <description>
- Makes the node ignore its parents transformations. Node transformations are only in global space.
- </description>
- </method>
<method name="set_disable_scale">
<return type="void">
</return>
@@ -316,6 +301,9 @@
<member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3( 1, 1, 1 )">
Scale part of the local transformation.
</member>
+ <member name="top_level" type="bool" setter="set_as_top_level" getter="is_set_as_top_level" default="false">
+ If [code]true[/code], the node will not inherit its transformations from its parent. Node transformations are only in global space.
+ </member>
<member name="transform" type="Transform" setter="set_transform" getter="get_transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
Local space [Transform] of this node, with respect to the parent node.
</member>
@@ -323,7 +311,7 @@
Local translation of this node.
</member>
<member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true">
- If [code]true[/code], this node is drawn.
+ If [code]true[/code], this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]).
</member>
</members>
<signals>
diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml
index dc7fd1be3f..36835d9e94 100644
--- a/doc/classes/NodePath.xml
+++ b/doc/classes/NodePath.xml
@@ -22,9 +22,26 @@
[/codeblock]
</description>
<tutorials>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
</tutorials>
<methods>
- <method name="NodePath">
+ <method name="NodePath" qualifiers="constructor">
+ <return type="NodePath">
+ </return>
+ <description>
+ Constructs an empty [NodePath].
+ </description>
+ </method>
+ <method name="NodePath" qualifiers="constructor">
+ <return type="NodePath">
+ </return>
+ <argument index="0" name="from" type="NodePath">
+ </argument>
+ <description>
+ Constructs a [NodePath] as a copy of the given [NodePath].
+ </description>
+ </method>
+ <method name="NodePath" qualifiers="constructor">
<return type="NodePath">
</return>
<argument index="0" name="from" type="String">
@@ -34,7 +51,7 @@
The "subnames" optionally included after the path to the target node can point to resources or properties, and can also be nested.
Examples of valid NodePaths (assuming that those nodes exist and have the referenced resources or properties):
[codeblock]
- # Points to the Sprite2D node
+ # Points to the Sprite2D node.
"Path2D/PathFollow2D/Sprite2D"
# Points to the Sprite2D node and its "texture" resource.
# get_node() would retrieve "Sprite2D", while get_node_and_resource()
@@ -53,40 +70,63 @@
<return type="NodePath">
</return>
<description>
- Returns a node path with a colon character ([code]:[/code]) prepended, transforming it to a pure property path with no node name (defaults to resolving from the current node).
- [codeblock]
- # This will be parsed as a node path to the "x" property in the "position" node
+ Returns a node path with a colon character ([code]:[/code]) prepended, transforming it to a pure property path with no node name (defaults to resolving from the from the current node).
+ [codeblocks]
+ [gdscript]
+ # This will be parsed as a node path to the "x" property in the "position" node.
var node_path = NodePath("position:x")
- # This will be parsed as a node path to the "x" component of the "position" property in the current node
+ # This will be parsed as a node path to the "x" component of the "position" property in the current node.
var property_path = node_path.get_as_property_path()
print(property_path) # :position:x
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // This will be parsed as a node path to the "x" property in the "position" node.
+ var nodePath = new NodePath("position:x");
+ // This will be parsed as a node path to the "x" component of the "position" property in the current node.
+ NodePath propertyPath = nodePath.GetAsPropertyPath();
+ GD.Print(propertyPath); // :position:x
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_concatenated_subnames">
- <return type="String">
+ <return type="StringName">
</return>
<description>
Returns all subnames concatenated with a colon character ([code]:[/code]) as separator, i.e. the right side of the first colon in a node path.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var nodepath = NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path")
print(nodepath.get_concatenated_subnames()) # texture:load_path
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var nodepath = new NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path");
+ GD.Print(nodepath.GetConcatenatedSubnames()); // texture:load_path
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_name">
- <return type="String">
+ <return type="StringName">
</return>
<argument index="0" name="idx" type="int">
</argument>
<description>
Gets the node name indicated by [code]idx[/code] (0 to [method get_name_count]).
- [codeblock]
+ [codeblocks]
+ [gdscript]
var node_path = NodePath("Path2D/PathFollow2D/Sprite2D")
print(node_path.get_name(0)) # Path2D
print(node_path.get_name(1)) # PathFollow2D
print(node_path.get_name(2)) # Sprite
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var nodePath = new NodePath("Path2D/PathFollow2D/Sprite2D");
+ GD.Print(nodePath.GetName(0)); // Path2D
+ GD.Print(nodePath.GetName(1)); // PathFollow2D
+ GD.Print(nodePath.GetName(2)); // Sprite
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_name_count">
@@ -98,17 +138,24 @@
</description>
</method>
<method name="get_subname">
- <return type="String">
+ <return type="StringName">
</return>
<argument index="0" name="idx" type="int">
</argument>
<description>
Gets the resource or property name indicated by [code]idx[/code] (0 to [method get_subname_count]).
- [codeblock]
+ [codeblocks]
+ [gdscript]
var node_path = NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path")
print(node_path.get_subname(0)) # texture
print(node_path.get_subname(1)) # load_path
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var nodePath = new NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path");
+ GD.Print(nodePath.GetSubname(0)); // texture
+ GD.Print(nodePath.GetSubname(1)); // load_path
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_subname_count">
@@ -133,6 +180,22 @@
Returns [code]true[/code] if the node path is empty.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="NodePath">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="NodePath">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index db79ee7765..1d80695798 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -7,6 +7,7 @@
Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, date and time, timers, environment variables, execution of binaries, command line, etc.
</description>
<tutorials>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
<method name="can_use_threads" qualifiers="const">
@@ -84,18 +85,36 @@
If [code]blocking[/code] is [code]false[/code], the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so [code]output[/code] will be empty.
The return value also depends on the blocking mode. When blocking, the method will return an exit code of the process. When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). If the process forking (non-blocking) or opening (blocking) fails, the method will return [code]-1[/code] or another exit code.
Example of blocking mode and retrieving the shell output:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var output = []
var exit_code = OS.execute("ls", ["-l", "/tmp"], true, output)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var output = new Godot.Collections.Array();
+ int exitCode = OS.Execute("ls", new string[] {"-l", "/tmp"}, true, output);
+ [/csharp]
+ [/codeblocks]
Example of non-blocking mode, running another instance of the project and storing its process ID:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var pid = OS.execute(OS.get_executable_path(), [], false)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var pid = OS.Execute(OS.GetExecutablePath(), new string[] {}, false);
+ [/csharp]
+ [/codeblocks]
If you wish to access a shell built-in or perform a composite command, a platform-specific shell can be invoked. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
+ var output = []
OS.execute("CMD.exe", ["/C", "cd %TEMP% &amp;&amp; dir"], true, output)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var output = new Godot.Collections.Array();
+ OS.Execute("CMD.exe", new string[] {"/C", "cd %TEMP% &amp;&amp; dir"}, true, output);
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
</description>
</method>
@@ -112,7 +131,31 @@
<return type="PackedStringArray">
</return>
<description>
- Returns the command line arguments passed to the engine.
+ Returns the command-line arguments passed to the engine.
+ Command-line arguments can be written in any form, including both [code]--key value[/code] and [code]--key=value[/code] forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments.
+ You can also incorporate environment variables using the [method get_environment] method.
+ You can set [code]editor/main_run_args[/code] in the Project Settings to define command-line arguments to be passed by the editor when running the project.
+ Here's a minimal example on how to parse command-line arguments into a dictionary using the [code]--key=value[/code] form for arguments:
+ [codeblocks]
+ [gdscript]
+ var arguments = {}
+ for argument in OS.get_cmdline_args():
+ if argument.find("=") &gt; -1:
+ var key_value = argument.split("=")
+ arguments[key_value[0].lstrip("--")] = key_value[1]
+ [/gdscript]
+ [csharp]
+ var arguments = new Godot.Collections.Dictionary();
+ foreach (var argument in OS.GetCmdlineArgs())
+ {
+ if (argument.Find("=") &gt; -1)
+ {
+ string[] keyValue = argument.Split("=");
+ arguments[keyValue[0].LStrip("--")] = keyValue[1];
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_connected_midi_inputs">
@@ -205,7 +248,7 @@
<return type="String">
</return>
<description>
- Returns the name of the host OS. Possible values are: [code]"Android"[/code], [code]"Haiku"[/code], [code]"iOS"[/code], [code]"HTML5"[/code], [code]"OSX"[/code], [code]"Server"[/code], [code]"Windows"[/code], [code]"UWP"[/code], [code]"X11"[/code].
+ Returns the name of the host OS. Possible values are: [code]"Android"[/code], [code]"iOS"[/code], [code]"HTML5"[/code], [code]"OSX"[/code], [code]"Server"[/code], [code]"Windows"[/code], [code]"UWP"[/code], [code]"X11"[/code].
</description>
</method>
<method name="get_process_id" qualifiers="const">
@@ -223,13 +266,6 @@
Returns the number of threads available on the host machine.
</description>
</method>
- <method name="get_splash_tick_msec" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the amount of time in milliseconds it took for the boot logo to appear.
- </description>
- </method>
<method name="get_static_memory_peak_usage" qualifiers="const">
<return type="int">
</return>
@@ -254,18 +290,22 @@
[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows.
</description>
</method>
- <method name="get_system_time_msecs" qualifiers="const">
+ <method name="get_tablet_driver_count" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the epoch time of the operating system in milliseconds.
+ Returns the total number of available tablet drivers.
+ [b]Note:[/b] This method is implemented on Windows.
</description>
</method>
- <method name="get_system_time_secs" qualifiers="const">
- <return type="int">
+ <method name="get_tablet_driver_name" qualifiers="const">
+ <return type="String">
</return>
+ <argument index="0" name="idx" type="int">
+ </argument>
<description>
- Returns the epoch time of the operating system in seconds.
+ Returns the tablet driver name for the given index.
+ [b]Note:[/b] This method is implemented on Windows.
</description>
</method>
<method name="get_ticks_msec" qualifiers="const">
@@ -307,7 +347,7 @@
</description>
</method>
<method name="get_unix_time" qualifiers="const">
- <return type="int">
+ <return type="float">
</return>
<description>
Returns the current UNIX epoch timestamp.
@@ -484,6 +524,7 @@
- [code]OS.shell_open("C:\\Users\name\Downloads")[/code] on Windows opens the file explorer at the user's Downloads folder.
- [code]OS.shell_open("https://godotengine.org")[/code] opens the default web browser on the official Godot website.
- [code]OS.shell_open("mailto:example@example.com")[/code] opens the default email client with the "To" field set to [code]example@example.com[/code]. See [url=https://blog.escapecreative.com/customizing-mailto-links/]Customizing [code]mailto:[/code] Links[/url] for a list of fields that can be added.
+ Use [method ProjectSettings.globalize_path] to convert a [code]res://[/code] or [code]user://[/code] path into a system path for use with this method.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows.
</description>
</method>
@@ -499,6 +540,9 @@
<member name="low_processor_usage_mode_sleep_usec" type="int" setter="set_low_processor_usage_mode_sleep_usec" getter="get_low_processor_usage_mode_sleep_usec" default="6900">
The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage.
</member>
+ <member name="tablet_driver" type="String" setter="set_current_tablet_driver" getter="get_current_tablet_driver" default="&quot;&quot;">
+ The current tablet driver in use.
+ </member>
</members>
<constants>
<constant name="VIDEO_DRIVER_GLES2" value="0" enum="VideoDriver">
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml
index 35e87d1a2a..50d91c7943 100644
--- a/doc/classes/Object.xml
+++ b/doc/classes/Object.xml
@@ -15,9 +15,12 @@
print("position" in n) # Prints "True".
print("other_property" in n) # Prints "False".
[/codeblock]
+ The [code]in[/code] operator will evaluate to [code]true[/code] as long as the key exists, even if the value is [code]null[/code].
Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification].
+ [b]Note:[/b] Unlike references to a [Reference], references to an Object stored in a variable can become invalid without warning. Therefore, it's recommended to use [Reference] for data classes instead of [Object].
</description>
<tutorials>
+ <link title="When and how to avoid using nodes for everything">https://docs.godotengine.org/en/latest/getting_started/workflow/best_practices/node_alternatives.html</link>
</tutorials>
<methods>
<method name="_get" qualifiers="virtual">
@@ -96,6 +99,7 @@
[codeblock]
call("set", "position", Vector2(42.0, 0.0))
[/codeblock]
+ [b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).
</description>
</method>
<method name="call_deferred" qualifiers="vararg">
@@ -108,6 +112,7 @@
[codeblock]
call_deferred("set", "position", Vector2(42.0, 0.0))
[/codeblock]
+ [b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).
</description>
</method>
<method name="callv">
@@ -192,7 +197,7 @@
<return type="void">
</return>
<description>
- Deletes the object from memory. Any pre-existing reference to the freed object will now return [code]null[/code].
+ Deletes the object from memory. Any pre-existing reference to the freed object will become invalid, e.g. [code]is_instance_valid(object)[/code] will return [code]false[/code].
</description>
</method>
<method name="get" qualifiers="const">
@@ -202,6 +207,7 @@
</argument>
<description>
Returns the [Variant] value of the given [code]property[/code]. If the [code]property[/code] doesn't exist, this will return [code]null[/code].
+ [b]Note:[/b] In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).
</description>
</method>
<method name="get_class" qualifiers="const">
@@ -389,7 +395,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
- Removes a given entry from the object's metadata.
+ Removes a given entry from the object's metadata. See also [method set_meta].
</description>
</method>
<method name="set">
@@ -401,6 +407,7 @@
</argument>
<description>
Assigns a new value to the given property. If the [code]property[/code] does not exist, nothing will happen.
+ [b]Note:[/b] In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).
</description>
</method>
<method name="set_block_signals">
@@ -421,6 +428,7 @@
</argument>
<description>
Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling [method set] via [method call_deferred], i.e. [code]call_deferred("set", property, value)[/code].
+ [b]Note:[/b] In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).
</description>
</method>
<method name="set_indexed">
@@ -456,7 +464,8 @@
<argument index="1" name="value" type="Variant">
</argument>
<description>
- Adds or changes a given entry in the object's metadata. Metadata are serialized, and can take any [Variant] value.
+ Adds, changes or removes a given entry in the object's metadata. Metadata are serialized and can take any [Variant] value.
+ To remove a given entry from the object's metadata, use [method remove_meta]. Metadata is also removed if its value is set to [code]null[/code]. This means you can also use [code]set_meta("name", null)[/code] to remove metadata for [code]"name"[/code].
</description>
</method>
<method name="set_script">
@@ -478,13 +487,35 @@
</description>
</method>
<method name="tr" qualifiers="const">
- <return type="StringName">
+ <return type="String">
</return>
<argument index="0" name="message" type="StringName">
</argument>
+ <argument index="1" name="context" type="StringName" default="&quot;&quot;">
+ </argument>
<description>
- Translates a message using translation catalogs configured in the Project Settings.
+ Translates a message using translation catalogs configured in the Project Settings. An additional context could be used to specify the translation context.
Only works if message translation is enabled (which it is by default), otherwise it returns the [code]message[/code] unchanged. See [method set_message_translation].
+ See [url=https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url] for examples of the usage of this method.
+ </description>
+ </method>
+ <method name="tr_n" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="message" type="StringName">
+ </argument>
+ <argument index="1" name="plural_message" type="StringName">
+ </argument>
+ <argument index="2" name="n" type="int">
+ </argument>
+ <argument index="3" name="context" type="StringName" default="&quot;&quot;">
+ </argument>
+ <description>
+ Translates a message involving plurals using translation catalogs configured in the Project Settings. An additional context could be used to specify the translation context.
+ Only works if message translation is enabled (which it is by default), otherwise it returns the [code]message[/code] or [code]plural_message[/code] unchanged. See [method set_message_translation].
+ The number [code]n[/code] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language.
+ [b]Note:[/b] Negative and floating-point values usually represent physical entities for which singular and plural don't clearly apply. In such cases, use [method tr].
+ See [url=https://docs.godotengine.org/en/latest/tutorials/i18n/localization_using_gettext.html]Localization using gettext[/url] for examples of the usage of this method.
</description>
</method>
</methods>
@@ -512,7 +543,7 @@
One-shot connections disconnect themselves after emission.
</constant>
<constant name="CONNECT_REFERENCE_COUNTED" value="8" enum="ConnectFlags">
- Connect a signal as reference counted. This means that a given signal can be connected several times to the same target, and will only be fully disconnected once no references are left.
+ Connect a signal as reference-counted. This means that a given signal can be connected several times to the same target, and will only be fully disconnected once no references are left.
</constant>
</constants>
</class>
diff --git a/doc/classes/OmniLight3D.xml b/doc/classes/OmniLight3D.xml
index 0bbc987156..dfcb19a287 100644
--- a/doc/classes/OmniLight3D.xml
+++ b/doc/classes/OmniLight3D.xml
@@ -7,7 +7,7 @@
An Omnidirectional light is a type of [Light3D] that emits light in all directions. The light is attenuated by distance and this attenuation can be configured by changing its energy, radius, and attenuation parameters.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
+ <link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
</tutorials>
<methods>
</methods>
@@ -16,7 +16,7 @@
The light's attenuation (drop-off) curve. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve.
</member>
<member name="omni_range" type="float" setter="set_param" getter="get_param" default="5.0">
- The light's radius.
+ The light's radius. Note that the effectively lit area may appear to be smaller depending on the [member omni_attenuation] in use. No matter the [member omni_attenuation] in use, the light will never reach anything outside this radius.
</member>
<member name="omni_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" enum="OmniLight3D.ShadowMode" default="1">
See [enum ShadowMode].
diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml
index 39d974ec47..510f952fea 100644
--- a/doc/classes/OptionButton.xml
+++ b/doc/classes/OptionButton.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
</tutorials>
@@ -217,7 +218,7 @@
<argument index="0" name="index" type="int">
</argument>
<description>
- Emitted the when user navigates to an item using the [code]ui_up[/code] or [code]ui_down[/code] actions. The index of the item selected is passed as argument.
+ Emitted when the user navigates to an item using the [code]ui_up[/code] or [code]ui_down[/code] actions. The index of the item selected is passed as argument.
</description>
</signal>
<signal name="item_selected">
diff --git a/doc/classes/PCKPacker.xml b/doc/classes/PCKPacker.xml
index 314869be49..e3c78e08f1 100644
--- a/doc/classes/PCKPacker.xml
+++ b/doc/classes/PCKPacker.xml
@@ -5,12 +5,20 @@
</brief_description>
<description>
The [PCKPacker] is used to create packages that can be loaded into a running project using [method ProjectSettings.load_resource_pack].
- [codeblock]
+ [codeblocks]
+ [gdscript]
var packer = PCKPacker.new()
packer.pck_start("test.pck")
packer.add_file("res://text.txt", "text.txt")
packer.flush()
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var packer = new PCKPacker();
+ packer.PckStart("test.pck");
+ packer.AddFile("res://text.txt", "text.txt");
+ packer.Flush();
+ [/csharp]
+ [/codeblocks]
The above [PCKPacker] creates package [code]test.pck[/code], then adds a file named [code]text.txt[/code] at the root of the package.
</description>
<tutorials>
@@ -23,6 +31,8 @@
</argument>
<argument index="1" name="source_path" type="String">
</argument>
+ <argument index="2" name="encrypt" type="bool" default="false">
+ </argument>
<description>
Adds the [code]source_path[/code] file to the current PCK package at the [code]pck_path[/code] internal path (should start with [code]res://[/code]).
</description>
@@ -43,6 +53,10 @@
</argument>
<argument index="1" name="alignment" type="int" default="0">
</argument>
+ <argument index="2" name="key" type="String" default="&quot;&quot;">
+ </argument>
+ <argument index="3" name="encrypt_directory" type="bool" default="false">
+ </argument>
<description>
Creates a new PCK file with the name [code]pck_name[/code]. The [code].pck[/code] file extension isn't added automatically, so it should be part of [code]pck_name[/code] (even though it's not required).
</description>
diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml
index b08357e278..91d066260b 100644
--- a/doc/classes/PackedByteArray.xml
+++ b/doc/classes/PackedByteArray.xml
@@ -10,7 +10,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedByteArray">
+ <method name="PackedByteArray" qualifiers="constructor">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ Constructs an empty [PackedByteArray].
+ </description>
+ </method>
+ <method name="PackedByteArray" qualifiers="constructor">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="from" type="PackedByteArray">
+ </argument>
+ <description>
+ Constructs a [PackedByteArray] as a copy of the given [PackedByteArray].
+ </description>
+ </method>
+ <method name="PackedByteArray" qualifiers="constructor">
<return type="PackedByteArray">
</return>
<argument index="0" name="from" type="Array">
@@ -20,9 +36,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="byte" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -57,6 +73,19 @@
Returns a new [PackedByteArray] with the data decompressed. Set [code]buffer_size[/code] to the size of the uncompressed data. Set the compression mode using one of [enum File.CompressionMode]'s constants.
</description>
</method>
+ <method name="decompress_dynamic">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="max_output_size" type="int">
+ </argument>
+ <argument index="1" name="compression_mode" type="int" default="0">
+ </argument>
+ <description>
+ Returns a new [PackedByteArray] with the data decompressed. Set the compression mode using one of [enum File.CompressionMode]'s constants. [b]This method only accepts gzip and deflate compression modes.[/b]
+ This method is potentially slower than [code]decompress[/code], as it may have to re-allocate it's output buffer multiple times while decompressing, where as [code]decompress[/code] knows it's output buffer size from the beginning.
+ GZIP has a maximal compression ratio of 1032:1, meaning it's very possible for a small compressed payload to decompress to a potentially very large output. To guard against this, you may provide a maximum size this function is allowed to allocate in bytes via [code]max_output_size[/code]. Passing -1 will allow for unbounded output. If any positive value is passed, and the decompression exceeds that amount in bytes, then an error will be returned.
+ </description>
+ </method>
<method name="empty">
<return type="bool">
</return>
@@ -68,14 +97,37 @@
<return type="String">
</return>
<description>
- Returns a copy of the array's contents as [String]. Fast alternative to [method get_string_from_utf8] if the content is ASCII-only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method get_string_from_utf8].
+ Converts ASCII/Latin-1 encoded array to [String]. Fast alternative to [method get_string_from_utf8] if the content is ASCII/Latin-1 only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method get_string_from_utf8].
+ </description>
+ </method>
+ <method name="get_string_from_utf16">
+ <return type="String">
+ </return>
+ <description>
+ Converts UTF-16 encoded array to [String]. If the BOM is missing, system endianness is assumed. Returns empty string if source array is not valid UTF-16 string.
+ </description>
+ </method>
+ <method name="get_string_from_utf32">
+ <return type="String">
+ </return>
+ <description>
+ Converts UTF-32 encoded array to [String]. System endianness is assumed. Returns empty string if source array is not valid UTF-32 string.
</description>
</method>
<method name="get_string_from_utf8">
<return type="String">
</return>
<description>
- Returns a copy of the array's contents as [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred.
+ Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not valid UTF-8 string.
+ </description>
+ </method>
+ <method name="has">
+ <return type="bool">
+ </return>
+ <argument index="0" name="value" type="int">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the array contains [code]value[/code].
</description>
</method>
<method name="hex_encode">
@@ -83,18 +135,24 @@
</return>
<description>
Returns a hexadecimal representation of this array as a [String].
- [codeblock]
+ [codeblocks]
+ [gdscript]
var array = PackedByteArray([11, 46, 255])
print(array.hex_encode()) # Prints: 0b2eff
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var array = new byte[] {11, 46, 255};
+ GD.Print(array.HexEncode()); // Prints: 0b2eff
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="byte" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
@@ -107,10 +165,42 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedByteArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="right" type="PackedByteArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedByteArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="byte" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends an element at the end of the array.
@@ -119,16 +209,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -137,9 +227,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="byte" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Changes the byte at the given index.
@@ -152,6 +242,13 @@
Returns the size of the array.
</description>
</method>
+ <method name="sort">
+ <return type="void">
+ </return>
+ <description>
+ Sorts the elements of the array in ascending order.
+ </description>
+ </method>
<method name="subarray">
<return type="PackedByteArray">
</return>
diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml
index 06228e4dac..3065d16945 100644
--- a/doc/classes/PackedColorArray.xml
+++ b/doc/classes/PackedColorArray.xml
@@ -10,7 +10,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedColorArray">
+ <method name="PackedColorArray" qualifiers="constructor">
+ <return type="PackedColorArray">
+ </return>
+ <description>
+ Constructs an empty [PackedColorArray].
+ </description>
+ </method>
+ <method name="PackedColorArray" qualifiers="constructor">
+ <return type="PackedColorArray">
+ </return>
+ <argument index="0" name="from" type="PackedColorArray">
+ </argument>
+ <description>
+ Constructs a [PackedColorArray] as a copy of the given [PackedColorArray].
+ </description>
+ </method>
+ <method name="PackedColorArray" qualifiers="constructor">
<return type="PackedColorArray">
</return>
<argument index="0" name="from" type="Array">
@@ -20,9 +36,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="color" type="Color">
+ <argument index="0" name="value" type="Color">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -44,12 +60,21 @@
Returns [code]true[/code] if the array is empty.
</description>
</method>
+ <method name="has">
+ <return type="bool">
+ </return>
+ <argument index="0" name="value" type="Color">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the array contains [code]value[/code].
+ </description>
+ </method>
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="color" type="Color">
+ <argument index="1" name="value" type="Color">
</argument>
<description>
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
@@ -62,10 +87,42 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedColorArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedColorArray">
+ </return>
+ <argument index="0" name="right" type="PackedColorArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedColorArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="color" type="Color">
+ <argument index="0" name="value" type="Color">
</argument>
<description>
Appends a value to the array.
@@ -74,16 +131,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -92,9 +149,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="color" type="Color">
+ <argument index="1" name="value" type="Color">
</argument>
<description>
Changes the [Color] at the given index.
@@ -107,6 +164,29 @@
Returns the size of the array.
</description>
</method>
+ <method name="sort">
+ <return type="void">
+ </return>
+ <description>
+ Sorts the elements of the array in ascending order.
+ </description>
+ </method>
+ <method name="subarray">
+ <return type="PackedColorArray">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml
index ee82586cdb..ab9594d2e3 100644
--- a/doc/classes/PackedFloat32Array.xml
+++ b/doc/classes/PackedFloat32Array.xml
@@ -11,7 +11,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedFloat32Array">
+ <method name="PackedFloat32Array" qualifiers="constructor">
+ <return type="PackedFloat32Array">
+ </return>
+ <description>
+ Constructs an empty [PackedFloat32Array].
+ </description>
+ </method>
+ <method name="PackedFloat32Array" qualifiers="constructor">
+ <return type="PackedFloat32Array">
+ </return>
+ <argument index="0" name="from" type="PackedFloat32Array">
+ </argument>
+ <description>
+ Constructs a [PackedFloat32Array] as a copy of the given [PackedFloat32Array].
+ </description>
+ </method>
+ <method name="PackedFloat32Array" qualifiers="constructor">
<return type="PackedFloat32Array">
</return>
<argument index="0" name="from" type="Array">
@@ -21,7 +37,7 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
<argument index="0" name="value" type="float">
</argument>
@@ -45,10 +61,19 @@
Returns [code]true[/code] if the array is empty.
</description>
</method>
+ <method name="has">
+ <return type="bool">
+ </return>
+ <argument index="0" name="value" type="float">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the array contains [code]value[/code].
+ </description>
+ </method>
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
<argument index="1" name="value" type="float">
</argument>
@@ -63,8 +88,32 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedFloat32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedFloat32Array">
+ </return>
+ <argument index="0" name="right" type="PackedFloat32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedFloat32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
<argument index="0" name="value" type="float">
</argument>
@@ -75,16 +124,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -93,7 +142,7 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<argument index="1" name="value" type="float">
</argument>
@@ -108,6 +157,29 @@
Returns the size of the array.
</description>
</method>
+ <method name="sort">
+ <return type="void">
+ </return>
+ <description>
+ Sorts the elements of the array in ascending order.
+ </description>
+ </method>
+ <method name="subarray">
+ <return type="PackedFloat32Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml
index ce2300c65a..3088aee483 100644
--- a/doc/classes/PackedFloat64Array.xml
+++ b/doc/classes/PackedFloat64Array.xml
@@ -11,7 +11,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedFloat64Array">
+ <method name="PackedFloat64Array" qualifiers="constructor">
+ <return type="PackedFloat64Array">
+ </return>
+ <description>
+ Constructs an empty [PackedFloat64Array].
+ </description>
+ </method>
+ <method name="PackedFloat64Array" qualifiers="constructor">
+ <return type="PackedFloat64Array">
+ </return>
+ <argument index="0" name="from" type="PackedFloat64Array">
+ </argument>
+ <description>
+ Constructs a [PackedFloat64Array] as a copy of the given [PackedFloat64Array].
+ </description>
+ </method>
+ <method name="PackedFloat64Array" qualifiers="constructor">
<return type="PackedFloat64Array">
</return>
<argument index="0" name="from" type="Array">
@@ -21,7 +37,7 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
<argument index="0" name="value" type="float">
</argument>
@@ -45,10 +61,19 @@
Returns [code]true[/code] if the array is empty.
</description>
</method>
+ <method name="has">
+ <return type="bool">
+ </return>
+ <argument index="0" name="value" type="float">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the array contains [code]value[/code].
+ </description>
+ </method>
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
<argument index="1" name="value" type="float">
</argument>
@@ -63,8 +88,40 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedFloat64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedFloat64Array">
+ </return>
+ <argument index="0" name="right" type="PackedFloat64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedFloat64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
<argument index="0" name="value" type="float">
</argument>
@@ -75,16 +132,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -93,7 +150,7 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<argument index="1" name="value" type="float">
</argument>
@@ -108,6 +165,29 @@
Returns the size of the array.
</description>
</method>
+ <method name="sort">
+ <return type="void">
+ </return>
+ <description>
+ Sorts the elements of the array in ascending order.
+ </description>
+ </method>
+ <method name="subarray">
+ <return type="PackedFloat64Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml
index 176c624956..eded545de8 100644
--- a/doc/classes/PackedInt32Array.xml
+++ b/doc/classes/PackedInt32Array.xml
@@ -11,7 +11,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedInt32Array">
+ <method name="PackedInt32Array" qualifiers="constructor">
+ <return type="PackedInt32Array">
+ </return>
+ <description>
+ Constructs an empty [PackedInt32Array].
+ </description>
+ </method>
+ <method name="PackedInt32Array" qualifiers="constructor">
+ <return type="PackedInt32Array">
+ </return>
+ <argument index="0" name="from" type="PackedInt32Array">
+ </argument>
+ <description>
+ Constructs a [PackedInt32Array] as a copy of the given [PackedInt32Array].
+ </description>
+ </method>
+ <method name="PackedInt32Array" qualifiers="constructor">
<return type="PackedInt32Array">
</return>
<argument index="0" name="from" type="Array">
@@ -21,9 +37,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="integer" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -45,12 +61,21 @@
Returns [code]true[/code] if the array is empty.
</description>
</method>
+ <method name="has">
+ <return type="bool">
+ </return>
+ <argument index="0" name="value" type="int">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the array contains [code]value[/code].
+ </description>
+ </method>
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="integer" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
@@ -63,10 +88,42 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedInt32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedInt32Array">
+ </return>
+ <argument index="0" name="right" type="PackedInt32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedInt32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="integer" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends a value to the array.
@@ -75,16 +132,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -93,9 +150,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="integer" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Changes the integer at the given index.
@@ -108,6 +165,29 @@
Returns the array size.
</description>
</method>
+ <method name="sort">
+ <return type="void">
+ </return>
+ <description>
+ Sorts the elements of the array in ascending order.
+ </description>
+ </method>
+ <method name="subarray">
+ <return type="PackedInt32Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml
index d8a8071590..83731b1023 100644
--- a/doc/classes/PackedInt64Array.xml
+++ b/doc/classes/PackedInt64Array.xml
@@ -11,7 +11,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedInt64Array">
+ <method name="PackedInt64Array" qualifiers="constructor">
+ <return type="PackedInt64Array">
+ </return>
+ <description>
+ Constructs an empty [PackedInt64Array].
+ </description>
+ </method>
+ <method name="PackedInt64Array" qualifiers="constructor">
+ <return type="PackedInt64Array">
+ </return>
+ <argument index="0" name="from" type="PackedInt64Array">
+ </argument>
+ <description>
+ Constructs a [PackedInt64Array] as a copy of the given [PackedInt64Array].
+ </description>
+ </method>
+ <method name="PackedInt64Array" qualifiers="constructor">
<return type="PackedInt64Array">
</return>
<argument index="0" name="from" type="Array">
@@ -21,9 +37,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="integer" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -45,12 +61,21 @@
Returns [code]true[/code] if the array is empty.
</description>
</method>
+ <method name="has">
+ <return type="bool">
+ </return>
+ <argument index="0" name="value" type="int">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the array contains [code]value[/code].
+ </description>
+ </method>
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="integer" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
@@ -63,10 +88,42 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedInt64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedInt64Array">
+ </return>
+ <argument index="0" name="right" type="PackedInt64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedInt64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="integer" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends a value to the array.
@@ -75,16 +132,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -93,9 +150,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="integer" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Changes the integer at the given index.
@@ -108,6 +165,29 @@
Returns the array size.
</description>
</method>
+ <method name="sort">
+ <return type="void">
+ </return>
+ <description>
+ Sorts the elements of the array in ascending order.
+ </description>
+ </method>
+ <method name="subarray">
+ <return type="PackedInt64Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml
index 2d70dea012..d15bcfd114 100644
--- a/doc/classes/PackedScene.xml
+++ b/doc/classes/PackedScene.xml
@@ -7,8 +7,24 @@
A simplified interface to a scene file. Provides access to operations and checks that can be performed on the scene resource itself.
Can be used to save a node to a file. When saving, the node as well as all the node it owns get saved (see [code]owner[/code] property on [Node]).
[b]Note:[/b] The node doesn't need to own itself.
+ [b]Example of loading a saved scene:[/b]
+ [codeblocks]
+ [gdscript]
+ # Use load() instead of preload() if the path isn't known at compile-time.
+ var scene = preload("res://scene.tscn").instance()
+ # Add the node as a child of the node the script is attached to.
+ add_child(scene)
+ [/gdscript]
+ [csharp]
+ // C# has no preload, so you have to always use ResourceLoader.Load&lt;PackedScene&gt;().
+ var scene = ResourceLoader.Load&lt;PackedScene&gt;("res://scene.tscn").Instance();
+ // Add the node as a child of the node the script is attached to.
+ AddChild(scene);
+ [/csharp]
+ [/codeblocks]
[b]Example of saving a node with different owners:[/b] The following example creates 3 objects: [code]Node2D[/code] ([code]node[/code]), [code]RigidBody2D[/code] ([code]rigid[/code]) and [code]CollisionObject2D[/code] ([code]collision[/code]). [code]collision[/code] is a child of [code]rigid[/code] which is a child of [code]node[/code]. Only [code]rigid[/code] is owned by [code]node[/code] and [code]pack[/code] will therefore only save those two nodes, but not [code]collision[/code].
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Create the objects.
var node = Node2D.new()
var rigid = RigidBody2D.new()
@@ -20,17 +36,44 @@
# Change owner of `rigid`, but not of `collision`.
rigid.owner = node
-
var scene = PackedScene.new()
+
# Only `node` and `rigid` are now packed.
var result = scene.pack(node)
if result == OK:
- var error = ResourceSaver.save("res://path/name.scn", scene) # Or "user://..."
+ var error = ResourceSaver.save("res://path/name.tscn", scene) # Or "user://..."
if error != OK:
push_error("An error occurred while saving the scene to disk.")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // Create the objects.
+ var node = new Node2D();
+ var rigid = new RigidBody2D();
+ var collision = new CollisionShape2D();
+
+ // Create the object hierarchy.
+ rigid.AddChild(collision);
+ node.AddChild(rigid);
+
+ // Change owner of `rigid`, but not of `collision`.
+ rigid.Owner = node;
+ var scene = new PackedScene();
+
+ // Only `node` and `rigid` are now packed.
+ Error result = scene.Pack(node);
+ if (result == Error.Ok)
+ {
+ Error error = ResourceSaver.Save("res://path/name.tscn", scene); // Or "user://..."
+ if (error != Error.Ok)
+ {
+ GD.PushError("An error occurred while saving the scene to disk.");
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
</tutorials>
<methods>
<method name="can_instance" qualifiers="const">
diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml
index 9526f5899d..c71f5ffa7e 100644
--- a/doc/classes/PackedStringArray.xml
+++ b/doc/classes/PackedStringArray.xml
@@ -8,9 +8,26 @@
[b]Note:[/b] This type is passed by value and not by reference.
</description>
<tutorials>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
- <method name="PackedStringArray">
+ <method name="PackedStringArray" qualifiers="constructor">
+ <return type="PackedStringArray">
+ </return>
+ <description>
+ Constructs an empty [PackedStringArray].
+ </description>
+ </method>
+ <method name="PackedStringArray" qualifiers="constructor">
+ <return type="PackedStringArray">
+ </return>
+ <argument index="0" name="from" type="PackedStringArray">
+ </argument>
+ <description>
+ Constructs a [PackedStringArray] as a copy of the given [PackedStringArray].
+ </description>
+ </method>
+ <method name="PackedStringArray" qualifiers="constructor">
<return type="PackedStringArray">
</return>
<argument index="0" name="from" type="Array">
@@ -20,9 +37,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="string" type="String">
+ <argument index="0" name="value" type="String">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -44,12 +61,21 @@
Returns [code]true[/code] if the array is empty.
</description>
</method>
+ <method name="has">
+ <return type="bool">
+ </return>
+ <argument index="0" name="value" type="String">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the array contains [code]value[/code].
+ </description>
+ </method>
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="string" type="String">
+ <argument index="1" name="value" type="String">
</argument>
<description>
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
@@ -62,10 +88,42 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedStringArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedStringArray">
+ </return>
+ <argument index="0" name="right" type="PackedStringArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedStringArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="String">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="string" type="String">
+ <argument index="0" name="value" type="String">
</argument>
<description>
Appends a string element at end of the array.
@@ -74,16 +132,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -92,9 +150,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="string" type="String">
+ <argument index="1" name="value" type="String">
</argument>
<description>
Changes the [String] at the given index.
@@ -107,6 +165,29 @@
Returns the size of the array.
</description>
</method>
+ <method name="sort">
+ <return type="void">
+ </return>
+ <description>
+ Sorts the elements of the array in ascending order.
+ </description>
+ </method>
+ <method name="subarray">
+ <return type="PackedStringArray">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml
index 87f202357c..5f68d9256d 100644
--- a/doc/classes/PackedVector2Array.xml
+++ b/doc/classes/PackedVector2Array.xml
@@ -8,9 +8,26 @@
[b]Note:[/b] This type is passed by value and not by reference.
</description>
<tutorials>
+ <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link>
</tutorials>
<methods>
- <method name="PackedVector2Array">
+ <method name="PackedVector2Array" qualifiers="constructor">
+ <return type="PackedVector2Array">
+ </return>
+ <description>
+ Constructs an empty [PackedVector2Array].
+ </description>
+ </method>
+ <method name="PackedVector2Array" qualifiers="constructor">
+ <return type="PackedVector2Array">
+ </return>
+ <argument index="0" name="from" type="PackedVector2Array">
+ </argument>
+ <description>
+ Constructs a [PackedVector2Array] as a copy of the given [PackedVector2Array].
+ </description>
+ </method>
+ <method name="PackedVector2Array" qualifiers="constructor">
<return type="PackedVector2Array">
</return>
<argument index="0" name="from" type="Array">
@@ -20,9 +37,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="vector2" type="Vector2">
+ <argument index="0" name="value" type="Vector2">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -44,12 +61,21 @@
Returns [code]true[/code] if the array is empty.
</description>
</method>
+ <method name="has">
+ <return type="bool">
+ </return>
+ <argument index="0" name="value" type="Vector2">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the array contains [code]value[/code].
+ </description>
+ </method>
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="vector2" type="Vector2">
+ <argument index="1" name="value" type="Vector2">
</argument>
<description>
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
@@ -62,10 +88,50 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedVector2Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="PackedVector2Array">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedVector2Array">
+ </return>
+ <argument index="0" name="right" type="PackedVector2Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedVector2Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="vector2" type="Vector2">
+ <argument index="0" name="value" type="Vector2">
</argument>
<description>
Inserts a [Vector2] at the end.
@@ -74,16 +140,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -92,9 +158,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="vector2" type="Vector2">
+ <argument index="1" name="value" type="Vector2">
</argument>
<description>
Changes the [Vector2] at the given index.
@@ -107,6 +173,29 @@
Returns the size of the array.
</description>
</method>
+ <method name="sort">
+ <return type="void">
+ </return>
+ <description>
+ Sorts the elements of the array in ascending order.
+ </description>
+ </method>
+ <method name="subarray">
+ <return type="PackedVector2Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml
index 7bfa684ff5..e681e1deb7 100644
--- a/doc/classes/PackedVector3Array.xml
+++ b/doc/classes/PackedVector3Array.xml
@@ -10,7 +10,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedVector3Array">
+ <method name="PackedVector3Array" qualifiers="constructor">
+ <return type="PackedVector3Array">
+ </return>
+ <description>
+ Constructs an empty [PackedVector3Array].
+ </description>
+ </method>
+ <method name="PackedVector3Array" qualifiers="constructor">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="from" type="PackedVector3Array">
+ </argument>
+ <description>
+ Constructs a [PackedVector3Array] as a copy of the given [PackedVector3Array].
+ </description>
+ </method>
+ <method name="PackedVector3Array" qualifiers="constructor">
<return type="PackedVector3Array">
</return>
<argument index="0" name="from" type="Array">
@@ -20,9 +36,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="vector3" type="Vector3">
+ <argument index="0" name="value" type="Vector3">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -44,12 +60,21 @@
Returns [code]true[/code] if the array is empty.
</description>
</method>
+ <method name="has">
+ <return type="bool">
+ </return>
+ <argument index="0" name="value" type="Vector3">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the array contains [code]value[/code].
+ </description>
+ </method>
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="vector3" type="Vector3">
+ <argument index="1" name="value" type="Vector3">
</argument>
<description>
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
@@ -62,10 +87,50 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedVector3Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="right" type="PackedVector3Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedVector3Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="vector3" type="Vector3">
+ <argument index="0" name="value" type="Vector3">
</argument>
<description>
Inserts a [Vector3] at the end.
@@ -74,16 +139,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -92,9 +157,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="vector3" type="Vector3">
+ <argument index="1" name="value" type="Vector3">
</argument>
<description>
Changes the [Vector3] at the given index.
@@ -107,6 +172,29 @@
Returns the size of the array.
</description>
</method>
+ <method name="sort">
+ <return type="void">
+ </return>
+ <description>
+ Sorts the elements of the array in ascending order.
+ </description>
+ </method>
+ <method name="subarray">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml
index 668655b725..d7cf6cc8c6 100644
--- a/doc/classes/PacketPeerUDP.xml
+++ b/doc/classes/PacketPeerUDP.xml
@@ -25,7 +25,7 @@
</argument>
<description>
Calling this method connects this UDP peer to the given [code]host[/code]/[code]port[/code] pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to [method set_dest_address] are not allowed). This method does not send any data to the remote peer, to do that, use [method PacketPeer.put_var] or [method PacketPeer.put_packet] as usual. See also [UDPServer].
- Note: Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information.
+ [b]Note:[/b] Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information.
</description>
</method>
<method name="get_packet_ip" qualifiers="const">
@@ -123,6 +123,37 @@
</return>
<description>
Waits for a packet to arrive on the listening port. See [method listen].
+ [b]Note:[/b] [method wait] can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this:
+ [codeblocks]
+ [gdscript]
+ socket = PacketPeerUDP.new()
+ # Server
+ socket.set_dest_address("127.0.0.1", 789)
+ socket.put_packet("Time to stop".to_ascii())
+
+ # Client
+ while socket.wait() == OK:
+ var data = socket.get_packet().get_string_from_ascii()
+ if data == "Time to stop":
+ return
+ [/gdscript]
+ [csharp]
+ var socket = new PacketPeerUDP();
+ // Server
+ socket.SetDestAddress("127.0.0.1", 789);
+ socket.PutPacket("Time To Stop".ToAscii());
+
+ // Client
+ while (socket.Wait() == OK)
+ {
+ string data = socket.GetPacket().GetStringFromASCII();
+ if (data == "Time to stop")
+ {
+ return;
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
diff --git a/doc/classes/Panel.xml b/doc/classes/Panel.xml
index 7285bc9e2e..b65c2c956d 100644
--- a/doc/classes/Panel.xml
+++ b/doc/classes/Panel.xml
@@ -7,6 +7,9 @@
Panel is a [Control] that displays an opaque background. It's commonly used as a parent and container for other types of [Control] nodes.
</description>
<tutorials>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
+ <link title="2D Finite State Machine Demo">https://godotengine.org/asset-library/asset/516</link>
+ <link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/PanelContainer.xml b/doc/classes/PanelContainer.xml
index d39122c395..ad6080c780 100644
--- a/doc/classes/PanelContainer.xml
+++ b/doc/classes/PanelContainer.xml
@@ -7,6 +7,7 @@
Panel container type. This container fits controls inside of the delimited area of a stylebox. It's useful for giving controls an outline.
</description>
<tutorials>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml
index d04ac5bdce..77df6245e9 100644
--- a/doc/classes/ParticlesMaterial.xml
+++ b/doc/classes/ParticlesMaterial.xml
@@ -131,6 +131,16 @@
<member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
Animation speed randomness ratio.
</member>
+ <member name="attractor_interaction_enabled" type="bool" setter="set_attractor_interaction_enabled" getter="is_attractor_interaction_enabled" default="true">
+ </member>
+ <member name="collision_bounce" type="float" setter="set_collision_bounce" getter="get_collision_bounce" default="0.0">
+ </member>
+ <member name="collision_enabled" type="bool" setter="set_collision_enabled" getter="is_collision_enabled" default="true">
+ </member>
+ <member name="collision_friction" type="float" setter="set_collision_friction" getter="get_collision_friction" default="0.0">
+ </member>
+ <member name="collision_use_scale" type="bool" setter="set_collision_use_scale" getter="is_collision_using_scale" default="false">
+ </member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
Each particle's initial color. If the [GPUParticles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [BaseMaterial3D] make sure to set [member BaseMaterial3D.vertex_color_use_as_albedo] to [code]true[/code].
</member>
@@ -243,6 +253,14 @@
<member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0">
Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Applied to X/Z plane and Y/Z planes.
</member>
+ <member name="sub_emitter_amount_at_end" type="int" setter="set_sub_emitter_amount_at_end" getter="get_sub_emitter_amount_at_end">
+ </member>
+ <member name="sub_emitter_frequency" type="float" setter="set_sub_emitter_frequency" getter="get_sub_emitter_frequency">
+ </member>
+ <member name="sub_emitter_keep_velocity" type="bool" setter="set_sub_emitter_keep_velocity" getter="get_sub_emitter_keep_velocity" default="false">
+ </member>
+ <member name="sub_emitter_mode" type="int" setter="set_sub_emitter_mode" getter="get_sub_emitter_mode" enum="ParticlesMaterial.SubEmitterMode" default="0">
+ </member>
<member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0">
Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
</member>
@@ -252,15 +270,6 @@
<member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
Tangential acceleration randomness ratio.
</member>
- <member name="trail_color_modifier" type="GradientTexture" setter="set_trail_color_modifier" getter="get_trail_color_modifier">
- Trail particles' color will vary along this [GradientTexture].
- </member>
- <member name="trail_divisor" type="int" setter="set_trail_divisor" getter="get_trail_divisor" default="1">
- Emitter will emit [code]amount[/code] divided by [code]trail_divisor[/code] particles. The remaining particles will be used as trail(s).
- </member>
- <member name="trail_size_modifier" type="CurveTexture" setter="set_trail_size_modifier" getter="get_trail_size_modifier">
- Trail particles' size will vary along this [CurveTexture].
- </member>
</members>
<constants>
<constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter">
@@ -332,5 +341,15 @@
<constant name="EMISSION_SHAPE_MAX" value="5" enum="EmissionShape">
Represents the size of the [enum EmissionShape] enum.
</constant>
+ <constant name="SUB_EMITTER_DISABLED" value="0" enum="SubEmitterMode">
+ </constant>
+ <constant name="SUB_EMITTER_CONSTANT" value="1" enum="SubEmitterMode">
+ </constant>
+ <constant name="SUB_EMITTER_AT_END" value="2" enum="SubEmitterMode">
+ </constant>
+ <constant name="SUB_EMITTER_AT_COLLISION" value="3" enum="SubEmitterMode">
+ </constant>
+ <constant name="SUB_EMITTER_MAX" value="4" enum="SubEmitterMode">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Path2D.xml b/doc/classes/Path2D.xml
index ab266a2f73..57e2091268 100644
--- a/doc/classes/Path2D.xml
+++ b/doc/classes/Path2D.xml
@@ -15,7 +15,6 @@
<member name="curve" type="Curve2D" setter="set_curve" getter="get_curve">
A [Curve2D] describing the path.
</member>
- <member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate" override="true" default="Color( 0.5, 0.6, 1, 0.7 )" />
</members>
<constants>
</constants>
diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml
index 2a0c153267..9e9c5063ae 100644
--- a/doc/classes/Performance.xml
+++ b/doc/classes/Performance.xml
@@ -5,12 +5,94 @@
</brief_description>
<description>
This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the [b]Monitor[/b] tab in the editor's [b]Debugger[/b] panel. By using the [method get_monitor] method of this class, you can access this data from your code.
+ You can add custom monitors using the [method add_custom_monitor] method. Custom monitors are available in [b]Monitor[/b] tab in the editor's [b]Debugger[/b] panel together with built-in monitors.
[b]Note:[/b] A few of these monitors are only available in debug mode and will always return 0 when used in a release build.
[b]Note:[/b] Many of these monitors are not updated in real-time, so there may be a short delay between changes.
+ [b]Note:[/b] Custom monitors do not support negative values. Negative values are clamped to 0.
</description>
<tutorials>
</tutorials>
<methods>
+ <method name="add_custom_monitor">
+ <return type="void">
+ </return>
+ <argument index="0" name="id" type="StringName">
+ </argument>
+ <argument index="1" name="callable" type="Callable">
+ </argument>
+ <argument index="2" name="arguments" type="Array" default="[ ]">
+ </argument>
+ <description>
+ Adds a custom monitor with name same as id. You can specify the category of monitor using '/' in id. If there are more than one '/' then default category is used. Default category is "Custom".
+ [codeblocks]
+ [gdscript]
+ func _ready():
+ var monitor_value = Callable(self, "get_monitor_value")
+
+ # Adds monitor with name "MyName" to category "MyCategory".
+ Performance.add_custom_monitor("MyCategory/MyMonitor", monitor_value)
+
+ # Adds monitor with name "MyName" to category "Custom".
+ # Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different ids so the code is valid.
+ Performance.add_custom_monitor("MyMonitor", monitor_value)
+
+ # Adds monitor with name "MyName" to category "Custom".
+ # Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different ids so the code is valid.
+ Performance.add_custom_monitor("Custom/MyMonitor", monitor_value)
+
+ # Adds monitor with name "MyCategoryOne/MyCategoryTwo/MyMonitor" to category "Custom".
+ Performance.add_custom_monitor("MyCategoryOne/MyCategoryTwo/MyMonitor", monitor_value)
+
+ func get_monitor_value():
+ return randi() % 25
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ var monitorValue = new Callable(this, nameof(GetMonitorValue));
+
+ // Adds monitor with name "MyName" to category "MyCategory".
+ Performance.AddCustomMonitor("MyCategory/MyMonitor", monitorValue);
+ // Adds monitor with name "MyName" to category "Custom".
+ // Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different ids so the code is valid.
+ Performance.AddCustomMonitor("MyMonitor", monitorValue);
+
+ // Adds monitor with name "MyName" to category "Custom".
+ // Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different ids so the code is valid.
+ Performance.AddCustomMonitor("Custom/MyMonitor", monitorValue);
+
+ // Adds monitor with name "MyCategoryOne/MyCategoryTwo/MyMonitor" to category "Custom".
+ Performance.AddCustomMonitor("MyCategoryOne/MyCategoryTwo/MyMonitor", monitorValue);
+ }
+
+ public int GetMonitorValue()
+ {
+ return GD.Randi() % 25;
+ }
+ [/csharp]
+ [/codeblocks]
+ The debugger calls the callable to get the value of custom monitor. The callable must return a number.
+ Callables are called with arguments supplied in argument array.
+ [b]Note:[/b] It throws an error if given id is already present.
+ </description>
+ </method>
+ <method name="get_custom_monitor">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="id" type="StringName">
+ </argument>
+ <description>
+ Returns the value of custom monitor with given id. The callable is called to get the value of custom monitor.
+ [b]Note:[/b] It throws an error if the given id is absent.
+ </description>
+ </method>
+ <method name="get_custom_monitor_names">
+ <return type="Array">
+ </return>
+ <description>
+ Returns the names of active custom monitors in an array.
+ </description>
+ </method>
<method name="get_monitor" qualifiers="const">
<return type="float">
</return>
@@ -18,9 +100,40 @@
</argument>
<description>
Returns the value of one of the available monitors. You should provide one of the [enum Monitor] constants as the argument, like this:
- [codeblock]
- print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console.
+ [/gdscript]
+ [csharp]
+ GD.Print(Performance.GetMonitor(Performance.Monitor.TimeFps)); // Prints the FPS to the console.
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="get_monitor_modification_time">
+ <return type="int">
+ </return>
+ <description>
+ Returns the last tick in which custom monitor was added/removed.
+ </description>
+ </method>
+ <method name="has_custom_monitor">
+ <return type="bool">
+ </return>
+ <argument index="0" name="id" type="StringName">
+ </argument>
+ <description>
+ Returns true if custom monitor with the given id is present otherwise returns false.
+ </description>
+ </method>
+ <method name="remove_custom_monitor">
+ <return type="void">
+ </return>
+ <argument index="0" name="id" type="StringName">
+ </argument>
+ <description>
+ Removes the custom monitor with given id.
+ [b]Note:[/b] It throws an error if the given id is already absent.
</description>
</method>
</methods>
diff --git a/doc/classes/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml
index 58930aae37..0808e4a724 100644
--- a/doc/classes/PhysicalBone3D.xml
+++ b/doc/classes/PhysicalBone3D.xml
@@ -18,9 +18,9 @@
<method name="apply_impulse">
<return type="void">
</return>
- <argument index="0" name="position" type="Vector3">
+ <argument index="0" name="impulse" type="Vector3">
</argument>
- <argument index="1" name="impulse" type="Vector3">
+ <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
</description>
diff --git a/doc/classes/PhysicalSkyMaterial.xml b/doc/classes/PhysicalSkyMaterial.xml
index 89b43158dc..2e0f9c52f2 100644
--- a/doc/classes/PhysicalSkyMaterial.xml
+++ b/doc/classes/PhysicalSkyMaterial.xml
@@ -31,6 +31,9 @@
<member name="mie_eccentricity" type="float" setter="set_mie_eccentricity" getter="get_mie_eccentricity" default="0.8">
Controls the direction of the mie scattering. A value of [code]1[/code] means that when light hits a particle it passing through straight forward. A value of [code]-1[/code] means that all light is scatter backwards.
</member>
+ <member name="night_sky" type="Texture2D" setter="set_night_sky" getter="get_night_sky">
+ [Texture2D] for the night sky. This is added to the sky, so if it is bright enough, it may be visible during the day.
+ </member>
<member name="rayleigh_coefficient" type="float" setter="set_rayleigh_coefficient" getter="get_rayleigh_coefficient" default="2.0">
Controls the strength of the rayleigh scattering. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky.
</member>
diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml
index 6afbd1ee8e..9c3c47afba 100644
--- a/doc/classes/PhysicsBody2D.xml
+++ b/doc/classes/PhysicsBody2D.xml
@@ -7,7 +7,7 @@
PhysicsBody2D is an abstract base class for implementing a physics body. All *Body2D types inherit from it.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
</tutorials>
<methods>
<method name="add_collision_exception_with">
@@ -80,15 +80,12 @@
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
The physics layers this area is in.
Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the [member collision_mask] property.
- A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
+ A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The physics layers this area scans for collisions.
+ The physics layers this area scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable" override="true" default="false" />
- <member name="layers" type="int" setter="_set_layers" getter="_get_layers">
- Both [member collision_layer] and [member collision_mask]. Returns [member collision_layer] when accessed. Updates [member collision_layer] and [member collision_mask] when modified.
- </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/PhysicsBody3D.xml b/doc/classes/PhysicsBody3D.xml
index 2301a07a5c..7de65603f9 100644
--- a/doc/classes/PhysicsBody3D.xml
+++ b/doc/classes/PhysicsBody3D.xml
@@ -7,7 +7,7 @@
PhysicsBody3D is an abstract base class for implementing a physics body. All *Body types inherit from it.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
</tutorials>
<methods>
<method name="add_collision_exception_with">
@@ -80,10 +80,10 @@
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
The physics layers this area is in.
Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the [member collision_mask] property.
- A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
+ A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The physics layers this area scans for collisions.
+ The physics layers this area scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
</members>
<constants>
diff --git a/doc/classes/PhysicsDirectBodyState2D.xml b/doc/classes/PhysicsDirectBodyState2D.xml
index 46205fecd1..dfc0ab909a 100644
--- a/doc/classes/PhysicsDirectBodyState2D.xml
+++ b/doc/classes/PhysicsDirectBodyState2D.xml
@@ -7,7 +7,7 @@
Provides direct access to a physics body in the [PhysicsServer2D], allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See [method RigidBody2D._integrate_forces].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
+ <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
</tutorials>
<methods>
<method name="add_central_force">
@@ -22,9 +22,9 @@
<method name="add_force">
<return type="void">
</return>
- <argument index="0" name="offset" type="Vector2">
+ <argument index="0" name="force" type="Vector2">
</argument>
- <argument index="1" name="force" type="Vector2">
+ <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates.
@@ -51,9 +51,9 @@
<method name="apply_impulse">
<return type="void">
</return>
- <argument index="0" name="offset" type="Vector2">
+ <argument index="0" name="impulse" type="Vector2">
</argument>
- <argument index="1" name="impulse" type="Vector2">
+ <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The offset uses the rotation of the global coordinate system, but is centered at the object's origin.
diff --git a/doc/classes/PhysicsDirectBodyState3D.xml b/doc/classes/PhysicsDirectBodyState3D.xml
index 1ee520fe5f..eea681e696 100644
--- a/doc/classes/PhysicsDirectBodyState3D.xml
+++ b/doc/classes/PhysicsDirectBodyState3D.xml
@@ -12,7 +12,7 @@
<method name="add_central_force">
<return type="void">
</return>
- <argument index="0" name="force" type="Vector3">
+ <argument index="0" name="force" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Adds a constant directional force without affecting rotation.
@@ -24,7 +24,7 @@
</return>
<argument index="0" name="force" type="Vector3">
</argument>
- <argument index="1" name="position" type="Vector3">
+ <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates.
@@ -42,7 +42,7 @@
<method name="apply_central_impulse">
<return type="void">
</return>
- <argument index="0" name="j" type="Vector3">
+ <argument index="0" name="impulse" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Applies a single directional impulse without affecting rotation.
@@ -52,9 +52,9 @@
<method name="apply_impulse">
<return type="void">
</return>
- <argument index="0" name="position" type="Vector3">
+ <argument index="0" name="impulse" type="Vector3">
</argument>
- <argument index="1" name="j" type="Vector3">
+ <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin.
@@ -63,7 +63,7 @@
<method name="apply_torque_impulse">
<return type="void">
</return>
- <argument index="0" name="j" type="Vector3">
+ <argument index="0" name="impulse" type="Vector3">
</argument>
<description>
Apply a torque impulse (which will be affected by the body mass and shape). This will rotate the body around the vector [code]j[/code] passed as parameter.
diff --git a/doc/classes/PhysicsDirectSpaceState2D.xml b/doc/classes/PhysicsDirectSpaceState2D.xml
index d85d7794dd..c26cf0514c 100644
--- a/doc/classes/PhysicsDirectSpaceState2D.xml
+++ b/doc/classes/PhysicsDirectSpaceState2D.xml
@@ -7,7 +7,7 @@
Direct access object to a space in the [PhysicsServer2D]. It's used mainly to do queries against objects and areas residing in a given space.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
+ <link title="Ray-Casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
</tutorials>
<methods>
<method name="cast_motion">
@@ -64,13 +64,14 @@
<argument index="5" name="collide_with_areas" type="bool" default="false">
</argument>
<description>
- Checks whether a point is inside any shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields:
+ Checks whether a point is inside any solid shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields:
[code]collider[/code]: The colliding object.
[code]collider_id[/code]: The colliding object's ID.
[code]metadata[/code]: The intersecting shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method PhysicsServer2D.shape_set_data].
[code]rid[/code]: The intersecting object's [RID].
[code]shape[/code]: The shape index of the colliding shape.
Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with [PhysicsBody2D]s or [Area2D]s, respectively.
+ [b]Note:[/b] [ConcavePolygonShape2D]s and [CollisionPolygon2D]s in [code]Segments[/code] build mode are not solid shapes. Therefore, they will not be detected.
</description>
</method>
<method name="intersect_point_on_canvas">
diff --git a/doc/classes/PhysicsDirectSpaceState3D.xml b/doc/classes/PhysicsDirectSpaceState3D.xml
index ea094dcd90..789e8cc731 100644
--- a/doc/classes/PhysicsDirectSpaceState3D.xml
+++ b/doc/classes/PhysicsDirectSpaceState3D.xml
@@ -7,7 +7,7 @@
Direct access object to a space in the [PhysicsServer3D]. It's used mainly to do queries against objects and areas residing in a given space.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
+ <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
</tutorials>
<methods>
<method name="cast_motion">
diff --git a/doc/classes/PhysicsMaterial.xml b/doc/classes/PhysicsMaterial.xml
index 6410626496..0889c238dc 100644
--- a/doc/classes/PhysicsMaterial.xml
+++ b/doc/classes/PhysicsMaterial.xml
@@ -12,6 +12,7 @@
</methods>
<members>
<member name="absorbent" type="bool" setter="set_absorbent" getter="is_absorbent" default="false">
+ If [code]true[/code], subtracts the bounciness from the colliding object's bounciness instead of adding it.
</member>
<member name="bounce" type="float" setter="set_bounce" getter="get_bounce" default="0.0">
The body's bounciness. Values range from [code]0[/code] (no bounce) to [code]1[/code] (full bounciness).
@@ -20,6 +21,7 @@
The body's friction. Values range from [code]0[/code] (frictionless) to [code]1[/code] (maximum friction).
</member>
<member name="rough" type="bool" setter="set_rough" getter="is_rough" default="false">
+ If [code]true[/code], the physics engine will use the friction of the object marked as "rough" when two objects collide. If [code]false[/code], the physics engine will use the lowest friction of all colliding objects instead. If [code]true[/code] for both colliding objects, the physics engine will use the highest friction.
</member>
</members>
<constants>
diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml
index 9da739e57a..6a1508b0e3 100644
--- a/doc/classes/PhysicsServer2D.xml
+++ b/doc/classes/PhysicsServer2D.xml
@@ -331,9 +331,9 @@
</return>
<argument index="0" name="body" type="RID">
</argument>
- <argument index="1" name="offset" type="Vector2">
+ <argument index="1" name="force" type="Vector2">
</argument>
- <argument index="2" name="force" type="Vector2">
+ <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Adds a positioned force to the applied force and torque. As with [method body_apply_impulse], both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied.
@@ -379,9 +379,9 @@
</return>
<argument index="0" name="body" type="RID">
</argument>
- <argument index="1" name="position" type="Vector2">
+ <argument index="1" name="impulse" type="Vector2">
</argument>
- <argument index="2" name="impulse" type="Vector2">
+ <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates.
@@ -804,6 +804,7 @@
</argument>
<description>
Sets a body state using one of the [enum BodyState] constants.
+ Note that the method doesn't take effect immediately. The state will change on the next physics frame.
</description>
</method>
<method name="body_test_motion">
@@ -864,28 +865,28 @@
Creates a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself.
</description>
</method>
- <method name="damped_string_joint_get_param" qualifiers="const">
+ <method name="damped_spring_joint_get_param" qualifiers="const">
<return type="float">
</return>
<argument index="0" name="joint" type="RID">
</argument>
- <argument index="1" name="param" type="int" enum="PhysicsServer2D.DampedStringParam">
+ <argument index="1" name="param" type="int" enum="PhysicsServer2D.DampedSpringParam">
</argument>
<description>
- Returns the value of a damped spring joint parameter.
+ Returns the value of a damped spring joint parameter. See [enum DampedSpringParam] for a list of available parameters.
</description>
</method>
- <method name="damped_string_joint_set_param">
+ <method name="damped_spring_joint_set_param">
<return type="void">
</return>
<argument index="0" name="joint" type="RID">
</argument>
- <argument index="1" name="param" type="int" enum="PhysicsServer2D.DampedStringParam">
+ <argument index="1" name="param" type="int" enum="PhysicsServer2D.DampedSpringParam">
</argument>
<argument index="2" name="value" type="float">
</argument>
<description>
- Sets a damped spring joint parameter. See [enum DampedStringParam] for a list of available parameters.
+ Sets a damped spring joint parameter. See [enum DampedSpringParam] for a list of available parameters.
</description>
</method>
<method name="free_rid">
@@ -1247,13 +1248,13 @@
</constant>
<constant name="JOINT_PARAM_MAX_FORCE" value="2" enum="JointParam">
</constant>
- <constant name="DAMPED_STRING_REST_LENGTH" value="0" enum="DampedStringParam">
+ <constant name="DAMPED_SPRING_REST_LENGTH" value="0" enum="DampedSpringParam">
Sets the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
</constant>
- <constant name="DAMPED_STRING_STIFFNESS" value="1" enum="DampedStringParam">
+ <constant name="DAMPED_SPRING_STIFFNESS" value="1" enum="DampedSpringParam">
Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.
</constant>
- <constant name="DAMPED_STRING_DAMPING" value="2" enum="DampedStringParam">
+ <constant name="DAMPED_SPRING_DAMPING" value="2" enum="DampedSpringParam">
Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping).
</constant>
<constant name="CCD_MODE_DISABLED" value="0" enum="CCDMode">
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml
index e9e1552c92..5fd3ef5db2 100644
--- a/doc/classes/PhysicsServer3D.xml
+++ b/doc/classes/PhysicsServer3D.xml
@@ -334,7 +334,7 @@
</argument>
<argument index="1" name="force" type="Vector3">
</argument>
- <argument index="2" name="position" type="Vector3">
+ <argument index="2" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
</description>
@@ -379,9 +379,9 @@
</return>
<argument index="0" name="body" type="RID">
</argument>
- <argument index="1" name="position" type="Vector3">
+ <argument index="1" name="impulse" type="Vector3">
</argument>
- <argument index="2" name="impulse" type="Vector3">
+ <argument index="2" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Gives the body a push at a [code]position[/code] in the direction of the [code]impulse[/code].
diff --git a/doc/classes/PhysicsShapeQueryParameters2D.xml b/doc/classes/PhysicsShapeQueryParameters2D.xml
index 9a162dabbb..4d7fc61517 100644
--- a/doc/classes/PhysicsShapeQueryParameters2D.xml
+++ b/doc/classes/PhysicsShapeQueryParameters2D.xml
@@ -9,15 +9,6 @@
<tutorials>
</tutorials>
<methods>
- <method name="set_shape">
- <return type="void">
- </return>
- <argument index="0" name="shape" type="Resource">
- </argument>
- <description>
- Sets the [Shape2D] that will be used for collision/intersection queries.
- </description>
- </method>
</methods>
<members>
<member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false">
@@ -27,7 +18,7 @@
If [code]true[/code], the query will take [PhysicsBody2D]s into account.
</member>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="2147483647">
- The physics layer(s) the query will take into account (as a bitmask).
+ The physics layer(s) the query will take into account (as a bitmask). See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[ ]">
The list of objects or object [RID]s that will be excluded from collisions.
@@ -38,8 +29,39 @@
<member name="motion" type="Vector2" setter="set_motion" getter="get_motion" default="Vector2( 0, 0 )">
The motion of the shape being queried for.
</member>
+ <member name="shape" type="Resource" setter="set_shape" getter="get_shape">
+ The [Shape2D] that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over [member shape_rid].
+ </member>
<member name="shape_rid" type="RID" setter="set_shape_rid" getter="get_shape_rid">
- The queried shape's [RID]. See also [method set_shape].
+ The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API:
+ [codeblocks]
+ [gdscript]
+ var shape_rid = PhysicsServer2D.circle_shape_create()
+ var radius = 64
+ PhysicsServer2D.shape_set_data(shape_rid, radius)
+
+ var params = PhysicsShapeQueryParameters2D.new()
+ params.shape_rid = shape_rid
+
+ # Execute physics queries here...
+
+ # Release the shape when done with physics queries.
+ PhysicsServer2D.free_rid(shape_rid)
+ [/gdscript]
+ [csharp]
+ RID shapeRid = PhysicsServer2D.CircleShapeCreate();
+ int radius = 64;
+ PhysicsServer2D.ShapeSetData(shapeRid, radius);
+
+ var params = new PhysicsShapeQueryParameters2D();
+ params.ShapeRid = shapeRid;
+
+ // Execute physics queries here...
+
+ // Release the shape when done with physics queries.
+ PhysicsServer2D.FreeRid(shapeRid);
+ [/csharp]
+ [/codeblocks]
</member>
<member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
The queried shape's transform matrix.
diff --git a/doc/classes/PhysicsShapeQueryParameters3D.xml b/doc/classes/PhysicsShapeQueryParameters3D.xml
index 6606cfbc59..4b43ea66fc 100644
--- a/doc/classes/PhysicsShapeQueryParameters3D.xml
+++ b/doc/classes/PhysicsShapeQueryParameters3D.xml
@@ -9,15 +9,6 @@
<tutorials>
</tutorials>
<methods>
- <method name="set_shape">
- <return type="void">
- </return>
- <argument index="0" name="shape" type="Resource">
- </argument>
- <description>
- Sets the [Shape3D] that will be used for collision/intersection queries.
- </description>
- </method>
</methods>
<members>
<member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false">
@@ -27,7 +18,7 @@
If [code]true[/code], the query will take [PhysicsBody3D]s into account.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="2147483647">
- The physics layer(s) the query will take into account (as a bitmask).
+ The physics layer(s) the query will take into account (as a bitmask). See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[ ]">
The list of objects or object [RID]s that will be excluded from collisions.
@@ -35,8 +26,39 @@
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0">
The collision margin for the shape.
</member>
+ <member name="shape" type="Resource" setter="set_shape" getter="get_shape">
+ The [Shape3D] that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over [member shape_rid].
+ </member>
<member name="shape_rid" type="RID" setter="set_shape_rid" getter="get_shape_rid">
- The queried shape's [RID]. See also [method set_shape].
+ The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API:
+ [codeblocks]
+ [gdscript]
+ var shape_rid = PhysicsServer3D.shape_create(PhysicsServer3D.SHAPE_SPHERE)
+ var radius = 2.0
+ PhysicsServer3D.shape_set_data(shape_rid, radius)
+
+ var params = PhysicsShapeQueryParameters3D.new()
+ params.shape_rid = shape_rid
+
+ # Execute physics queries here...
+
+ # Release the shape when done with physics queries.
+ PhysicsServer3D.free_rid(shape_rid)
+ [/gdscript]
+ [csharp]
+ RID shapeRid = PhysicsServer3D.ShapeCreate(PhysicsServer3D.ShapeType.Sphere);
+ float radius = 2.0f;
+ PhysicsServer3D.ShapeSetData(shapeRid, radius);
+
+ var params = new PhysicsShapeQueryParameters3D();
+ params.ShapeRid = shapeRid;
+
+ // Execute physics queries here...
+
+ // Release the shape when done with physics queries.
+ PhysicsServer3D.FreeRid(shapeRid);
+ [/csharp]
+ [/codeblocks]
</member>
<member name="transform" type="Transform" setter="set_transform" getter="get_transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
The queried shape's transform matrix.
diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml
index 292acd8b5d..e3242512c4 100644
--- a/doc/classes/Plane.xml
+++ b/doc/classes/Plane.xml
@@ -7,10 +7,26 @@
Plane represents a normalized plane equation. Basically, "normal" is the normal of the plane (a,b,c normalized), and "d" is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
</tutorials>
<methods>
- <method name="Plane">
+ <method name="Plane" qualifiers="constructor">
+ <return type="Plane">
+ </return>
+ <description>
+ Constructs a default-initialized [Plane] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Plane" qualifiers="constructor">
+ <return type="Plane">
+ </return>
+ <argument index="0" name="from" type="Plane">
+ </argument>
+ <description>
+ Constructs a [Plane] as a copy of the given [Plane].
+ </description>
+ </method>
+ <method name="Plane" qualifiers="constructor">
<return type="Plane">
</return>
<argument index="0" name="a" type="float">
@@ -25,28 +41,39 @@
Creates a plane from the four parameters. The three components of the resulting plane's [member normal] are [code]a[/code], [code]b[/code] and [code]c[/code], and the plane has a distance of [code]d[/code] from the origin.
</description>
</method>
- <method name="Plane">
+ <method name="Plane" qualifiers="constructor">
<return type="Plane">
</return>
- <argument index="0" name="v1" type="Vector3">
+ <argument index="0" name="normal" type="Vector3">
</argument>
- <argument index="1" name="v2" type="Vector3">
+ <argument index="1" name="d" type="float">
+ </argument>
+ <description>
+ Creates a plane from the normal and the plane's distance to the origin.
+ </description>
+ </method>
+ <method name="Plane" qualifiers="constructor">
+ <return type="Plane">
+ </return>
+ <argument index="0" name="point" type="Vector3">
</argument>
- <argument index="2" name="v3" type="Vector3">
+ <argument index="1" name="normal" type="Vector3">
</argument>
<description>
- Creates a plane from the three points, given in clockwise order.
+ Creates a plane from the given position and a plane normal.
</description>
</method>
- <method name="Plane">
+ <method name="Plane" qualifiers="constructor">
<return type="Plane">
</return>
- <argument index="0" name="normal" type="Vector3">
+ <argument index="0" name="point1" type="Vector3">
</argument>
- <argument index="1" name="d" type="float">
+ <argument index="1" name="point2" type="Vector3">
+ </argument>
+ <argument index="2" name="point3" type="Vector3">
</argument>
<description>
- Creates a plane from the normal and the plane's distance to the origin.
+ Creates a plane from the three points, given in clockwise order.
</description>
</method>
<method name="center">
@@ -65,13 +92,6 @@
Returns the shortest distance from the plane to the position [code]point[/code].
</description>
</method>
- <method name="get_any_point">
- <return type="Vector3">
- </return>
- <description>
- Returns a point on the plane.
- </description>
- </method>
<method name="has_point">
<return type="bool">
</return>
@@ -80,11 +100,11 @@
<argument index="1" name="epsilon" type="float" default="1e-05">
</argument>
<description>
- Returns [code]true[/code] if [code]point[/code] is inside the plane (by a very minimum [code]epsilon[/code] threshold).
+ Returns [code]true[/code] if [code]point[/code] is inside the plane. Comparison uses a custom minimum [code]epsilon[/code] threshold.
</description>
</method>
<method name="intersect_3">
- <return type="Vector3">
+ <return type="Variant">
</return>
<argument index="0" name="b" type="Plane">
</argument>
@@ -95,7 +115,7 @@
</description>
</method>
<method name="intersects_ray">
- <return type="Vector3">
+ <return type="Variant">
</return>
<argument index="0" name="from" type="Vector3">
</argument>
@@ -106,11 +126,11 @@
</description>
</method>
<method name="intersects_segment">
- <return type="Vector3">
+ <return type="Variant">
</return>
- <argument index="0" name="begin" type="Vector3">
+ <argument index="0" name="from" type="Vector3">
</argument>
- <argument index="1" name="end" type="Vector3">
+ <argument index="1" name="to" type="Vector3">
</argument>
<description>
Returns the intersection point of a segment from position [code]begin[/code] to position [code]end[/code] with this plane. If no intersection is found, [code]null[/code] is returned.
@@ -119,7 +139,7 @@
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="plane" type="Plane">
+ <argument index="0" name="to_plane" type="Plane">
</argument>
<description>
Returns [code]true[/code] if this plane and [code]plane[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
@@ -128,7 +148,7 @@
<method name="is_point_over">
<return type="bool">
</return>
- <argument index="0" name="point" type="Vector3">
+ <argument index="0" name="plane" type="Vector3">
</argument>
<description>
Returns [code]true[/code] if [code]point[/code] is located above the plane.
@@ -141,42 +161,72 @@
Returns a copy of the plane, normalized.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Plane">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Plane">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Plane">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Plane">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="project">
<return type="Vector3">
</return>
<argument index="0" name="point" type="Vector3">
</argument>
<description>
- Returns the orthogonal projection of point [code]p[/code] into a point in the plane.
+ Returns the orthogonal projection of [code]point[/code] into a point in the plane.
</description>
</method>
</methods>
<members>
<member name="d" type="float" setter="" getter="" default="0.0">
- Distance from the origin to the plane, in the direction of [member normal].
+ The distance from the origin to the plane, in the direction of [member normal]. This value is typically non-negative.
+ In the scalar equation of the plane [code]ax + by + cz = d[/code], this is [code]d[/code], while the [code](a, b, c)[/code] coordinates are represented by the [member normal] property.
</member>
<member name="normal" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
- The normal of the plane. "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing.
+ The normal of the plane, which must be normalized.
+ In the scalar equation of the plane [code]ax + by + cz = d[/code], this is the vector [code](a, b, c)[/code], where [code]d[/code] is the [member d] property.
</member>
<member name="x" type="float" setter="" getter="" default="0.0">
- The [member normal]'s X component.
+ The X component of the plane's [member normal] vector.
</member>
<member name="y" type="float" setter="" getter="" default="0.0">
- The [member normal]'s Y component.
+ The Y component of the plane's [member normal] vector.
</member>
<member name="z" type="float" setter="" getter="" default="0.0">
- The [member normal]'s Z component.
+ The Z component of the plane's [member normal] vector.
</member>
</members>
<constants>
<constant name="PLANE_YZ" value="Plane( 1, 0, 0, 0 )">
- A plane that extends in the Y and Z axes.
+ A plane that extends in the Y and Z axes (normal vector points +X).
</constant>
<constant name="PLANE_XZ" value="Plane( 0, 1, 0, 0 )">
- A plane that extends in the X and Z axes.
+ A plane that extends in the X and Z axes (normal vector points +Y).
</constant>
<constant name="PLANE_XY" value="Plane( 0, 0, 1, 0 )">
- A plane that extends in the X and Y axes.
+ A plane that extends in the X and Y axes (normal vector points +Z).
</constant>
</constants>
</class>
diff --git a/doc/classes/PointLight2D.xml b/doc/classes/PointLight2D.xml
new file mode 100644
index 0000000000..9337bc8351
--- /dev/null
+++ b/doc/classes/PointLight2D.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="PointLight2D" inherits="Light2D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="height" type="float" setter="set_height" getter="get_height" default="0.0">
+ The height of the light. Used with 2D normal mapping.
+ </member>
+ <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )">
+ The offset of the light's [member texture].
+ </member>
+ <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
+ [Texture2D] used for the light's appearance.
+ </member>
+ <member name="texture_scale" type="float" setter="set_texture_scale" getter="get_texture_scale" default="1.0">
+ The [member texture]'s scale factor.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml
index 13332ca4f0..3aca83658d 100644
--- a/doc/classes/Polygon2D.xml
+++ b/doc/classes/Polygon2D.xml
@@ -101,8 +101,6 @@
<member name="invert_enable" type="bool" setter="set_invert" getter="get_invert" default="false">
If [code]true[/code], polygon will be inverted, containing the area outside the defined points and extending to the [code]invert_border[/code].
</member>
- <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map">
- </member>
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )">
The offset applied to each vertex.
</member>
@@ -112,14 +110,8 @@
</member>
<member name="polygons" type="Array" setter="set_polygons" getter="get_polygons" default="[ ]">
</member>
- <member name="shininess" type="float" setter="set_shininess" getter="get_shininess" default="1.0">
- </member>
<member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath(&quot;&quot;)">
</member>
- <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )">
- </member>
- <member name="specular_map" type="Texture2D" setter="set_specular_map" getter="get_specular_map">
- </member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
The polygon's fill texture. Use [code]uv[/code] to set texture coordinates.
</member>
diff --git a/doc/classes/Popup.xml b/doc/classes/Popup.xml
index 6f77f3371d..b8d8a55412 100644
--- a/doc/classes/Popup.xml
+++ b/doc/classes/Popup.xml
@@ -12,6 +12,8 @@
</methods>
<members>
<member name="borderless" type="bool" setter="set_flag" getter="get_flag" override="true" default="true" />
+ <member name="close_on_parent_focus" type="bool" setter="set_close_on_parent_focus" getter="get_close_on_parent_focus" default="true">
+ </member>
<member name="transient" type="bool" setter="set_transient" getter="is_transient" override="true" default="true" />
<member name="unresizable" type="bool" setter="set_flag" getter="get_flag" override="true" default="true" />
<member name="visible" type="bool" setter="set_visible" getter="is_visible" override="true" default="false" />
diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml
index 569da5c58b..b1ec9a222a 100644
--- a/doc/classes/PopupMenu.xml
+++ b/doc/classes/PopupMenu.xml
@@ -5,6 +5,8 @@
</brief_description>
<description>
[PopupMenu] is a [Control] that displays a list of options. They are popular in toolbars or context menus.
+ The size of a [PopupMenu] can be limited by using [member Window.max_size]. If the height of the list of items is larger than the maximum height of the [PopupMenu], a [ScrollContainer] within the popup will allow the user to scroll the contents.
+ If no maximum size is set, or if it is set to 0, the [PopupMenu] height will be limited by its parent rect.
</description>
<tutorials>
</tutorials>
@@ -27,14 +29,14 @@
<method name="add_check_shortcut">
<return type="void">
</return>
- <argument index="0" name="shortcut" type="ShortCut">
+ <argument index="0" name="shortcut" type="Shortcut">
</argument>
<argument index="1" name="id" type="int" default="-1">
</argument>
<argument index="2" name="global" type="bool" default="false">
</argument>
<description>
- Adds a new checkable item and assigns the specified [ShortCut] to it. Sets the label of the checkbox to the [ShortCut]'s name.
+ Adds a new checkable item and assigns the specified [Shortcut] to it. Sets the label of the checkbox to the [Shortcut]'s name.
An [code]id[/code] can optionally be provided. If no [code]id[/code] is provided, one will be created from the index.
[b]Note:[/b] Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it.
</description>
@@ -61,14 +63,14 @@
</return>
<argument index="0" name="texture" type="Texture2D">
</argument>
- <argument index="1" name="shortcut" type="ShortCut">
+ <argument index="1" name="shortcut" type="Shortcut">
</argument>
<argument index="2" name="id" type="int" default="-1">
</argument>
<argument index="3" name="global" type="bool" default="false">
</argument>
<description>
- Adds a new checkable item and assigns the specified [ShortCut] and icon [code]texture[/code] to it. Sets the label of the checkbox to the [ShortCut]'s name.
+ Adds a new checkable item and assigns the specified [Shortcut] and icon [code]texture[/code] to it. Sets the label of the checkbox to the [Shortcut]'s name.
An [code]id[/code] can optionally be provided. If no [code]id[/code] is provided, one will be created from the index.
[b]Note:[/b] Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it.
</description>
@@ -109,7 +111,7 @@
</return>
<argument index="0" name="texture" type="Texture2D">
</argument>
- <argument index="1" name="shortcut" type="ShortCut">
+ <argument index="1" name="shortcut" type="Shortcut">
</argument>
<argument index="2" name="id" type="int" default="-1">
</argument>
@@ -124,14 +126,14 @@
</return>
<argument index="0" name="texture" type="Texture2D">
</argument>
- <argument index="1" name="shortcut" type="ShortCut">
+ <argument index="1" name="shortcut" type="Shortcut">
</argument>
<argument index="2" name="id" type="int" default="-1">
</argument>
<argument index="3" name="global" type="bool" default="false">
</argument>
<description>
- Adds a new item and assigns the specified [ShortCut] and icon [code]texture[/code] to it. Sets the label of the checkbox to the [ShortCut]'s name.
+ Adds a new item and assigns the specified [Shortcut] and icon [code]texture[/code] to it. Sets the label of the checkbox to the [Shortcut]'s name.
An [code]id[/code] can optionally be provided. If no [code]id[/code] is provided, one will be created from the index.
</description>
</method>
@@ -186,14 +188,14 @@
<method name="add_radio_check_shortcut">
<return type="void">
</return>
- <argument index="0" name="shortcut" type="ShortCut">
+ <argument index="0" name="shortcut" type="Shortcut">
</argument>
<argument index="1" name="id" type="int" default="-1">
</argument>
<argument index="2" name="global" type="bool" default="false">
</argument>
<description>
- Adds a new radio check button and assigns a [ShortCut] to it. Sets the label of the checkbox to the [ShortCut]'s name.
+ Adds a new radio check button and assigns a [Shortcut] to it. Sets the label of the checkbox to the [Shortcut]'s name.
An [code]id[/code] can optionally be provided. If no [code]id[/code] is provided, one will be created from the index.
[b]Note:[/b] Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it.
</description>
@@ -210,14 +212,14 @@
<method name="add_shortcut">
<return type="void">
</return>
- <argument index="0" name="shortcut" type="ShortCut">
+ <argument index="0" name="shortcut" type="Shortcut">
</argument>
<argument index="1" name="id" type="int" default="-1">
</argument>
<argument index="2" name="global" type="bool" default="false">
</argument>
<description>
- Adds a [ShortCut].
+ Adds a [Shortcut].
An [code]id[/code] can optionally be provided. If no [code]id[/code] is provided, one will be created from the index.
</description>
</method>
@@ -242,6 +244,12 @@
Removes all items from the [PopupMenu].
</description>
</method>
+ <method name="get_current_index" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_item_accelerator" qualifiers="const">
<return type="int">
</return>
@@ -295,12 +303,12 @@
</description>
</method>
<method name="get_item_shortcut" qualifiers="const">
- <return type="ShortCut">
+ <return type="Shortcut">
</return>
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the [ShortCut] associated with the specified [code]idx[/code] item.
+ Returns the [Shortcut] associated with the specified [code]idx[/code] item.
</description>
</method>
<method name="get_item_submenu" qualifiers="const">
@@ -513,12 +521,12 @@
</return>
<argument index="0" name="idx" type="int">
</argument>
- <argument index="1" name="shortcut" type="ShortCut">
+ <argument index="1" name="shortcut" type="Shortcut">
</argument>
<argument index="2" name="global" type="bool" default="false">
</argument>
<description>
- Sets a [ShortCut] for the specified item [code]idx[/code].
+ Sets a [Shortcut] for the specified item [code]idx[/code].
</description>
</method>
<method name="set_item_shortcut_disabled">
@@ -529,7 +537,7 @@
<argument index="1" name="disabled" type="bool">
</argument>
<description>
- Disables the [ShortCut] of the specified index [code]idx[/code].
+ Disables the [Shortcut] of the specified index [code]idx[/code].
</description>
</method>
<method name="set_item_submenu">
@@ -585,7 +593,7 @@
</method>
</methods>
<members>
- <member name="allow_search" type="bool" setter="set_allow_search" getter="get_allow_search" default="false">
+ <member name="allow_search" type="bool" setter="set_allow_search" getter="get_allow_search" default="true">
If [code]true[/code], allows to navigate [PopupMenu] with letter keys.
</member>
<member name="hide_on_checkable_item_selection" type="bool" setter="set_hide_on_checkable_item_selection" getter="is_hide_on_checkable_item_selection" default="true">
diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml
index 77915bc538..7e9bccc1d7 100644
--- a/doc/classes/PrimitiveMesh.xml
+++ b/doc/classes/PrimitiveMesh.xml
@@ -13,7 +13,19 @@
<return type="Array">
</return>
<description>
- Returns mesh arrays used to constitute surface of [Mesh]. Mesh arrays can be used with [ArrayMesh] to create new surfaces.
+ Returns mesh arrays used to constitute surface of [Mesh]. The result can be passed to [method ArrayMesh.add_surface_from_arrays] to create a new surface. For example:
+ [codeblocks]
+ [gdscript]
+ var c = CylinderMesh.new()
+ var arr_mesh = ArrayMesh.new()
+ arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays())
+ [/gdscript]
+ [csharp]
+ var c = new CylinderMesh();
+ var arrMesh = new ArrayMesh();
+ arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, c.GetMeshArrays());
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index feded45c27..96d71db383 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -9,6 +9,9 @@
[b]Overriding:[/b] Any project setting can be overridden by creating a file named [code]override.cfg[/code] in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary.
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
<method name="add_property_info">
@@ -22,7 +25,8 @@
- [code]type[/code]: [int] (see [enum Variant.Type])
- optionally [code]hint[/code]: [int] (see [enum PropertyHint]) and [code]hint_string[/code]: [String]
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
ProjectSettings.set("category/property_name", 0)
var property_info = {
@@ -33,7 +37,21 @@
}
ProjectSettings.add_property_info(property_info)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ ProjectSettings.Singleton.Set("category/property_name", 0);
+
+ var propertyInfo = new Godot.Collections.Dictionary
+ {
+ {"name", "category/propertyName"},
+ {"type", Variant.Type.Int},
+ {"hint", PropertyHint.Enum},
+ {"hint_string", "one,two,three"},
+ };
+
+ ProjectSettings.AddPropertyInfo(propertyInfo);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="clear">
@@ -62,9 +80,14 @@
<description>
Returns the value of a setting.
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
print(ProjectSettings.get_setting("application/config/name"))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.Print(ProjectSettings.GetSetting("application/config/name"));
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="globalize_path" qualifiers="const">
@@ -92,9 +115,12 @@
</argument>
<argument index="1" name="replace_files" type="bool" default="true">
</argument>
+ <argument index="2" name="offset" type="int" default="0">
+ </argument>
<description>
Loads the contents of the .pck or .zip file specified by [code]pack[/code] into the resource filesystem ([code]res://[/code]). Returns [code]true[/code] on success.
[b]Note:[/b] If a file from [code]pack[/code] shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from [code]pack[/code] unless [code]replace_files[/code] is set to [code]false[/code].
+ [b]Note:[/b] The optional [code]offset[/code] parameter can be used to specify the offset in bytes to the start of the resource pack. This is only supported for .pck files.
</description>
</method>
<method name="localize_path" qualifiers="const">
@@ -137,7 +163,7 @@
<argument index="0" name="file" type="String">
</argument>
<description>
- Saves the configuration to a custom file.
+ Saves the configuration to a custom file. The file extension must be [code].godot[/code] (to save in text-based [ConfigFile] format) or [code].binary[/code] (to save in binary format).
</description>
</method>
<method name="set_initial_value">
@@ -172,9 +198,14 @@
<description>
Sets the value of a setting.
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
ProjectSettings.set_setting("application/config/name", "Example")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ ProjectSettings.SetSetting("application/config/name", "Example");
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
@@ -205,7 +236,8 @@
Icon set in [code].icns[/code] format used on macOS to set the game's icon. This is done automatically on start by calling [method DisplayServer.set_native_icon].
</member>
<member name="application/config/name" type="String" setter="" getter="" default="&quot;&quot;">
- The project's name. It is used both by the Project Manager and by exporters. The project name can be translated by translating its value in localization files.
+ The project's name. It is used both by the Project Manager and by exporters. The project name can be translated by translating its value in localization files. The window title will be set to match the project name automatically on startup.
+ [b]Note:[/b] Changing this value will also change the user data folder's path if [member application/config/use_custom_user_dir] is [code]false[/code]. After renaming the project, you will no longer be able to access existing data in [code]user://[/code] unless you rename the old folder to match the new project name. See [url=https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html]Data paths[/url] in the documentation for more information.
</member>
<member name="application/config/project_settings_override" type="String" setter="" getter="" default="&quot;&quot;">
Specifies a file to override project settings. For example: [code]user://custom_settings.cfg[/code].
@@ -244,7 +276,7 @@
<member name="audio/default_bus_layout" type="String" setter="" getter="" default="&quot;res://default_bus_layout.tres&quot;">
Default [AudioBusLayout] resource file to use in the project, unless overridden by the scene.
</member>
- <member name="audio/driver" type="String" setter="" getter="" default="&quot;PulseAudio&quot;">
+ <member name="audio/driver" type="String" setter="" getter="">
Specifies the audio driver to use. This setting is platform-dependent as each platform supports different audio drivers. If left empty, the default audio driver will be used.
</member>
<member name="audio/enable_audio_input" type="bool" setter="" getter="" default="false">
@@ -256,27 +288,34 @@
<member name="audio/output_latency" type="int" setter="" getter="" default="15">
Output latency in milliseconds for audio. Lower values will result in lower audio latency at the cost of increased CPU usage. Low values may result in audible cracking on slower hardware.
</member>
+ <member name="audio/output_latency.web" type="int" setter="" getter="" default="50">
+ Safer override for [member audio/output_latency] in the Web platform, to avoid audio issues especially on mobile devices.
+ </member>
<member name="audio/video_delay_compensation_ms" type="int" setter="" getter="" default="0">
Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing.
</member>
<member name="compression/formats/gzip/compression_level" type="int" setter="" getter="" default="-1">
- Default compression level for gzip. Affects compressed scenes and resources.
+ The default compression level for gzip. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. [code]-1[/code] uses the default gzip compression level, which is identical to [code]6[/code] but could change in the future due to underlying zlib updates.
</member>
<member name="compression/formats/zlib/compression_level" type="int" setter="" getter="" default="-1">
- Default compression level for Zlib. Affects compressed scenes and resources.
+ The default compression level for Zlib. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. [code]-1[/code] uses the default gzip compression level, which is identical to [code]6[/code] but could change in the future due to underlying zlib updates.
</member>
<member name="compression/formats/zstd/compression_level" type="int" setter="" getter="" default="3">
- Default compression level for Zstandard. Affects compressed scenes and resources.
+ The default compression level for Zstandard. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level.
</member>
<member name="compression/formats/zstd/long_distance_matching" type="bool" setter="" getter="" default="false">
- Enables long-distance matching in Zstandard.
+ Enables [url=https://github.com/facebook/zstd/releases/tag/v1.3.2]long-distance matching[/url] in Zstandard.
</member>
<member name="compression/formats/zstd/window_log_size" type="int" setter="" getter="" default="27">
- Largest size limit (in power of 2) allowed when compressing using long-distance matching with Zstandard.
+ Largest size limit (in power of 2) allowed when compressing using long-distance matching with Zstandard. Higher values can result in better compression, but will require more memory when compressing and decompressing.
</member>
<member name="debug/gdscript/completion/autocomplete_setters_and_getters" type="bool" setter="" getter="" default="false">
If [code]true[/code], displays getters and setters in autocompletion results in the script editor. This setting is meant to be used when porting old projects (Godot 2), as using member variables is the preferred style from Godot 3 onwards.
</member>
+ <member name="debug/gdscript/warnings/assert_always_false" type="bool" setter="" getter="" default="true">
+ </member>
+ <member name="debug/gdscript/warnings/assert_always_true" type="bool" setter="" getter="" default="true">
+ </member>
<member name="debug/gdscript/warnings/constant_used_as_function" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a constant is used as a function.
</member>
@@ -289,15 +328,6 @@
<member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true">
If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings.
</member>
- <member name="debug/gdscript/warnings/function_conflicts_constant" type="bool" setter="" getter="" default="true">
- If [code]true[/code], enables warnings when a function is declared with the same name as a constant.
- </member>
- <member name="debug/gdscript/warnings/function_conflicts_variable" type="bool" setter="" getter="" default="true">
- If [code]true[/code], enables warnings when a function is declared with the same name as a variable. This will turn into an error in a future version when first-class functions become supported in GDScript.
- </member>
- <member name="debug/gdscript/warnings/function_may_yield" type="bool" setter="" getter="" default="true">
- If [code]true[/code], enables warnings when a function assigned to a variable may yield and return a function state instead of a value.
- </member>
<member name="debug/gdscript/warnings/function_used_as_property" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when using a function as if it was a property.
</member>
@@ -313,12 +343,16 @@
<member name="debug/gdscript/warnings/property_used_as_function" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when using a property as if it was a function.
</member>
+ <member name="debug/gdscript/warnings/redundant_await" type="bool" setter="" getter="" default="true">
+ </member>
<member name="debug/gdscript/warnings/return_value_discarded" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when calling a function without using its return value (by assigning it to a variable or using it as a function argument). Such return values are sometimes used to denote possible errors using the [enum Error] enum.
</member>
<member name="debug/gdscript/warnings/shadowed_variable" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when defining a local or subclass member variable that would shadow a variable at an upper level (such as a member variable).
</member>
+ <member name="debug/gdscript/warnings/shadowed_variable_base_class" type="bool" setter="" getter="" default="true">
+ </member>
<member name="debug/gdscript/warnings/standalone_expression" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when calling an expression that has no effect on the surrounding code, such as writing [code]2 + 2[/code] as a statement.
</member>
@@ -337,6 +371,8 @@
<member name="debug/gdscript/warnings/unreachable_code" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when unreachable code is detected (such as after a [code]return[/code] statement that will always be executed).
</member>
+ <member name="debug/gdscript/warnings/unreachable_pattern" type="bool" setter="" getter="" default="true">
+ </member>
<member name="debug/gdscript/warnings/unsafe_call_argument" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables warnings when using an expression whose type may not be compatible with the function parameter expected.
</member>
@@ -349,11 +385,11 @@
<member name="debug/gdscript/warnings/unsafe_property_access" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables warnings when accessing a property whose presence is not guaranteed at compile-time in the class.
</member>
- <member name="debug/gdscript/warnings/unused_argument" type="bool" setter="" getter="" default="true">
- If [code]true[/code], enables warnings when a function parameter is unused.
+ <member name="debug/gdscript/warnings/unused_local_constant" type="bool" setter="" getter="" default="true">
+ </member>
+ <member name="debug/gdscript/warnings/unused_parameter" type="bool" setter="" getter="" default="true">
</member>
- <member name="debug/gdscript/warnings/unused_class_variable" type="bool" setter="" getter="" default="false">
- If [code]true[/code], enables warnings when a member variable is unused.
+ <member name="debug/gdscript/warnings/unused_private_class_variable" type="bool" setter="" getter="" default="true">
</member>
<member name="debug/gdscript/warnings/unused_signal" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a signal is unused.
@@ -361,9 +397,6 @@
<member name="debug/gdscript/warnings/unused_variable" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a local variable is unused.
</member>
- <member name="debug/gdscript/warnings/variable_conflicts_function" type="bool" setter="" getter="" default="true">
- If [code]true[/code], enables warnings when a variable is declared with the same name as a function. This will turn into an error in a future version when first-class functions become supported in GDScript.
- </member>
<member name="debug/gdscript/warnings/void_assignment" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when assigning the result of a function that returns [code]void[/code] to a variable.
</member>
@@ -427,19 +460,24 @@
If [code]true[/code], the home indicator is hidden automatically. This only affects iOS devices without a physical home button.
</member>
<member name="display/window/size/always_on_top" type="bool" setter="" getter="" default="false">
- Force the window to be always on top.
+ Forces the main window to be always on top.
+ [b]Note:[/b] This setting is ignored on iOS, Android, and HTML5.
</member>
<member name="display/window/size/borderless" type="bool" setter="" getter="" default="false">
- Force the window to be borderless.
+ Forces the main window to be borderless.
+ [b]Note:[/b] This setting is ignored on iOS, Android, and HTML5.
</member>
<member name="display/window/size/fullscreen" type="bool" setter="" getter="" default="false">
- Sets the window to full screen when it starts.
+ Sets the main window to full screen when the project starts. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
+ Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
+ [b]Note:[/b] This setting is ignored on iOS, Android, and HTML5.
</member>
<member name="display/window/size/height" type="int" setter="" getter="" default="600">
Sets the game's main viewport height. On desktop platforms, this is the default window size. Stretch mode settings also use this as a reference when enabled.
</member>
<member name="display/window/size/resizable" type="bool" setter="" getter="" default="true">
Allows the window to be resizable by default.
+ [b]Note:[/b] This setting is ignored on iOS and Android.
</member>
<member name="display/window/size/test_height" type="int" setter="" getter="" default="0">
If greater than zero, overrides the window height when running the game. Useful for testing stretch modes.
@@ -450,6 +488,9 @@
<member name="display/window/size/width" type="int" setter="" getter="" default="1024">
Sets the game's main viewport width. On desktop platforms, this is the default window size. Stretch mode settings also use this as a reference when enabled.
</member>
+ <member name="display/window/tablet_driver" type="String" setter="" getter="">
+ Specifies the tablet driver to use. If left empty, the default driver will be used.
+ </member>
<member name="display/window/vsync/use_vsync" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables vertical synchronization. This eliminates tearing that may appear in moving scenes, at the cost of higher input latency and stuttering at lower framerates. If [code]false[/code], vertical synchronization will be disabled, however, many platforms will enforce it regardless (such as mobile platforms and HTML5).
</member>
@@ -458,7 +499,7 @@
[b]Note:[/b] This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it.
</member>
<member name="editor/script_templates_search_path" type="String" setter="" getter="" default="&quot;res://script_templates&quot;">
- Search path for project-specific script templates. Script templates will be search both in the editor-specific path and in this project-specific path.
+ Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path.
</member>
<member name="editor/search_in_file_extensions" type="PackedStringArray" setter="" getter="" default="PackedStringArray( &quot;gd&quot;, &quot;shader&quot; )">
Text-based file extensions to include in the script editor's "Find in Files" feature. You can add e.g. [code]tscn[/code] if you wish to also parse your scene files, especially if you use built-in scripts which are serialized in the scene files.
@@ -466,8 +507,10 @@
<member name="gui/common/default_scroll_deadzone" type="int" setter="" getter="" default="0">
Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden.
</member>
- <member name="gui/common/swap_ok_cancel" type="bool" setter="" getter="" default="false">
- If [code]true[/code], swaps OK and Cancel buttons in dialogs on Windows and UWP to follow interface conventions.
+ <member name="gui/common/swap_cancel_ok" type="bool" setter="" getter="">
+ If [code]true[/code], swaps Cancel and OK buttons in dialogs on Windows and UWP to follow interface conventions.
+ </member>
+ <member name="gui/common/text_edit_undo_stack_max_size" type="int" setter="" getter="" default="1024">
</member>
<member name="gui/theme/custom" type="String" setter="" getter="" default="&quot;&quot;">
Path to a custom [Theme] resource file to use for the project ([code]theme[/code] or generic [code]tres[/code]/[code]res[/code] extension).
@@ -545,6 +588,9 @@
<member name="input_devices/pointing/emulate_touch_from_mouse" type="bool" setter="" getter="" default="false">
If [code]true[/code], sends touch input events when clicking or dragging the mouse.
</member>
+ <member name="input_devices/pointing/ios/touch_delay" type="float" setter="" getter="" default="0.15">
+ Default delay for touch events. This only affects iOS devices.
+ </member>
<member name="layer_names/2d_physics/layer_1" type="String" setter="" getter="" default="&quot;&quot;">
Optional name for the 2D physics layer 1.
</member>
@@ -794,13 +840,17 @@
<member name="logging/file_logging/enable_file_logging" type="bool" setter="" getter="" default="false">
If [code]true[/code], logs all output to files.
</member>
- <member name="logging/file_logging/log_path" type="String" setter="" getter="" default="&quot;user://logs/log.txt&quot;">
+ <member name="logging/file_logging/enable_file_logging.pc" type="bool" setter="" getter="" default="true">
+ </member>
+ <member name="logging/file_logging/log_path" type="String" setter="" getter="" default="&quot;user://logs/godot.log&quot;">
Path to logs within the project. Using an [code]user://[/code] path is recommended.
</member>
- <member name="logging/file_logging/max_log_files" type="int" setter="" getter="" default="10">
+ <member name="logging/file_logging/max_log_files" type="int" setter="" getter="" default="5">
Specifies the maximum amount of log files allowed (used for rotation).
</member>
- <member name="memory/limits/message_queue/max_size_kb" type="int" setter="" getter="" default="1024">
+ <member name="memory/limits/command_queue/multithreading_queue_size_kb" type="int" setter="" getter="" default="256">
+ </member>
+ <member name="memory/limits/message_queue/max_size_kb" type="int" setter="" getter="" default="4096">
Godot uses a message queue to defer some function calls. If you run out of space on it (you will see an error), you can increase the size here.
</member>
<member name="memory/limits/multithreaded_server/rid_pool_prealloc" type="int" setter="" getter="" default="60">
@@ -816,6 +866,8 @@
</member>
<member name="mono/profiler/enabled" type="bool" setter="" getter="" default="false">
</member>
+ <member name="mono/project/auto_update_project" type="bool" setter="" getter="" default="true">
+ </member>
<member name="mono/unhandled_exception_policy" type="int" setter="" getter="" default="0">
</member>
<member name="network/limits/debugger/max_chars_per_second" type="int" setter="" getter="" default="32768">
@@ -831,7 +883,7 @@
Maximum number of warnings allowed to be sent from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection.
</member>
<member name="network/limits/packet_peer_stream/max_buffer_po2" type="int" setter="" getter="" default="16">
- Default size of packet peer stream for deserializing Godot data. Over this size, data is dropped.
+ Default size of packet peer stream for deserializing Godot data (in bytes, specified as a power of two). The default value [code]16[/code] is equal to 65,536 bytes. Over this size, data is dropped.
</member>
<member name="network/limits/tcp/connect_timeout_seconds" type="int" setter="" getter="" default="30">
Timeout (in seconds) for connection attempts using TCP.
@@ -839,38 +891,15 @@
<member name="network/limits/webrtc/max_channel_in_buffer_kb" type="int" setter="" getter="" default="64">
Maximum size (in kiB) for the [WebRTCDataChannel] input buffer.
</member>
- <member name="network/limits/websocket_client/max_in_buffer_kb" type="int" setter="" getter="" default="64">
- Maximum size (in kiB) for the [WebSocketClient] input buffer.
- </member>
- <member name="network/limits/websocket_client/max_in_packets" type="int" setter="" getter="" default="1024">
- Maximum number of concurrent input packets for [WebSocketClient].
- </member>
- <member name="network/limits/websocket_client/max_out_buffer_kb" type="int" setter="" getter="" default="64">
- Maximum size (in kiB) for the [WebSocketClient] output buffer.
- </member>
- <member name="network/limits/websocket_client/max_out_packets" type="int" setter="" getter="" default="1024">
- Maximum number of concurrent output packets for [WebSocketClient].
- </member>
- <member name="network/limits/websocket_server/max_in_buffer_kb" type="int" setter="" getter="" default="64">
- Maximum size (in kiB) for the [WebSocketServer] input buffer.
- </member>
- <member name="network/limits/websocket_server/max_in_packets" type="int" setter="" getter="" default="1024">
- Maximum number of concurrent input packets for [WebSocketServer].
- </member>
- <member name="network/limits/websocket_server/max_out_buffer_kb" type="int" setter="" getter="" default="64">
- Maximum size (in kiB) for the [WebSocketServer] output buffer.
- </member>
- <member name="network/limits/websocket_server/max_out_packets" type="int" setter="" getter="" default="1024">
- Maximum number of concurrent output packets for [WebSocketServer].
- </member>
<member name="network/remote_fs/page_read_ahead" type="int" setter="" getter="" default="4">
Amount of read ahead used by remote filesystem. Higher values decrease the effects of latency at the cost of higher bandwidth usage.
</member>
<member name="network/remote_fs/page_size" type="int" setter="" getter="" default="65536">
Page size used by remote filesystem (in bytes).
</member>
- <member name="network/ssl/certificates" type="String" setter="" getter="" default="&quot;&quot;">
- CA certificates bundle to use for SSL connections. If not defined, Godot's internal CA certificates are used.
+ <member name="network/ssl/certificate_bundle_override" type="String" setter="" getter="" default="&quot;&quot;">
+ The CA certificates bundle to use for SSL connections. If this is set to a non-empty value, this will [i]override[/i] Godot's default [url=https://github.com/godotengine/godot/blob/master/thirdparty/certs/ca-certificates.crt]Mozilla certificate bundle[/url]. If left empty, the default certificate bundle will be used.
+ If in doubt, leave this setting empty.
</member>
<member name="node/name_casing" type="int" setter="" getter="" default="0">
When creating node names automatically, set the type of casing in this project. This is mostly an editor setting.
@@ -882,29 +911,43 @@
Size of the hash table used for the broad-phase 2D hash grid algorithm.
</member>
<member name="physics/2d/cell_size" type="int" setter="" getter="" default="128">
- Cell size used for the broad-phase 2D hash grid algorithm.
+ Cell size used for the broad-phase 2D hash grid algorithm (in pixels).
</member>
<member name="physics/2d/default_angular_damp" type="float" setter="" getter="" default="1.0">
The default angular damp in 2D.
+ [b]Note:[/b] Good values are in the range [code]0[/code] to [code]1[/code]. At value [code]0[/code] objects will keep moving with the same velocity. Values greater than [code]1[/code] will aim to reduce the velocity to [code]0[/code] in less than a second e.g. a value of [code]2[/code] will aim to reduce the velocity to [code]0[/code] in half a second. A value equal to or greater than the physics frame rate ([member ProjectSettings.physics/common/physics_fps], [code]60[/code] by default) will bring the object to a stop in one iteration.
</member>
<member name="physics/2d/default_gravity" type="int" setter="" getter="" default="98">
The default gravity strength in 2D.
[b]Note:[/b] This property is only read when the project starts. To change the default gravity at runtime, use the following code sample:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Set the default gravity strength to 98.
- PhysicsServer2D.area_set_param(get_viewport().find_world_2d().get_space(), PhysicsServer2D.AREA_PARAM_GRAVITY, 98)
- [/codeblock]
+ PhysicsServer2D.area_set_param(get_viewport().find_world_2d().space, PhysicsServer2D.AREA_PARAM_GRAVITY, 98)
+ [/gdscript]
+ [csharp]
+ // Set the default gravity strength to 98.
+ PhysicsServer2D.AreaSetParam(GetViewport().FindWorld2d().Space, PhysicsServer2D.AreaParameter.Gravity, 98);
+ [/csharp]
+ [/codeblocks]
</member>
<member name="physics/2d/default_gravity_vector" type="Vector2" setter="" getter="" default="Vector2( 0, 1 )">
The default gravity direction in 2D.
[b]Note:[/b] This property is only read when the project starts. To change the default gravity vector at runtime, use the following code sample:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Set the default gravity direction to `Vector2(0, 1)`.
- PhysicsServer2D.area_set_param(get_viewport().find_world_2d().get_space(), PhysicsServer2D.AREA_PARAM_GRAVITY_VECTOR, Vector2(0, 1))
- [/codeblock]
+ PhysicsServer2D.area_set_param(get_viewport().find_world_2d().space, PhysicsServer2D.AREA_PARAM_GRAVITY_VECTOR, Vector2.DOWN)
+ [/gdscript]
+ [csharp]
+ // Set the default gravity direction to `Vector2(0, 1)`.
+ PhysicsServer2D.AreaSetParam(GetViewport().FindWorld2d().Space, PhysicsServer2D.AreaParameter.GravityVector, Vector2.Down)
+ [/csharp]
+ [/codeblocks]
</member>
<member name="physics/2d/default_linear_damp" type="float" setter="" getter="" default="0.1">
The default linear damp in 2D.
+ [b]Note:[/b] Good values are in the range [code]0[/code] to [code]1[/code]. At value [code]0[/code] objects will keep moving with the same velocity. Values greater than [code]1[/code] will aim to reduce the velocity to [code]0[/code] in less than a second e.g. a value of [code]2[/code] will aim to reduce the velocity to [code]0[/code] in half a second. A value equal to or greater than the physics frame rate ([member ProjectSettings.physics/common/physics_fps], [code]60[/code] by default) will bring the object to a stop in one iteration.
</member>
<member name="physics/2d/large_object_surface_threshold_in_cells" type="int" setter="" getter="" default="512">
Threshold defining the surface size that constitutes a large object with regard to cells in the broad-phase 2D hash grid algorithm.
@@ -931,25 +974,39 @@
</member>
<member name="physics/3d/default_angular_damp" type="float" setter="" getter="" default="0.1">
The default angular damp in 3D.
+ [b]Note:[/b] Good values are in the range [code]0[/code] to [code]1[/code]. At value [code]0[/code] objects will keep moving with the same velocity. Values greater than [code]1[/code] will aim to reduce the velocity to [code]0[/code] in less than a second e.g. a value of [code]2[/code] will aim to reduce the velocity to [code]0[/code] in half a second. A value equal to or greater than the physics frame rate ([member ProjectSettings.physics/common/physics_fps], [code]60[/code] by default) will bring the object to a stop in one iteration.
</member>
<member name="physics/3d/default_gravity" type="float" setter="" getter="" default="9.8">
The default gravity strength in 3D.
[b]Note:[/b] This property is only read when the project starts. To change the default gravity at runtime, use the following code sample:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Set the default gravity strength to 9.8.
- PhysicsServer3D.area_set_param(get_viewport().find_world().get_space(), PhysicsServer3D.AREA_PARAM_GRAVITY, 9.8)
- [/codeblock]
+ PhysicsServer3D.area_set_param(get_viewport().find_world().space, PhysicsServer3D.AREA_PARAM_GRAVITY, 9.8)
+ [/gdscript]
+ [csharp]
+ // Set the default gravity strength to 9.8.
+ PhysicsServer3D.AreaSetParam(GetViewport().FindWorld().Space, PhysicsServer3D.AreaParameter.Gravity, 9.8);
+ [/csharp]
+ [/codeblocks]
</member>
<member name="physics/3d/default_gravity_vector" type="Vector3" setter="" getter="" default="Vector3( 0, -1, 0 )">
The default gravity direction in 3D.
[b]Note:[/b] This property is only read when the project starts. To change the default gravity vector at runtime, use the following code sample:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Set the default gravity direction to `Vector3(0, -1, 0)`.
- PhysicsServer3D.area_set_param(get_viewport().find_world().get_space(), PhysicsServer3D.AREA_PARAM_GRAVITY_VECTOR, Vector3(0, -1, 0))
- [/codeblock]
+ PhysicsServer3D.area_set_param(get_viewport().find_world().get_space(), PhysicsServer3D.AREA_PARAM_GRAVITY_VECTOR, Vector3.DOWN)
+ [/gdscript]
+ [csharp]
+ // Set the default gravity direction to `Vector3(0, -1, 0)`.
+ PhysicsServer3D.AreaSetParam(GetViewport().FindWorld().Space, PhysicsServer3D.AreaParameter.GravityVector, Vector3.Down)
+ [/csharp]
+ [/codeblocks]
</member>
<member name="physics/3d/default_linear_damp" type="float" setter="" getter="" default="0.1">
The default linear damp in 3D.
+ [b]Note:[/b] Good values are in the range [code]0[/code] to [code]1[/code]. At value [code]0[/code] objects will keep moving with the same velocity. Values greater than [code]1[/code] will aim to reduce the velocity to [code]0[/code] in less than a second e.g. a value of [code]2[/code] will aim to reduce the velocity to [code]0[/code] in half a second. A value equal to or greater than the physics frame rate ([member ProjectSettings.physics/common/physics_fps], [code]60[/code] by default) will bring the object to a stop in one iteration.
</member>
<member name="physics/3d/physics_engine" type="String" setter="" getter="" default="&quot;DEFAULT&quot;">
Sets which physics engine to use for 3D physics.
@@ -972,17 +1029,42 @@
<member name="rendering/environment/default_environment" type="String" setter="" getter="" default="&quot;&quot;">
[Environment] that will be used as a fallback environment in case a scene does not specify its own environment. The default environment is loaded in at scene load time regardless of whether you have set an environment or not. If you do not rely on the fallback environment, it is best to delete [code]default_env.tres[/code], or to specify a different default environment here.
</member>
+ <member name="rendering/gpu_lightmapper/performance/max_rays_per_pass" type="int" setter="" getter="" default="32">
+ </member>
+ <member name="rendering/gpu_lightmapper/performance/max_rays_per_probe_pass" type="int" setter="" getter="" default="64">
+ </member>
+ <member name="rendering/gpu_lightmapper/performance/region_size" type="int" setter="" getter="" default="512">
+ </member>
+ <member name="rendering/gpu_lightmapper/quality/high_quality_probe_ray_count" type="int" setter="" getter="" default="512">
+ </member>
+ <member name="rendering/gpu_lightmapper/quality/high_quality_ray_count" type="int" setter="" getter="" default="256">
+ </member>
+ <member name="rendering/gpu_lightmapper/quality/low_quality_probe_ray_count" type="int" setter="" getter="" default="64">
+ </member>
+ <member name="rendering/gpu_lightmapper/quality/low_quality_ray_count" type="int" setter="" getter="" default="16">
+ </member>
+ <member name="rendering/gpu_lightmapper/quality/medium_quality_probe_ray_count" type="int" setter="" getter="" default="256">
+ </member>
+ <member name="rendering/gpu_lightmapper/quality/medium_quality_ray_count" type="int" setter="" getter="" default="64">
+ </member>
+ <member name="rendering/gpu_lightmapper/quality/ultra_quality_probe_ray_count" type="int" setter="" getter="" default="2048">
+ </member>
+ <member name="rendering/gpu_lightmapper/quality/ultra_quality_ray_count" type="int" setter="" getter="" default="1024">
+ </member>
<member name="rendering/high_end/global_shader_variables_buffer_size" type="int" setter="" getter="" default="65536">
</member>
+ <member name="rendering/lightmapper/probe_capture_update_speed" type="float" setter="" getter="" default="15">
+ </member>
<member name="rendering/limits/rendering/max_renderable_elements" type="int" setter="" getter="" default="128000">
Max amount of elements renderable in a frame. If more than this are visible per frame, they will be dropped. Keep in mind elements refer to mesh surfaces and not meshes themselves.
</member>
- <member name="rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround" type="bool" setter="" getter="" default="false">
- Some NVIDIA GPU drivers have a bug which produces flickering issues for the [code]draw_rect[/code] method, especially as used in [TileMap]. Refer to [url=https://github.com/godotengine/godot/issues/9913]GitHub issue 9913[/url] for details.
- If [code]true[/code], this option enables a "safe" code path for such NVIDIA GPUs at the cost of performance. This option only impacts the GLES2 rendering backend, and only desktop platforms. It is not necessary when using the Vulkan backend.
+ <member name="rendering/limits/time/time_rollover_secs" type="float" setter="" getter="" default="3600">
</member>
- <member name="rendering/quality/2d/use_pixel_snap" type="bool" setter="" getter="" default="false">
- If [code]true[/code], forces snapping of polygons to pixels in 2D rendering. May help in some pixel art styles.
+ <member name="rendering/quality/2d/snap_2d_transforms_to_pixel" type="bool" setter="" getter="" default="false">
+ </member>
+ <member name="rendering/quality/2d/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false">
+ </member>
+ <member name="rendering/quality/2d_shadow_atlas/size" type="int" setter="" getter="" default="2048">
</member>
<member name="rendering/quality/depth_of_field/depth_of_field_bokeh_quality" type="int" setter="" getter="" default="2">
Sets the quality of the depth of field effect. Higher quality takes more samples, which is slower but looks smoother.
@@ -1029,6 +1111,9 @@
<member name="rendering/quality/glow/upscale_mode.mobile" type="int" setter="" getter="" default="0">
Lower-end override for [member rendering/quality/glow/upscale_mode] on mobile devices, due to performance concerns or driver support.
</member>
+ <member name="rendering/quality/glow/use_high_quality" type="bool" setter="" getter="" default="false">
+ Takes more samples during downsample pass of glow. This ensures that single pixels are captured by glow which makes the glow look smoother and more stable during movement. However, it is very expensive and makes the glow post process take twice as long.
+ </member>
<member name="rendering/quality/intended_usage/framebuffer_allocation" type="int" setter="" getter="" default="2">
Strategy used for framebuffer allocation. The simpler it is, the less resources it uses (but the less features it supports). If set to "2D Without Sampling" or "3D Without Effects", sample buffers will not be allocated. This means [code]SCREEN_TEXTURE[/code] and [code]DEPTH_TEXTURE[/code] will not be available in shaders and post-processing effects will not be available in the [Environment].
</member>
@@ -1063,18 +1148,20 @@
Lower-end override for [member rendering/quality/reflections/texture_array_reflections] on mobile devices, due to performance concerns or driver support.
</member>
<member name="rendering/quality/screen_filters/msaa" type="int" setter="" getter="" default="0">
- Sets the number of MSAA samples to use. MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware.
+ Sets the number of MSAA samples to use (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware.
[b]Note:[/b] MSAA is not available on HTML5 export using the GLES2 backend.
</member>
<member name="rendering/quality/screen_filters/screen_space_aa" type="int" setter="" getter="" default="0">
Sets the screen-space antialiasing mode for the default screen [Viewport]. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry.
- Another way to combat specular aliasing is to enable [member rendering/quality/screen_filters/screen_space_roughness_limiter].
+ Another way to combat specular aliasing is to enable [member rendering/quality/screen_filters/screen_space_roughness_limiter_enabled].
+ </member>
+ <member name="rendering/quality/screen_filters/screen_space_roughness_limiter_amount" type="float" setter="" getter="" default="0.25">
</member>
- <member name="rendering/quality/screen_filters/screen_space_roughness_limiter" type="int" setter="" getter="" default="0">
- Enables the screen-space roughness limiter which increases material roughness in areas with a high normal frequency (i.e. when normals change a lot from pixel to pixel). This helps to reduce the amount of specular aliasing in a scene. Specular aliasing looks like random bright pixels that occur in reflections.
+ <member name="rendering/quality/screen_filters/screen_space_roughness_limiter_enabled" type="bool" setter="" getter="" default="true">
</member>
- <member name="rendering/quality/screen_filters/screen_space_roughness_limiter_curve" type="float" setter="" getter="" default="1.0">
- Curves the amount of the roughness limited effect. A higher value limits the effect to very sharply curved surfaces, while a lower threshold extends the effect to smoother surfaces.
+ <member name="rendering/quality/screen_filters/screen_space_roughness_limiter_limit" type="float" setter="" getter="" default="0.18">
+ </member>
+ <member name="rendering/quality/screen_filters/use_debanding" type="bool" setter="" getter="" default="false">
</member>
<member name="rendering/quality/screen_space_reflection/roughness_quality" type="int" setter="" getter="" default="1">
Sets the quality for rough screen-space reflections. Turning off will make all screen space reflections sharp, while higher values make rough reflections look better.
@@ -1136,16 +1223,29 @@
<member name="rendering/quality/subsurface_scattering/subsurface_scattering_scale" type="float" setter="" getter="" default="0.05">
Scales the distance over which samples are taken for subsurface scattering effect. Changing this does not impact performance, but higher values will result in significant artifacts as the samples will become obviously spread out. A lower value results in a smaller spread of scattered light.
</member>
- <member name="rendering/quality/texture_filters/max_anisotropy" type="int" setter="" getter="" default="4">
- Sets the maximum number of samples to take when using anisotropic filtering on textures. A higher sample count will result in sharper textures at oblique angles, but is more expensive to compute.
- Only power of two values are valid ([code]1[/code], [code]2[/code], [code]4[/code], [code]8[/code], [code]16[/code]). A value of [code]1[/code] forcibly disables anisotropic filtering, even on materials where it is enabled.
+ <member name="rendering/quality/texture_filters/anisotropic_filtering_level" type="int" setter="" getter="" default="2">
+ Sets the maximum number of samples to take when using anisotropic filtering on textures (as a power of two). A higher sample count will result in sharper textures at oblique angles, but is more expensive to compute. A value of [code]0[/code] forcibly disables anisotropic filtering, even on materials where it is enabled.
</member>
<member name="rendering/quality/texture_filters/use_nearest_mipmap_filter" type="bool" setter="" getter="" default="false">
If [code]true[/code], uses nearest-neighbor mipmap filtering when using mipmaps (also called "bilinear filtering"), which will result in visible seams appearing between mipmap stages. This may increase performance in mobile as less memory bandwidth is used. If [code]false[/code], linear mipmap filtering (also called "trilinear filtering") is used.
</member>
+ <member name="rendering/sdfgi/frames_to_converge" type="int" setter="" getter="" default="1">
+ </member>
+ <member name="rendering/sdfgi/probe_ray_count" type="int" setter="" getter="" default="2">
+ </member>
<member name="rendering/threads/thread_model" type="int" setter="" getter="" default="1">
Thread model for rendering. Rendering on a thread can vastly improve performance, but synchronizing to the main thread can cause a bit more jitter.
</member>
+ <member name="rendering/volumetric_fog/directional_shadow_shrink" type="int" setter="" getter="" default="512">
+ </member>
+ <member name="rendering/volumetric_fog/positional_shadow_shrink" type="int" setter="" getter="" default="512">
+ </member>
+ <member name="rendering/volumetric_fog/use_filter" type="int" setter="" getter="" default="0">
+ </member>
+ <member name="rendering/volumetric_fog/volume_depth" type="int" setter="" getter="" default="128">
+ </member>
+ <member name="rendering/volumetric_fog/volume_size" type="int" setter="" getter="" default="64">
+ </member>
<member name="rendering/vram_compression/import_bptc" type="bool" setter="" getter="" default="false">
If [code]true[/code], the texture importer will import VRAM-compressed textures using the BPTC algorithm. This texture compression algorithm is only supported on desktop platforms, and only when using the Vulkan renderer.
</member>
@@ -1169,6 +1269,9 @@
</member>
<member name="rendering/vulkan/staging_buffer/texture_upload_region_size_px" type="int" setter="" getter="" default="64">
</member>
+ <member name="world/2d/cell_size" type="int" setter="" getter="" default="100">
+ Cell size used for the 2D hash grid that [VisibilityNotifier2D] uses (in pixels).
+ </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/QuadMesh.xml b/doc/classes/QuadMesh.xml
index 422add08d1..24a3d76ee2 100644
--- a/doc/classes/QuadMesh.xml
+++ b/doc/classes/QuadMesh.xml
@@ -7,6 +7,8 @@
Class representing a square [PrimitiveMesh]. This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Y axes; this default rotation is more suited for use with billboarded materials. Unlike [PlaneMesh], this mesh doesn't provide subdivision options.
</description>
<tutorials>
+ <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
+ <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml
index 327fa882e5..5932a624f2 100644
--- a/doc/classes/Quat.xml
+++ b/doc/classes/Quat.xml
@@ -4,33 +4,42 @@
Quaternion.
</brief_description>
<description>
- A unit quaternion used for representing 3D rotations.
- It is similar to [Basis], which implements matrix representation of rotations, and can be parametrized using both an axis-angle pair or Euler angles. But due to its compactness and the way it is stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors.
- Quaternions need to be (re)normalized.
+ A unit quaternion used for representing 3D rotations. Quaternions need to be normalized to be used for rotation.
+ It is similar to Basis, which implements matrix representation of rotations, and can be parametrized using both an axis-angle pair or Euler angles. Basis stores rotation, scale, and shearing, while Quat only stores rotation.
+ Due to its compactness and the way it is stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link>
+ <link title="Using 3D transforms">https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
- <method name="Quat">
+ <method name="Quat" qualifiers="constructor">
<return type="Quat">
</return>
- <argument index="0" name="from" type="Basis">
+ <description>
+ Constructs a default-initialized quaternion with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Quat" qualifiers="constructor">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="from" type="Quat">
</argument>
<description>
- Returns the rotation matrix corresponding to the given quaternion.
+ Constructs a [Quat] as a copy of the given [Quat].
</description>
</method>
- <method name="Quat">
+ <method name="Quat" qualifiers="constructor">
<return type="Quat">
</return>
- <argument index="0" name="euler" type="Vector3">
+ <argument index="0" name="arc_from" type="Vector3">
+ </argument>
+ <argument index="1" name="arc_to" type="Vector3">
</argument>
<description>
- Returns a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle).
</description>
</method>
- <method name="Quat">
+ <method name="Quat" qualifiers="constructor">
<return type="Quat">
</return>
<argument index="0" name="axis" type="Vector3">
@@ -38,10 +47,28 @@
<argument index="1" name="angle" type="float">
</argument>
<description>
- Returns a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.
+ Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.
</description>
</method>
- <method name="Quat">
+ <method name="Quat" qualifiers="constructor">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="euler" type="Vector3">
+ </argument>
+ <description>
+ Constructs a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle).
+ </description>
+ </method>
+ <method name="Quat" qualifiers="constructor">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="from" type="Basis">
+ </argument>
+ <description>
+ Constructs a quaternion from the given [Basis].
+ </description>
+ </method>
+ <method name="Quat" qualifiers="constructor">
<return type="Quat">
</return>
<argument index="0" name="x" type="float">
@@ -53,7 +80,7 @@
<argument index="3" name="w" type="float">
</argument>
<description>
- Returns a quaternion defined by these values.
+ Constructs a quaternion defined by the given values.
</description>
</method>
<method name="cubic_slerp">
@@ -68,13 +95,13 @@
<argument index="3" name="t" type="float">
</argument>
<description>
- Performs a cubic spherical-linear interpolation with another quaternion.
+ Performs a cubic spherical interpolation between quaternions [code]preA[/code], this vector, [code]b[/code], and [code]postB[/code], by the given amount [code]t[/code].
</description>
</method>
<method name="dot">
<return type="float">
</return>
- <argument index="0" name="b" type="Quat">
+ <argument index="0" name="with" type="Quat">
</argument>
<description>
Returns the dot product of two quaternions.
@@ -84,7 +111,7 @@
<return type="Vector3">
</return>
<description>
- Returns Euler angles (in the YXZ convention: first Z, then X, and Y last) corresponding to the rotation represented by the unit quaternion. Returned vector contains the rotation angles in the format (X angle, Y angle, Z angle).
+ Returns Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last) corresponding to the rotation represented by the unit quaternion. Returned vector contains the rotation angles in the format (X angle, Y angle, Z angle).
</description>
</method>
<method name="inverse">
@@ -97,7 +124,7 @@
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="quat" type="Quat">
+ <argument index="0" name="to" type="Quat">
</argument>
<description>
Returns [code]true[/code] if this quaterion and [code]quat[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
@@ -131,38 +158,99 @@
Returns a copy of the quaternion, normalized to unit length.
</description>
</method>
- <method name="set_axis_angle">
- <return type="void">
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
</return>
- <argument index="0" name="axis" type="Vector3">
+ <argument index="0" name="right" type="Quat">
</argument>
- <argument index="1" name="angle" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="Quat">
</argument>
<description>
- Sets the quaternion to a rotation which rotates around axis by the specified angle, in radians. The axis must be a normalized vector.
</description>
</method>
- <method name="set_euler">
- <return type="void">
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
</return>
- <argument index="0" name="euler" type="Vector3">
+ <argument index="0" name="right" type="Vector3">
</argument>
<description>
- Sets the quaternion to a rotation specified by Euler angles (in the YXZ convention: first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle).
</description>
</method>
- <method name="slerp">
+ <method name="operator *" qualifiers="operator">
<return type="Quat">
</return>
- <argument index="0" name="b" type="Quat">
+ <argument index="0" name="right" type="float">
</argument>
- <argument index="1" name="t" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="int">
</argument>
<description>
- Performs a spherical-linear interpolation with another quaternion.
</description>
</method>
- <method name="slerpni">
+ <method name="operator +" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="Quat">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Quat">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="slerp">
<return type="Quat">
</return>
<argument index="0" name="b" type="Quat">
@@ -170,36 +258,43 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Performs a spherical-linear interpolation with another quaterion without checking if the rotation path is not bigger than 90°.
+ Returns the result of the spherical linear interpolation between this quaternion and [code]to[/code] by amount [code]weight[/code].
+ [b]Note:[/b] Both quaternions must be normalized.
</description>
</method>
- <method name="xform">
- <return type="Vector3">
+ <method name="slerpni">
+ <return type="Quat">
</return>
- <argument index="0" name="v" type="Vector3">
+ <argument index="0" name="b" type="Quat">
+ </argument>
+ <argument index="1" name="t" type="float">
</argument>
<description>
- Transforms the vector [code]v[/code] by this quaternion.
+ Returns the result of the spherical linear interpolation between this quaternion and [code]to[/code] by amount [code]weight[/code], but without checking if the rotation path is not bigger than 90 degrees.
</description>
</method>
</methods>
<members>
<member name="w" type="float" setter="" getter="" default="1.0">
- W component of the quaternion.
+ W component of the quaternion (real part).
+ Quaternion components should usually not be manipulated directly.
</member>
<member name="x" type="float" setter="" getter="" default="0.0">
- X component of the quaternion.
+ X component of the quaternion (imaginary [code]i[/code] axis part).
+ Quaternion components should usually not be manipulated directly.
</member>
<member name="y" type="float" setter="" getter="" default="0.0">
- Y component of the quaternion.
+ Y component of the quaternion (imaginary [code]j[/code] axis part).
+ Quaternion components should usually not be manipulated directly.
</member>
<member name="z" type="float" setter="" getter="" default="0.0">
- Z component of the quaternion.
+ Z component of the quaternion (imaginary [code]k[/code] axis part).
+ Quaternion components should usually not be manipulated directly.
</member>
</members>
<constants>
<constant name="IDENTITY" value="Quat( 0, 0, 0, 1 )">
- The identity rotation. Equivalent to an identity matrix. If a vector is transformed by an identity quaternion, it will not change.
+ The identity quaternion, representing no rotation. Equivalent to an identity [Basis] matrix. If a vector is transformed by an identity quaternion, it will not change.
</constant>
</constants>
</class>
diff --git a/doc/classes/RID.xml b/doc/classes/RID.xml
index 644c427120..0ee34d4194 100644
--- a/doc/classes/RID.xml
+++ b/doc/classes/RID.xml
@@ -9,13 +9,20 @@
<tutorials>
</tutorials>
<methods>
- <method name="RID">
+ <method name="RID" qualifiers="constructor">
<return type="RID">
</return>
- <argument index="0" name="from" type="Object">
+ <description>
+ Constructs an empty [RID] with the invalid ID [code]0[/code].
+ </description>
+ </method>
+ <method name="RID" qualifiers="constructor">
+ <return type="RID">
+ </return>
+ <argument index="0" name="from" type="RID">
</argument>
<description>
- Creates a new RID instance with the ID of a given resource. When not handed a valid resource, silently stores the unused ID 0.
+ Constructs a [RID] as a copy of the given [RID].
</description>
</method>
<method name="get_id">
@@ -25,6 +32,54 @@
Returns the ID of the referenced resource.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/RandomNumberGenerator.xml b/doc/classes/RandomNumberGenerator.xml
index ec0f1a96b2..dcb75dc275 100644
--- a/doc/classes/RandomNumberGenerator.xml
+++ b/doc/classes/RandomNumberGenerator.xml
@@ -15,6 +15,7 @@
[/codeblock]
</description>
<tutorials>
+ <link title="Random number generation">https://docs.godotengine.org/en/latest/tutorials/math/random_number_generation.html</link>
</tutorials>
<methods>
<method name="randf">
@@ -73,9 +74,10 @@
</method>
</methods>
<members>
- <member name="seed" type="int" setter="set_seed" getter="get_seed" default="-6398989897141750821">
+ <member name="seed" type="int" setter="set_seed" getter="get_seed" default="0">
The seed used by the random number generator. A given seed will give a reproducible sequence of pseudo-random numbers.
[b]Note:[/b] The RNG does not have an avalanche effect, and can output similar random streams given similar seeds. Consider using a hash function to improve your seed quality if they're sourced externally.
+ [b]Note:[/b] The default value of this property is pseudo-random, and changes when calling [method randomize]. The [code]0[/code] value documented here is a placeholder, and not the actual default seed.
</member>
</members>
<constants>
diff --git a/doc/classes/RayCast2D.xml b/doc/classes/RayCast2D.xml
index 51f3f0334d..e30d7df63f 100644
--- a/doc/classes/RayCast2D.xml
+++ b/doc/classes/RayCast2D.xml
@@ -4,14 +4,14 @@
Query the closest object intersecting a ray.
</brief_description>
<description>
- A RayCast represents a line from its origin to its destination position, [code]cast_to[/code]. It is used to query the 2D space in order to find the closest object along the path of the ray.
- RayCast2D can ignore some objects by adding them to the exception list via [code]add_exception[/code], by setting proper filtering with collision layers, or by filtering object types with type masks.
+ A RayCast represents a line from its origin to its destination position, [member target_position]. It is used to query the 2D space in order to find the closest object along the path of the ray.
+ RayCast2D can ignore some objects by adding them to the exception list via [method add_exception], by setting proper filtering with collision layers, or by filtering object types with type masks.
RayCast2D can be configured to report collisions with [Area2D]s ([member collide_with_areas]) and/or [PhysicsBody2D]s ([member collide_with_bodies]).
Only enabled raycasts will be able to query the space and report collisions.
RayCast2D calculates intersection every physics frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
+ <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
</tutorials>
<methods>
<method name="add_exception">
@@ -44,7 +44,7 @@
</return>
<description>
Updates the collision information for the ray. Use this method to update the collision information immediately instead of waiting for the next [code]_physics_process[/code] call, for example if the ray or its parent has changed state.
- [b]Note:[/b] [code]enabled == true[/code] is not required for this to work.
+ [b]Note:[/b] [member enabled] does not need to be [code]true[/code] for this to work.
</description>
</method>
<method name="get_collider" qualifiers="const">
@@ -123,9 +123,6 @@
</method>
</methods>
<members>
- <member name="cast_to" type="Vector2" setter="set_cast_to" getter="get_cast_to" default="Vector2( 0, 50 )">
- The ray's destination point, relative to the RayCast's [code]position[/code].
- </member>
<member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false">
If [code]true[/code], collision with [Area2D]s will be reported.
</member>
@@ -133,14 +130,17 @@
If [code]true[/code], collision with [PhysicsBody2D]s will be reported.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected.
+ The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
- <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="false">
+ <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true">
If [code]true[/code], collisions will be reported.
</member>
<member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true">
If [code]true[/code], the parent node will be excluded from collision detection.
</member>
+ <member name="target_position" type="Vector2" setter="set_target_position" getter="get_target_position" default="Vector2( 0, 50 )">
+ The ray's destination point, relative to the RayCast's [code]position[/code].
+ </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/RayCast3D.xml b/doc/classes/RayCast3D.xml
index 08c6d6f40c..d24e86a08b 100644
--- a/doc/classes/RayCast3D.xml
+++ b/doc/classes/RayCast3D.xml
@@ -4,14 +4,15 @@
Query the closest object intersecting a ray.
</brief_description>
<description>
- A RayCast represents a line from its origin to its destination position, [code]cast_to[/code]. It is used to query the 3D space in order to find the closest object along the path of the ray.
- RayCast3D can ignore some objects by adding them to the exception list via [code]add_exception[/code] or by setting proper filtering with collision layers and masks.
+ A RayCast represents a line from its origin to its destination position, [member target_position]. It is used to query the 3D space in order to find the closest object along the path of the ray.
+ RayCast3D can ignore some objects by adding them to the exception list via [method add_exception] or by setting proper filtering with collision layers and masks.
RayCast3D can be configured to report collisions with [Area3D]s ([member collide_with_areas]) and/or [PhysicsBody3D]s ([member collide_with_bodies]).
Only enabled raycasts will be able to query the space and report collisions.
RayCast3D calculates intersection every physics frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame), use [method force_raycast_update] after adjusting the raycast.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
+ <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="add_exception">
@@ -45,7 +46,7 @@
<description>
Updates the collision information for the ray.
Use this method to update the collision information immediately instead of waiting for the next [code]_physics_process[/code] call, for example if the ray or its parent has changed state.
- [b]Note:[/b] [code]enabled == true[/code] is not required for this to work.
+ [b]Note:[/b] [member enabled] does not need to be [code]true[/code] for this to work.
</description>
</method>
<method name="get_collider" qualifiers="const">
@@ -126,9 +127,6 @@
</method>
</methods>
<members>
- <member name="cast_to" type="Vector3" setter="set_cast_to" getter="get_cast_to" default="Vector3( 0, -1, 0 )">
- The ray's destination point, relative to the RayCast's [code]position[/code].
- </member>
<member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false">
If [code]true[/code], collision with [Area3D]s will be reported.
</member>
@@ -136,14 +134,17 @@
If [code]true[/code], collision with [PhysicsBody3D]s will be reported.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected.
+ The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
- <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="false">
+ <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true">
If [code]true[/code], collisions will be reported.
</member>
<member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true">
If [code]true[/code], collisions will be ignored for this RayCast3D's immediate parent.
</member>
+ <member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3( 0, -1, 0 )">
+ The ray's destination point, relative to the RayCast's [code]position[/code].
+ </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml
index dbf461cdf1..02a77a0e24 100644
--- a/doc/classes/Rect2.xml
+++ b/doc/classes/Rect2.xml
@@ -5,13 +5,41 @@
</brief_description>
<description>
[Rect2] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
- It uses floating point coordinates.
+ It uses floating-point coordinates. If you need integer coordinates, use [Rect2i] instead.
+ The 3D counterpart to [Rect2] is [AABB].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link>
</tutorials>
<methods>
- <method name="Rect2">
+ <method name="Rect2" qualifiers="constructor">
+ <return type="Rect2">
+ </return>
+ <description>
+ Constructs a default-initialized [Rect2] with default (zero) values of [member position] and [member size].
+ </description>
+ </method>
+ <method name="Rect2" qualifiers="constructor">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="from" type="Rect2">
+ </argument>
+ <description>
+ Constructs a [Rect2] as a copy of the given [Rect2].
+ </description>
+ </method>
+ <method name="Rect2" qualifiers="constructor">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="from" type="Rect2i">
+ </argument>
+ <description>
+ Constructs a [Rect2] from a [Rect2i].
+ </description>
+ </method>
+ <method name="Rect2" qualifiers="constructor">
<return type="Rect2">
</return>
<argument index="0" name="position" type="Vector2">
@@ -22,7 +50,7 @@
Constructs a [Rect2] by position and size.
</description>
</method>
- <method name="Rect2">
+ <method name="Rect2" qualifiers="constructor">
<return type="Rect2">
</return>
<argument index="0" name="x" type="float">
@@ -37,15 +65,6 @@
Constructs a [Rect2] by x, y, width, and height.
</description>
</method>
- <method name="Rect2">
- <return type="Rect2">
- </return>
- <argument index="0" name="from" type="Rect2i">
- </argument>
- <description>
- Constructs a [Rect2] from a [Rect2i].
- </description>
- </method>
<method name="abs">
<return type="Rect2">
</return>
@@ -105,7 +124,7 @@
</argument>
<argument index="2" name="right" type="float">
</argument>
- <argument index="3" name=" bottom" type="float">
+ <argument index="3" name="bottom" type="float">
</argument>
<description>
Returns a copy of the [Rect2] grown a given amount of units towards each direction individually.
@@ -168,16 +187,41 @@
Returns a larger [Rect2] that contains this [Rect2] and [code]b[/code].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Rect2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Rect2">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="end" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )">
- Ending corner.
+ Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size.
</member>
<member name="position" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )">
- Position (starting corner).
+ Beginning corner. Typically has values lower than [member end].
</member>
<member name="size" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )">
- Size from position to end.
+ Size from [member position] to [member end]. Typically all components are positive.
+ If the size is negative, you can use [method abs] to fix it.
</member>
</members>
<constants>
diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml
index 2e8be384c1..e8b75a6ac6 100644
--- a/doc/classes/Rect2i.xml
+++ b/doc/classes/Rect2i.xml
@@ -5,24 +5,50 @@
</brief_description>
<description>
[Rect2i] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
- It uses integer coordinates.
+ It uses integer coordinates. If you need floating-point coordinates, use [Rect2] instead.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
</tutorials>
<methods>
- <method name="Rect2i">
+ <method name="Rect2i" qualifiers="constructor">
<return type="Rect2i">
</return>
- <argument index="0" name="position" type="Vector2">
+ <description>
+ Constructs a default-initialized [Rect2i] with default (zero) values of [member position] and [member size].
+ </description>
+ </method>
+ <method name="Rect2i" qualifiers="constructor">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="from" type="Rect2i">
+ </argument>
+ <description>
+ Constructs a [Rect2i] as a copy of the given [Rect2i].
+ </description>
+ </method>
+ <method name="Rect2i" qualifiers="constructor">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="from" type="Rect2">
</argument>
- <argument index="1" name="size" type="Vector2">
+ <description>
+ Constructs a new [Rect2i] from [Rect2]. The floating point coordinates will be truncated.
+ </description>
+ </method>
+ <method name="Rect2i" qualifiers="constructor">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="position" type="Vector2i">
+ </argument>
+ <argument index="1" name="size" type="Vector2i">
</argument>
<description>
Constructs a [Rect2i] by position and size.
</description>
</method>
- <method name="Rect2i">
+ <method name="Rect2i" qualifiers="constructor">
<return type="Rect2i">
</return>
<argument index="0" name="x" type="int">
@@ -37,16 +63,146 @@
Constructs a [Rect2i] by x, y, width, and height.
</description>
</method>
- <method name="Rect2i">
+ <method name="abs">
<return type="Rect2i">
</return>
- <argument index="0" name="from" type="Rect2">
+ <description>
+ Returns a [Rect2i] with equivalent position and area, modified so that the top-left corner is the origin and [code]width[/code] and [code]height[/code] are positive.
+ </description>
+ </method>
+ <method name="clip">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="b" type="Rect2i">
+ </argument>
+ <description>
+ Returns the intersection of this [Rect2i] and b.
+ </description>
+ </method>
+ <method name="encloses">
+ <return type="bool">
+ </return>
+ <argument index="0" name="b" type="Rect2i">
+ </argument>
+ <description>
+ Returns [code]true[/code] if this [Rect2i] completely encloses another one.
+ </description>
+ </method>
+ <method name="expand">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="to" type="Vector2i">
+ </argument>
+ <description>
+ Returns this [Rect2i] expanded to include a given point.
+ </description>
+ </method>
+ <method name="get_area">
+ <return type="int">
+ </return>
+ <description>
+ Returns the area of the [Rect2i].
+ </description>
+ </method>
+ <method name="grow">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="by" type="int">
+ </argument>
+ <description>
+ Returns a copy of the [Rect2i] grown a given amount of units towards all the sides.
+ </description>
+ </method>
+ <method name="grow_individual">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="left" type="int">
+ </argument>
+ <argument index="1" name="top" type="int">
+ </argument>
+ <argument index="2" name="right" type="int">
+ </argument>
+ <argument index="3" name="bottom" type="int">
+ </argument>
+ <description>
+ Returns a copy of the [Rect2i] grown a given amount of units towards each direction individually.
+ </description>
+ </method>
+ <method name="grow_margin">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="margin" type="int">
+ </argument>
+ <argument index="1" name="by" type="int">
+ </argument>
+ <description>
+ Returns a copy of the [Rect2i] grown a given amount of units towards the [enum Margin] direction.
+ </description>
+ </method>
+ <method name="has_no_area">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if the [Rect2i] is flat or empty.
+ </description>
+ </method>
+ <method name="has_point">
+ <return type="bool">
+ </return>
+ <argument index="0" name="point" type="Vector2i">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the [Rect2i] contains a point.
+ </description>
+ </method>
+ <method name="intersects">
+ <return type="bool">
+ </return>
+ <argument index="0" name="b" type="Rect2i">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the [Rect2i] overlaps with [code]b[/code] (i.e. they have at least one point in common).
+ If [code]include_borders[/code] is [code]true[/code], they will also be considered overlapping if their borders touch, even without intersection.
+ </description>
+ </method>
+ <method name="merge">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="b" type="Rect2i">
+ </argument>
+ <description>
+ Returns a larger [Rect2i] that contains this [Rect2i] and [code]b[/code].
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Rect2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Rect2i">
</argument>
<description>
- Constructs a new [Rect2i] from [Rect2]. The floating point coordinates will be truncated.
</description>
</method>
</methods>
+ <members>
+ <member name="end" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )">
+ Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size.
+ </member>
+ <member name="position" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )">
+ Beginning corner. Typically has values lower than [member end].
+ </member>
+ <member name="size" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )">
+ Size from [member position] to [member end]. Typically all components are positive.
+ If the size is negative, you can use [method abs] to fix it.
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/RectangleShape2D.xml b/doc/classes/RectangleShape2D.xml
index b42cc48d43..041416a24b 100644
--- a/doc/classes/RectangleShape2D.xml
+++ b/doc/classes/RectangleShape2D.xml
@@ -7,6 +7,8 @@
Rectangle shape for 2D collisions. This shape is useful for modeling box-like 2D objects.
</description>
<tutorials>
+ <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/121</link>
+ <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Reference.xml b/doc/classes/Reference.xml
index 860a47798c..9c3d1d5d9d 100644
--- a/doc/classes/Reference.xml
+++ b/doc/classes/Reference.xml
@@ -5,10 +5,11 @@
</brief_description>
<description>
Base class for any object that keeps a reference count. [Resource] and many other helper objects inherit this class.
- References keep an internal reference counter so that they are automatically released when no longer in use, and only then. References therefore do not need to be freed manually with [method Object.free].
+ Unlike [Object]s, References keep an internal reference counter so that they are automatically released when no longer in use, and only then. References therefore do not need to be freed manually with [method Object.free].
In the vast majority of use cases, instantiating and using [Reference]-derived types is all you need to do. The methods provided in this class are only for advanced users, and can cause issues if misused.
</description>
<tutorials>
+ <link title="When and how to avoid using nodes for everything">https://docs.godotengine.org/en/latest/getting_started/workflow/best_practices/node_alternatives.html</link>
</tutorials>
<methods>
<method name="init_ref">
diff --git a/doc/classes/ReferenceRect.xml b/doc/classes/ReferenceRect.xml
index 4f8f71b3db..1a3fbbdfc5 100644
--- a/doc/classes/ReferenceRect.xml
+++ b/doc/classes/ReferenceRect.xml
@@ -4,7 +4,7 @@
Reference frame for GUI.
</brief_description>
<description>
- A rectangle box that displays only a [member border_color] border color around its rectangle. [ReferenceRect] has no fill [Color].
+ A rectangle box that displays only a [member border_color] border color around its rectangle. [ReferenceRect] has no fill [Color]. If you need to display a rectangle filled with a solid color, consider using [ColorRect] instead.
</description>
<tutorials>
</tutorials>
@@ -14,6 +14,9 @@
<member name="border_color" type="Color" setter="set_border_color" getter="get_border_color" default="Color( 1, 0, 0, 1 )">
Sets the border [Color] of the [ReferenceRect].
</member>
+ <member name="border_width" type="float" setter="set_border_width" getter="get_border_width" default="1.0">
+ Sets the border width of the [ReferenceRect]. The border grows both inwards and outwards with respect to the rectangle box.
+ </member>
<member name="editor_only" type="bool" setter="set_editor_only" getter="get_editor_only" default="true">
If set to [code]true[/code], the [ReferenceRect] will only be visible while in editor. Otherwise, [ReferenceRect] will be visible in game.
</member>
diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml
index 84f87c3e71..5458b496da 100644
--- a/doc/classes/ReflectionProbe.xml
+++ b/doc/classes/ReflectionProbe.xml
@@ -8,11 +8,17 @@
The [ReflectionProbe] is used to create high-quality reflections at the cost of performance. It can be combined with [GIProbe]s and Screen Space Reflections to achieve high quality reflections. [ReflectionProbe]s render all objects within their [member cull_mask], so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/reflection_probes.html</link>
+ <link title="Reflection probes">https://docs.godotengine.org/en/latest/tutorials/3d/reflection_probes.html</link>
</tutorials>
<methods>
</methods>
<members>
+ <member name="ambient_color" type="Color" setter="set_ambient_color" getter="get_ambient_color" default="Color( 0, 0, 0, 1 )">
+ </member>
+ <member name="ambient_color_energy" type="float" setter="set_ambient_color_energy" getter="get_ambient_color_energy" default="1.0">
+ </member>
+ <member name="ambient_mode" type="int" setter="set_ambient_mode" getter="get_ambient_mode" enum="ReflectionProbe.AmbientMode" default="1">
+ </member>
<member name="box_projection" type="bool" setter="set_enable_box_projection" getter="is_box_projection_enabled" default="false">
If [code]true[/code], enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera's location.
</member>
@@ -28,17 +34,8 @@
<member name="intensity" type="float" setter="set_intensity" getter="get_intensity" default="1.0">
Defines the reflection intensity. Intensity modulates the strength of the reflection.
</member>
- <member name="interior_ambient_color" type="Color" setter="set_interior_ambient" getter="get_interior_ambient" default="Color( 0, 0, 0, 1 )">
- Sets the ambient light color to be used when this probe is set to [member interior_enable].
- </member>
- <member name="interior_ambient_contrib" type="float" setter="set_interior_ambient_probe_contribution" getter="get_interior_ambient_probe_contribution" default="0.0">
- Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to [member interior_enable]. Useful so that ambient light matches the color of the room.
- </member>
- <member name="interior_ambient_energy" type="float" setter="set_interior_ambient_energy" getter="get_interior_ambient_energy" default="1.0">
- Sets the energy multiplier for this reflection probe's ambient light contribution when set to [member interior_enable].
- </member>
- <member name="interior_enable" type="bool" setter="set_as_interior" getter="is_set_as_interior" default="false">
- If [code]true[/code], reflections will ignore sky contribution. Ambient lighting is then controlled by the [code]interior_ambient_*[/code] properties.
+ <member name="interior" type="bool" setter="set_as_interior" getter="is_set_as_interior" default="false">
+ If [code]true[/code], reflections will ignore sky contribution.
</member>
<member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="0.0">
Sets the max distance away from the probe an object can be before it is culled.
@@ -57,5 +54,11 @@
<constant name="UPDATE_ALWAYS" value="1" enum="UpdateMode">
Update the probe every frame. This is needed when you want to capture dynamic objects. However, it results in an increased render time. Use [constant UPDATE_ONCE] whenever possible.
</constant>
+ <constant name="AMBIENT_DISABLED" value="0" enum="AmbientMode">
+ </constant>
+ <constant name="AMBIENT_ENVIRONMENT" value="1" enum="AmbientMode">
+ </constant>
+ <constant name="AMBIENT_COLOR" value="2" enum="AmbientMode">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml
index 8a44d213e8..7e5df9c40d 100644
--- a/doc/classes/RenderingDevice.xml
+++ b/doc/classes/RenderingDevice.xml
@@ -152,6 +152,8 @@
</argument>
<argument index="8" name="region" type="Rect2" default="Rect2i( 0, 0, 0, 0 )">
</argument>
+ <argument index="9" name="storage_textures" type="Array" default="[ ]">
+ </argument>
<description>
</description>
</method>
@@ -188,6 +190,8 @@
</argument>
<argument index="9" name="region" type="Rect2" default="Rect2i( 0, 0, 0, 0 )">
</argument>
+ <argument index="10" name="storage_textures" type="RID[]" default="[ ]">
+ </argument>
<description>
</description>
</method>
@@ -293,6 +297,16 @@
<description>
</description>
</method>
+ <method name="framebuffer_create_empty">
+ <return type="RID">
+ </return>
+ <argument index="0" name="size" type="Vector2i">
+ </argument>
+ <argument index="1" name="validate_with_format" type="int" default="-1">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="framebuffer_format_create">
<return type="int">
</return>
@@ -301,6 +315,14 @@
<description>
</description>
</method>
+ <method name="framebuffer_format_create_empty">
+ <return type="int">
+ </return>
+ <argument index="0" name="size" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="framebuffer_format_get_texture_samples">
<return type="int" enum="RenderingDevice.TextureSamples">
</return>
@@ -496,6 +518,8 @@
</argument>
<argument index="1" name="data" type="PackedByteArray" default="PackedByteArray( )">
</argument>
+ <argument index="2" name="usage" type="int" default="0">
+ </argument>
<description>
</description>
</method>
@@ -1285,6 +1309,8 @@
</constant>
<constant name="INDEX_BUFFER_FORMAT_UINT32" value="1" enum="IndexBufferFormat">
</constant>
+ <constant name="STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT" value="1" enum="StorageBufferUsage">
+ </constant>
<constant name="UNIFORM_TYPE_SAMPLER" value="0" enum="UniformType">
</constant>
<constant name="UNIFORM_TYPE_SAMPLER_WITH_TEXTURE" value="1" enum="UniformType">
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 4e0762a68b..5830a8452c 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -9,13 +9,13 @@
The rendering server can be used to bypass the scene system entirely.
Resources are created using the [code]*_create[/code] functions.
All objects are drawn to a viewport. You can use the [Viewport] attached to the [SceneTree] or you can create one yourself with [method viewport_create]. When using a custom scenario or canvas, the scenario or canvas needs to be attached to the viewport using [method viewport_set_scenario] or [method viewport_attach_canvas].
- In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the rendering server from a running game, the scenario can be accessed from the scene tree from any [Node3D] node with [method Node3D.get_world]. Otherwise, a scenario can be created with [method scenario_create].
+ In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the rendering server from a running game, the scenario can be accessed from the scene tree from any [Node3D] node with [method Node3D.get_world_3d]. Otherwise, a scenario can be created with [method scenario_create].
Similarly in 2D, a canvas is needed to draw all canvas items.
In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using [method instance_set_base]. The instance must also be attached to the scenario using [method instance_set_scenario] in order to be visible.
In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/optimization/using_servers.html</link>
+ <link title="Optimization using Servers">https://docs.godotengine.org/en/latest/tutorials/optimization/using_servers.html</link>
</tutorials>
<methods>
<method name="black_bars_set_images">
@@ -404,28 +404,6 @@
The mode of the light, see [enum CanvasLightMode] constants.
</description>
</method>
- <method name="canvas_light_set_scale">
- <return type="void">
- </return>
- <argument index="0" name="light" type="RID">
- </argument>
- <argument index="1" name="scale" type="float">
- </argument>
- <description>
- Sets the texture's scale factor of the light. Equivalent to [member Light2D.texture_scale].
- </description>
- </method>
- <method name="canvas_light_set_shadow_buffer_size">
- <return type="void">
- </return>
- <argument index="0" name="light" type="RID">
- </argument>
- <argument index="1" name="size" type="int">
- </argument>
- <description>
- Sets the width of the shadow buffer, size gets scaled to the next power of two for this.
- </description>
- </method>
<method name="canvas_light_set_shadow_color">
<return type="void">
</return>
@@ -478,7 +456,7 @@
<argument index="1" name="texture" type="RID">
</argument>
<description>
- Sets texture to be used by light. Equivalent to [member Light2D.texture].
+ Sets the texture to be used by a [PointLight2D]. Equivalent to [member PointLight2D.texture].
</description>
</method>
<method name="canvas_light_set_texture_offset">
@@ -489,7 +467,18 @@
<argument index="1" name="offset" type="Vector2">
</argument>
<description>
- Sets the offset of the light's texture. Equivalent to [member Light2D.offset].
+ Sets the offset of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.offset].
+ </description>
+ </method>
+ <method name="canvas_light_set_texture_scale">
+ <return type="void">
+ </return>
+ <argument index="0" name="light" type="RID">
+ </argument>
+ <argument index="1" name="scale" type="float">
+ </argument>
+ <description>
+ Sets the scale factor of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.texture_scale].
</description>
</method>
<method name="canvas_light_set_transform">
@@ -583,6 +572,12 @@
Modulates all colors in the given canvas.
</description>
</method>
+ <method name="create_local_rendering_device" qualifiers="const">
+ <return type="RenderingDevice">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="directional_light_create">
<return type="RID">
</return>
@@ -690,52 +685,21 @@
</argument>
<argument index="1" name="enable" type="bool">
</argument>
- <argument index="2" name="color" type="Color">
- </argument>
- <argument index="3" name="sun_color" type="Color">
- </argument>
- <argument index="4" name="sun_amount" type="float">
- </argument>
- <description>
- Sets the variables to be used with the scene fog. See [Environment] for more details.
- </description>
- </method>
- <method name="environment_set_fog_depth">
- <return type="void">
- </return>
- <argument index="0" name="env" type="RID">
- </argument>
- <argument index="1" name="enable" type="bool">
- </argument>
- <argument index="2" name="depth_begin" type="float">
- </argument>
- <argument index="3" name="depth_end" type="float">
- </argument>
- <argument index="4" name="depth_curve" type="float">
- </argument>
- <argument index="5" name="transmit" type="bool">
+ <argument index="2" name="light_color" type="Color">
</argument>
- <argument index="6" name="transmit_curve" type="float">
+ <argument index="3" name="light_energy" type="float">
</argument>
- <description>
- Sets the variables to be used with the fog depth effect. See [Environment] for more details.
- </description>
- </method>
- <method name="environment_set_fog_height">
- <return type="void">
- </return>
- <argument index="0" name="env" type="RID">
+ <argument index="4" name="sun_scatter" type="float">
</argument>
- <argument index="1" name="enable" type="bool">
+ <argument index="5" name="density" type="float">
</argument>
- <argument index="2" name="min_height" type="float">
+ <argument index="6" name="height" type="float">
</argument>
- <argument index="3" name="max_height" type="float">
+ <argument index="7" name="height_density" type="float">
</argument>
- <argument index="4" name="height_curve" type="float">
+ <argument index="8" name="aerial_perspective" type="float">
</argument>
<description>
- Sets the variables to be used with the fog height effect. See [Environment] for more details.
</description>
</method>
<method name="environment_set_glow">
@@ -745,7 +709,7 @@
</argument>
<argument index="1" name="enable" type="bool">
</argument>
- <argument index="2" name="level_flags" type="int">
+ <argument index="2" name="levels" type="PackedFloat32Array">
</argument>
<argument index="3" name="intensity" type="float">
</argument>
@@ -1282,7 +1246,7 @@
<argument index="1" name="base" type="RID">
</argument>
<description>
- Sets the base of the instance. A base can be any of the 3D objects that are created in the RenderingServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap capture, and the GI probe are all types that can be set as the base of an instance in order to be displayed in the scenario.
+ Sets the base of the instance. A base can be any of the 3D objects that are created in the RenderingServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap, and the GI probe are all types that can be set as the base of an instance in order to be displayed in the scenario.
</description>
</method>
<method name="instance_set_blend_shape_weight">
@@ -1377,19 +1341,6 @@
Sets the world space transform of the instance. Equivalent to [member Node3D.transform].
</description>
</method>
- <method name="instance_set_use_lightmap">
- <return type="void">
- </return>
- <argument index="0" name="instance" type="RID">
- </argument>
- <argument index="1" name="lightmap_instance" type="RID">
- </argument>
- <argument index="2" name="lightmap" type="RID">
- </argument>
- <description>
- Sets the lightmap to use with this instance.
- </description>
- </method>
<method name="instance_set_visible">
<return type="void">
</return>
@@ -1483,6 +1434,16 @@
Sets whether to use a dual paraboloid or a cubemap for the shadow map. Dual paraboloid is faster but may suffer from artifacts. Equivalent to [member OmniLight3D.omni_shadow_mode].
</description>
</method>
+ <method name="light_set_bake_mode">
+ <return type="void">
+ </return>
+ <argument index="0" name="light" type="RID">
+ </argument>
+ <argument index="1" name="bake_mode" type="int" enum="RenderingServer.LightBakeMode">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="light_set_color">
<return type="void">
</return>
@@ -1573,126 +1534,6 @@
Sets the color of the shadow cast by the light. Equivalent to [member Light3D.shadow_color].
</description>
</method>
- <method name="light_set_use_gi">
- <return type="void">
- </return>
- <argument index="0" name="light" type="RID">
- </argument>
- <argument index="1" name="enabled" type="bool">
- </argument>
- <description>
- Sets whether GI probes capture light information from this light.
- </description>
- </method>
- <method name="lightmap_capture_create">
- <return type="RID">
- </return>
- <description>
- Creates a lightmap capture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]lightmap_capture_*[/code] RenderingServer functions.
- Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
- To place in a scene, attach this lightmap capture to an instance using [method instance_set_base] using the returned RID.
- </description>
- </method>
- <method name="lightmap_capture_get_bounds" qualifiers="const">
- <return type="AABB">
- </return>
- <argument index="0" name="capture" type="RID">
- </argument>
- <description>
- Returns the size of the lightmap capture area.
- </description>
- </method>
- <method name="lightmap_capture_get_energy" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="capture" type="RID">
- </argument>
- <description>
- Returns the energy multiplier used by the lightmap capture.
- </description>
- </method>
- <method name="lightmap_capture_get_octree" qualifiers="const">
- <return type="PackedByteArray">
- </return>
- <argument index="0" name="capture" type="RID">
- </argument>
- <description>
- Returns the octree used by the lightmap capture.
- </description>
- </method>
- <method name="lightmap_capture_get_octree_cell_subdiv" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="capture" type="RID">
- </argument>
- <description>
- Returns the cell subdivision amount used by this lightmap capture's octree.
- </description>
- </method>
- <method name="lightmap_capture_get_octree_cell_transform" qualifiers="const">
- <return type="Transform">
- </return>
- <argument index="0" name="capture" type="RID">
- </argument>
- <description>
- Returns the cell transform for this lightmap capture's octree.
- </description>
- </method>
- <method name="lightmap_capture_set_bounds">
- <return type="void">
- </return>
- <argument index="0" name="capture" type="RID">
- </argument>
- <argument index="1" name="bounds" type="AABB">
- </argument>
- <description>
- Sets the size of the area covered by the lightmap capture.
- </description>
- </method>
- <method name="lightmap_capture_set_energy">
- <return type="void">
- </return>
- <argument index="0" name="capture" type="RID">
- </argument>
- <argument index="1" name="energy" type="float">
- </argument>
- <description>
- Sets the energy multiplier for this lightmap capture.
- </description>
- </method>
- <method name="lightmap_capture_set_octree">
- <return type="void">
- </return>
- <argument index="0" name="capture" type="RID">
- </argument>
- <argument index="1" name="octree" type="PackedByteArray">
- </argument>
- <description>
- Sets the octree to be used by this lightmap capture.
- </description>
- </method>
- <method name="lightmap_capture_set_octree_cell_subdiv">
- <return type="void">
- </return>
- <argument index="0" name="capture" type="RID">
- </argument>
- <argument index="1" name="subdiv" type="int">
- </argument>
- <description>
- Sets the subdivision level of this lightmap capture's octree.
- </description>
- </method>
- <method name="lightmap_capture_set_octree_cell_transform">
- <return type="void">
- </return>
- <argument index="0" name="capture" type="RID">
- </argument>
- <argument index="1" name="xform" type="Transform">
- </argument>
- <description>
- Sets the octree cell transform for this lightmap capture's octree.
- </description>
- </method>
<method name="make_sphere_mesh">
<return type="RID">
</return>
@@ -1783,7 +1624,6 @@
<argument index="3" name="blend_shapes" type="Array" default="[ ]">
</argument>
<argument index="4" name="lods" type="Dictionary" default="{
-
}">
</argument>
<argument index="5" name="compress_format" type="int" default="31744">
@@ -2414,40 +2254,37 @@
To place in a scene, attach this reflection probe to an instance using [method instance_set_base] using the returned RID.
</description>
</method>
- <method name="reflection_probe_set_as_interior">
+ <method name="reflection_probe_set_ambient_color">
<return type="void">
</return>
<argument index="0" name="probe" type="RID">
</argument>
- <argument index="1" name="enable" type="bool">
+ <argument index="1" name="color" type="Color">
</argument>
<description>
- If [code]true[/code], reflections will ignore sky contribution. Equivalent to [member ReflectionProbe.interior_enable].
</description>
</method>
- <method name="reflection_probe_set_cull_mask">
+ <method name="reflection_probe_set_ambient_energy">
<return type="void">
</return>
<argument index="0" name="probe" type="RID">
</argument>
- <argument index="1" name="layers" type="int">
+ <argument index="1" name="energy" type="float">
</argument>
<description>
- Sets the render cull mask for this reflection probe. Only instances with a matching cull mask will be rendered by this probe. Equivalent to [member ReflectionProbe.cull_mask].
</description>
</method>
- <method name="reflection_probe_set_enable_box_projection">
+ <method name="reflection_probe_set_ambient_mode">
<return type="void">
</return>
<argument index="0" name="probe" type="RID">
</argument>
- <argument index="1" name="enable" type="bool">
+ <argument index="1" name="mode" type="int" enum="RenderingServer.ReflectionProbeAmbientMode">
</argument>
<description>
- If [code]true[/code], uses box projection. This can make reflections look more correct in certain situations. Equivalent to [member ReflectionProbe.box_projection].
</description>
</method>
- <method name="reflection_probe_set_enable_shadows">
+ <method name="reflection_probe_set_as_interior">
<return type="void">
</return>
<argument index="0" name="probe" type="RID">
@@ -2455,62 +2292,62 @@
<argument index="1" name="enable" type="bool">
</argument>
<description>
- If [code]true[/code], computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to [member ReflectionProbe.enable_shadows].
+ If [code]true[/code], reflections will ignore sky contribution. Equivalent to [member ReflectionProbe.interior].
</description>
</method>
- <method name="reflection_probe_set_extents">
+ <method name="reflection_probe_set_cull_mask">
<return type="void">
</return>
<argument index="0" name="probe" type="RID">
</argument>
- <argument index="1" name="extents" type="Vector3">
+ <argument index="1" name="layers" type="int">
</argument>
<description>
- Sets the size of the area that the reflection probe will capture. Equivalent to [member ReflectionProbe.extents].
+ Sets the render cull mask for this reflection probe. Only instances with a matching cull mask will be rendered by this probe. Equivalent to [member ReflectionProbe.cull_mask].
</description>
</method>
- <method name="reflection_probe_set_intensity">
+ <method name="reflection_probe_set_enable_box_projection">
<return type="void">
</return>
<argument index="0" name="probe" type="RID">
</argument>
- <argument index="1" name="intensity" type="float">
+ <argument index="1" name="enable" type="bool">
</argument>
<description>
- Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to [member ReflectionProbe.intensity].
+ If [code]true[/code], uses box projection. This can make reflections look more correct in certain situations. Equivalent to [member ReflectionProbe.box_projection].
</description>
</method>
- <method name="reflection_probe_set_interior_ambient">
+ <method name="reflection_probe_set_enable_shadows">
<return type="void">
</return>
<argument index="0" name="probe" type="RID">
</argument>
- <argument index="1" name="color" type="Color">
+ <argument index="1" name="enable" type="bool">
</argument>
<description>
- Sets the ambient light color for this reflection probe when set to interior mode. Equivalent to [member ReflectionProbe.interior_ambient_color].
+ If [code]true[/code], computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to [member ReflectionProbe.enable_shadows].
</description>
</method>
- <method name="reflection_probe_set_interior_ambient_energy">
+ <method name="reflection_probe_set_extents">
<return type="void">
</return>
<argument index="0" name="probe" type="RID">
</argument>
- <argument index="1" name="energy" type="float">
+ <argument index="1" name="extents" type="Vector3">
</argument>
<description>
- Sets the energy multiplier for this reflection probes ambient light contribution when set to interior mode. Equivalent to [member ReflectionProbe.interior_ambient_energy].
+ Sets the size of the area that the reflection probe will capture. Equivalent to [member ReflectionProbe.extents].
</description>
</method>
- <method name="reflection_probe_set_interior_ambient_probe_contribution">
+ <method name="reflection_probe_set_intensity">
<return type="void">
</return>
<argument index="0" name="probe" type="RID">
</argument>
- <argument index="1" name="contrib" type="float">
+ <argument index="1" name="intensity" type="float">
</argument>
<description>
- Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to interior mode. Useful so that ambient light matches the color of the room. Equivalent to [member ReflectionProbe.interior_ambient_contrib].
+ Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to [member ReflectionProbe.intensity].
</description>
</method>
<method name="reflection_probe_set_max_distance">
@@ -3119,6 +2956,16 @@
Sets when the viewport should be updated. See [enum ViewportUpdateMode] constants for options.
</description>
</method>
+ <method name="viewport_set_use_debanding">
+ <return type="void">
+ </return>
+ <argument index="0" name="viewport" type="RID">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="viewport_set_use_xr">
<return type="void">
</return>
@@ -3131,6 +2978,11 @@
</description>
</method>
</methods>
+ <members>
+ <member name="render_loop_enabled" type="bool" setter="set_render_loop_enabled" getter="is_render_loop_enabled">
+ If [code]false[/code], disables rendering completely, but the engine logic is still being processed. You can call [method force_draw] to draw a frame even with rendering disabled.
+ </member>
+ </members>
<signals>
<signal name="frame_post_draw">
<description>
@@ -3373,11 +3225,17 @@
<constant name="LIGHT_PARAM_SHADOW_BLUR" value="16" enum="LightParam">
Blurs the edges of the shadow. Can be used to hide pixel artifacts in low resolution shadow maps. A high value can make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible.
</constant>
- <constant name="LIGHT_PARAM_TRANSMITTANCE_BIAS" value="17" enum="LightParam">
+ <constant name="LIGHT_PARAM_TRANSMITTANCE_BIAS" value="18" enum="LightParam">
</constant>
- <constant name="LIGHT_PARAM_MAX" value="18" enum="LightParam">
+ <constant name="LIGHT_PARAM_MAX" value="19" enum="LightParam">
Represents the size of the [enum LightParam] enum.
</constant>
+ <constant name="LIGHT_BAKE_DISABLED" value="0" enum="LightBakeMode">
+ </constant>
+ <constant name="LIGHT_BAKE_DYNAMIC" value="1" enum="LightBakeMode">
+ </constant>
+ <constant name="LIGHT_BAKE_STATIC" value="2" enum="LightBakeMode">
+ </constant>
<constant name="LIGHT_OMNI_SHADOW_DUAL_PARABOLOID" value="0" enum="LightOmniShadowMode">
Use a dual paraboloid shadow map for omni lights.
</constant>
@@ -3405,6 +3263,12 @@
<constant name="REFLECTION_PROBE_UPDATE_ALWAYS" value="1" enum="ReflectionProbeUpdateMode">
Reflection probe will update each frame. This mode is necessary to capture moving objects.
</constant>
+ <constant name="REFLECTION_PROBE_AMBIENT_DISABLED" value="0" enum="ReflectionProbeAmbientMode">
+ </constant>
+ <constant name="REFLECTION_PROBE_AMBIENT_ENVIRONMENT" value="1" enum="ReflectionProbeAmbientMode">
+ </constant>
+ <constant name="REFLECTION_PROBE_AMBIENT_COLOR" value="2" enum="ReflectionProbeAmbientMode">
+ </constant>
<constant name="DECAL_TEXTURE_ALBEDO" value="0" enum="DecalTexture">
</constant>
<constant name="DECAL_TEXTURE_NORMAL" value="1" enum="DecalTexture">
@@ -3529,18 +3393,21 @@
<constant name="VIEWPORT_DEBUG_DRAW_SSAO" value="12" enum="ViewportDebugDraw">
Draws the screen space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssao_enabled] set in your [WorldEnvironment].
</constant>
- <constant name="VIEWPORT_DEBUG_DRAW_ROUGHNESS_LIMITER" value="13" enum="ViewportDebugDraw">
- Draws the roughness limiter post process over the Viewport so you can see where it has an effect. It must be enabled in [member ProjectSettings.rendering/quality/screen_filters/screen_space_roughness_limiter] to work.
- </constant>
- <constant name="VIEWPORT_DEBUG_DRAW_PSSM_SPLITS" value="14" enum="ViewportDebugDraw">
+ <constant name="VIEWPORT_DEBUG_DRAW_PSSM_SPLITS" value="13" enum="ViewportDebugDraw">
Colors each PSSM split for the [DirectionalLight3D]s in the scene a different color so you can see where the splits are. In order they will be colored red, green, blue, yellow.
</constant>
- <constant name="VIEWPORT_DEBUG_DRAW_DECAL_ATLAS" value="15" enum="ViewportDebugDraw">
+ <constant name="VIEWPORT_DEBUG_DRAW_DECAL_ATLAS" value="14" enum="ViewportDebugDraw">
+ </constant>
+ <constant name="VIEWPORT_DEBUG_DRAW_SDFGI" value="15" enum="ViewportDebugDraw">
</constant>
- <constant name="SKY_MODE_QUALITY" value="0" enum="SkyMode">
+ <constant name="VIEWPORT_DEBUG_DRAW_SDFGI_PROBES" value="16" enum="ViewportDebugDraw">
+ </constant>
+ <constant name="VIEWPORT_DEBUG_DRAW_GI_BUFFER" value="17" enum="ViewportDebugDraw">
+ </constant>
+ <constant name="SKY_MODE_QUALITY" value="1" enum="SkyMode">
Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than [constant Sky.PROCESS_MODE_REALTIME] but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing [member ProjectSettings.rendering/quality/reflections/ggx_samples].
</constant>
- <constant name="SKY_MODE_REALTIME" value="1" enum="SkyMode">
+ <constant name="SKY_MODE_REALTIME" value="3" enum="SkyMode">
Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times.
[b]Note:[/b] The fast filtering algorithm is limited to 256x256 cubemaps, so [member Sky.radiance_size] must be set to [constant Sky.RADIANCE_SIZE_256].
</constant>
@@ -3713,22 +3580,24 @@
<constant name="INSTANCE_PARTICLES" value="4" enum="InstanceType">
The instance is a particle emitter.
</constant>
- <constant name="INSTANCE_LIGHT" value="5" enum="InstanceType">
+ <constant name="INSTANCE_PARTICLES_COLLISION" value="5" enum="InstanceType">
+ </constant>
+ <constant name="INSTANCE_LIGHT" value="6" enum="InstanceType">
The instance is a light.
</constant>
- <constant name="INSTANCE_REFLECTION_PROBE" value="6" enum="InstanceType">
+ <constant name="INSTANCE_REFLECTION_PROBE" value="7" enum="InstanceType">
The instance is a reflection probe.
</constant>
- <constant name="INSTANCE_DECAL" value="7" enum="InstanceType">
+ <constant name="INSTANCE_DECAL" value="8" enum="InstanceType">
The instance is a decal.
</constant>
- <constant name="INSTANCE_GI_PROBE" value="8" enum="InstanceType">
+ <constant name="INSTANCE_GI_PROBE" value="9" enum="InstanceType">
The instance is a GI probe.
</constant>
- <constant name="INSTANCE_LIGHTMAP_CAPTURE" value="9" enum="InstanceType">
- The instance is a lightmap capture.
+ <constant name="INSTANCE_LIGHTMAP" value="10" enum="InstanceType">
+ The instance is a lightmap.
</constant>
- <constant name="INSTANCE_MAX" value="10" enum="InstanceType">
+ <constant name="INSTANCE_MAX" value="11" enum="InstanceType">
Represents the size of the [enum InstanceType] enum.
</constant>
<constant name="INSTANCE_GEOMETRY_MASK" value="30" enum="InstanceType">
@@ -3806,18 +3675,25 @@
<constant name="CANVAS_ITEM_TEXTURE_REPEAT_MAX" value="4" enum="CanvasItemTextureRepeat">
Max value for [enum CanvasItemTextureRepeat] enum.
</constant>
- <constant name="CANVAS_LIGHT_MODE_ADD" value="0" enum="CanvasLightMode">
+ <constant name="CANVAS_GROUP_MODE_DISABLED" value="0" enum="CanvasGroupMode">
+ </constant>
+ <constant name="CANVAS_GROUP_MODE_OPAQUE" value="1" enum="CanvasGroupMode">
+ </constant>
+ <constant name="CANVAS_GROUP_MODE_TRANSPARENT" value="2" enum="CanvasGroupMode">
+ </constant>
+ <constant name="CANVAS_LIGHT_MODE_POINT" value="0" enum="CanvasLightMode">
+ </constant>
+ <constant name="CANVAS_LIGHT_MODE_DIRECTIONAL" value="1" enum="CanvasLightMode">
+ </constant>
+ <constant name="CANVAS_LIGHT_BLEND_MODE_ADD" value="0" enum="CanvasLightBlendMode">
Adds light color additive to the canvas.
</constant>
- <constant name="CANVAS_LIGHT_MODE_SUB" value="1" enum="CanvasLightMode">
+ <constant name="CANVAS_LIGHT_BLEND_MODE_SUB" value="1" enum="CanvasLightBlendMode">
Adds light color subtractive to the canvas.
</constant>
- <constant name="CANVAS_LIGHT_MODE_MIX" value="2" enum="CanvasLightMode">
+ <constant name="CANVAS_LIGHT_BLEND_MODE_MIX" value="2" enum="CanvasLightBlendMode">
The light adds color depending on transparency.
</constant>
- <constant name="CANVAS_LIGHT_MODE_MASK" value="3" enum="CanvasLightMode">
- The light adds color depending on mask.
- </constant>
<constant name="CANVAS_LIGHT_FILTER_NONE" value="0" enum="CanvasLightShadowFilter">
Do not apply a filter to canvas light shadows.
</constant>
diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml
index 5bc34772c8..e79a2e0ea9 100644
--- a/doc/classes/Resource.xml
+++ b/doc/classes/Resource.xml
@@ -4,10 +4,11 @@
Base class for all resources.
</brief_description>
<description>
- Resource is the base class for all Godot-specific resource types, serving primarily as data containers. They are reference counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a [Node], which is not reference counted and can be instanced from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a [Node] or another resource.
+ Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Unlike [Object]s, they are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a [Node], which is not reference-counted and can be instanced from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a [Node] or another resource.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/resources.html</link>
+ <link title="Resources">https://docs.godotengine.org/en/latest/getting_started/step_by_step/resources.html</link>
+ <link title="When and how to avoid using nodes for everything">https://docs.godotengine.org/en/latest/getting_started/workflow/best_practices/node_alternatives.html</link>
</tutorials>
<methods>
<method name="_setup_local_to_scene" qualifiers="virtual">
@@ -23,7 +24,8 @@
<argument index="0" name="subresources" type="bool" default="false">
</argument>
<description>
- Duplicates the resource, returning a new resource. By default, sub-resources are shared between resource copies for efficiency, this can be changed by passing [code]true[/code] to the [code]subresources[/code] argument.
+ Duplicates the resource, returning a new resource. By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing [code]true[/code] to the [code]subresources[/code] argument which will copy the subresources.
+ [b]Note:[/b] If [code]subresources[/code] is [code]true[/code], this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared.
</description>
</method>
<method name="get_local_scene" qualifiers="const">
diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml
index 713f2c1726..ad0c438f98 100644
--- a/doc/classes/ResourceFormatLoader.xml
+++ b/doc/classes/ResourceFormatLoader.xml
@@ -6,7 +6,7 @@
<description>
Godot loads resources in the editor or in exported games using ResourceFormatLoaders. They are queried automatically via the [ResourceLoader] singleton, or when a resource with internal dependencies is loaded. Each file type may load as a different resource type, so multiple ResourceFormatLoaders are registered in the engine.
Extending this class allows you to define your own loader. Be sure to respect the documented return types and values. You should give it a global class name with [code]class_name[/code] for it to be registered. Like built-in ResourceFormatLoaders, it will be called automatically when loading resources of its handled type(s). You may also implement a [ResourceFormatSaver].
- [b]Note:[/b] You can also extend [EditorImportPlugin] if the resource type you need exists but Godot is unable to load its format. Choosing one way over another depends if the format is suitable or not for the final exported game. For example, it's better to import [code].png[/code] textures as [code].stex[/code] ([StreamTexture]) first, so they can be loaded with better efficiency on the graphics card.
+ [b]Note:[/b] You can also extend [EditorImportPlugin] if the resource type you need exists but Godot is unable to load its format. Choosing one way over another depends if the format is suitable or not for the final exported game. For example, it's better to import [code].png[/code] textures as [code].stex[/code] ([StreamTexture2D]) first, so they can be loaded with better efficiency on the graphics card.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml
index 1cf775f389..049613fa5d 100644
--- a/doc/classes/ResourceLoader.xml
+++ b/doc/classes/ResourceLoader.xml
@@ -6,9 +6,9 @@
<description>
Singleton used to load resource files from the filesystem.
It uses the many [ResourceFormatLoader] classes registered in the engine (either built-in or from a plugin) to load files into memory and convert them to a format that can be used by the engine.
- GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios.
</description>
<tutorials>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
<method name="exists">
@@ -65,7 +65,8 @@
The registered [ResourceFormatLoader]s are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted.
An optional [code]type_hint[/code] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader].
If [code]no_cache[/code] is [code]true[/code], the resource cache will be bypassed and the resource will be loaded anew. Otherwise, the cached resource will be returned if it exists.
- Returns an empty resource if no ResourceFormatLoader could handle the file.
+ Returns an empty resource if no [ResourceFormatLoader] could handle the file.
+ GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios.
</description>
</method>
<method name="load_threaded_get">
diff --git a/doc/classes/RichTextEffect.xml b/doc/classes/RichTextEffect.xml
index 34431c5153..726b26fbc7 100644
--- a/doc/classes/RichTextEffect.xml
+++ b/doc/classes/RichTextEffect.xml
@@ -13,8 +13,8 @@
[b]Note:[/b] As soon as a [RichTextLabel] contains at least one [RichTextEffect], it will continuously process the effect unless the project is paused. This may impact battery life negatively.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link>
- <link>https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
+ <link title="BBCode in RichTextLabel">https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link>
+ <link title="RichTextEffect test project (third-party)">https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
</tutorials>
<methods>
<method name="_process_custom_fx" qualifiers="virtual">
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index efc0c9d600..faf0d97766 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -6,9 +6,12 @@
<description>
Rich text can contain custom text, fonts, images and some basic formatting. The label manages these as an internal tag stack. It also adapts itself to given width/heights.
[b]Note:[/b] Assignments to [member bbcode_text] clear the tag stack and reconstruct it from the property's contents. Any edits made to [member bbcode_text] will erase previous edits made from other manual sources such as [method append_bbcode] and the [code]push_*[/code] / [method pop] methods.
+ [b]Note:[/b] Unlike [Label], RichTextLabel doesn't have a [i]property[/i] to horizontally align text to the center. Instead, enable [member bbcode_enabled] and surround the text in a [code][center][/code] tag as follows: [code][center]Example[/center][/code]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the [member fit_content_height] property.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link>
+ <link title="BBCode in RichTextLabel">https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link>
+ <link title="GUI Rich Text/BBcode Demo">https://godotengine.org/asset-library/asset/132</link>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
<method name="add_image">
@@ -20,8 +23,10 @@
</argument>
<argument index="2" name="height" type="int" default="0">
</argument>
+ <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
<description>
- Adds an image's opening and closing tags to the tag stack, optionally providing a [code]width[/code] and [code]height[/code] to resize the image.
+ Adds an image's opening and closing tags to the tag stack, optionally providing a [code]width[/code] and [code]height[/code] to resize the image and a [code]color[/code] to tint the image.
If [code]width[/code] or [code]height[/code] is set to 0, the image size will be adjusted in order to keep the original aspect ratio.
</description>
</method>
@@ -41,6 +46,7 @@
</argument>
<description>
Parses [code]bbcode[/code] and adds tags to the tag stack as needed. Returns the result of the parsing, [constant OK] if successful.
+ [b]Note:[/b] Using this method, you can't close a tag that was opened in a previous [method append_bbcode] call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [member bbcode_text] instead of using [method append_bbcode].
</description>
</method>
<method name="clear">
@@ -50,7 +56,7 @@
Clears the tag stack and sets [member bbcode_text] to an empty string.
</description>
</method>
- <method name="get_content_height">
+ <method name="get_content_height" qualifiers="const">
<return type="int">
</return>
<description>
@@ -286,12 +292,16 @@
</member>
<member name="bbcode_text" type="String" setter="set_bbcode" getter="get_bbcode" default="&quot;&quot;">
The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited.
- [b]Note:[/b] It is unadvised to use [code]+=[/code] operator with [code]bbcode_text[/code] (e.g. [code]bbcode_text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_bbcode] for adding text instead.
+ [b]Note:[/b] It is unadvised to use the [code]+=[/code] operator with [code]bbcode_text[/code] (e.g. [code]bbcode_text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_bbcode] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
</member>
<member name="custom_effects" type="Array" setter="set_effects" getter="get_effects" default="[ ]">
The currently installed custom effects. This is an array of [RichTextEffect]s.
To add a custom effect, it's more convenient to use [method install_effect].
</member>
+ <member name="fit_content_height" type="bool" setter="set_fit_content_height" getter="is_fit_content_height_enabled" default="false">
+ If [code]true[/code], the label's height will be automatically updated to fit its content.
+ [b]Note:[/b] This property is used as a workaround to fix issues with [RichTextLabel] in [Container]s, but it's unreliable in some cases and will be removed in future versions.
+ </member>
<member name="meta_underlined" type="bool" setter="set_meta_underline" getter="is_meta_underlined" default="true">
If [code]true[/code], the label underlines meta tags such as [code][url]{text}[/url][/code].
</member>
diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml
index 8379fc5b58..6f41d5ba27 100644
--- a/doc/classes/RigidBody2D.xml
+++ b/doc/classes/RigidBody2D.xml
@@ -9,8 +9,11 @@
[b]Note:[/b] You should not change a RigidBody2D's [code]position[/code] or [code]linear_velocity[/code] every frame or even very often. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state.
Please also keep in mind that physics bodies manage their own transform which overwrites the ones you set. So any direct or indirect transformation (including scaling of the node or its parent) will be visible in the editor only, and immediately reset at runtime.
If you need to override the default physics behavior or add a transformation at runtime, you can write a custom force integration. See [member custom_integrator].
+ The center of mass is always located at the node's origin without taking into account the [CollisionShape2D] centroid offsets.
</description>
<tutorials>
+ <link title="2D Physics Platformer Demo">https://godotengine.org/asset-library/asset/119</link>
+ <link title="Instancing Demo">https://godotengine.org/asset-library/asset/148</link>
</tutorials>
<methods>
<method name="_integrate_forces" qualifiers="virtual">
@@ -34,9 +37,9 @@
<method name="add_force">
<return type="void">
</return>
- <argument index="0" name="offset" type="Vector2">
+ <argument index="0" name="force" type="Vector2">
</argument>
- <argument index="1" name="force" type="Vector2">
+ <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates.
@@ -54,7 +57,7 @@
<method name="apply_central_impulse">
<return type="void">
</return>
- <argument index="0" name="impulse" type="Vector2">
+ <argument index="0" name="impulse" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Applies a directional impulse without affecting rotation.
@@ -63,9 +66,9 @@
<method name="apply_impulse">
<return type="void">
</return>
- <argument index="0" name="offset" type="Vector2">
+ <argument index="0" name="impulse" type="Vector2">
</argument>
- <argument index="1" name="impulse" type="Vector2">
+ <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The position uses the rotation of the global coordinate system, but is centered at the object's origin.
@@ -84,7 +87,7 @@
<return type="Node2D[]">
</return>
<description>
- Returns a list of the bodies colliding with this one. Use [member contacts_reported] to set the maximum number reported. You must also set [member contact_monitor] to [code]true[/code].
+ Returns a list of the bodies colliding with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions.
[b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead.
</description>
</method>
@@ -116,6 +119,7 @@
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="-1.0">
Damps the body's [member angular_velocity]. If [code]-1[/code], the body will use the [b]Default Angular Damp[/b] defined in [b]Project &gt; Project Settings &gt; Physics &gt; 2d[/b].
+ See [member ProjectSettings.physics/2d/default_angular_damp] for more details about damping.
</member>
<member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity" default="0.0">
The body's rotational velocity.
@@ -127,13 +131,15 @@
The body's total applied torque.
</member>
<member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true">
- If [code]true[/code], the body will not calculate forces and will act as a static body if there is no movement. The body will wake up when other forces are applied via collisions or by using [method apply_impulse] or [method add_force].
+ If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping].
+ [b]Note:[/b] A RigidBody2D will never enter sleep mode automatically if its [member mode] is [constant MODE_CHARACTER]. It can still be put to sleep manually by setting its [member sleeping] property to [code]true[/code].
</member>
<member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false">
If [code]true[/code], the body will emit signals when it collides with another RigidBody2D. See also [member contacts_reported].
</member>
<member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" default="0">
- The maximum number of contacts to report.
+ The maximum number of contacts that will be recorded. Requires [member contact_monitor] to be set to [code]true[/code].
+ [b]Note:[/b] The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end).
</member>
<member name="continuous_cd" type="int" setter="set_continuous_collision_detection_mode" getter="get_continuous_collision_detection_mode" enum="RigidBody2D.CCDMode" default="0">
Continuous collision detection mode.
@@ -150,6 +156,7 @@
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="-1.0">
Damps the body's [member linear_velocity]. If [code]-1[/code], the body will use the [b]Default Linear Damp[/b] in [b]Project &gt; Project Settings &gt; Physics &gt; 2d[/b].
+ See [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping.
</member>
<member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2( 0, 0 )">
The body's linear velocity.
@@ -165,7 +172,7 @@
If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.
</member>
<member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false">
- If [code]true[/code], the body is sleeping and will not calculate forces until woken up by a collision or by using [method apply_impulse] or [method add_force].
+ If [code]true[/code], the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method add_force] methods.
</member>
<member name="weight" type="float" setter="set_weight" getter="get_weight" default="9.8">
The body's weight based on its mass and the [b]Default Gravity[/b] value in [b]Project &gt; Project Settings &gt; Physics &gt; 2d[/b].
@@ -176,14 +183,14 @@
<argument index="0" name="body" type="Node">
</argument>
<description>
- Emitted when a body enters into contact with this one. [member contact_monitor] must be [code]true[/code] and [member contacts_reported] greater than [code]0[/code].
+ Emitted when a body enters into contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions.
</description>
</signal>
<signal name="body_exited">
<argument index="0" name="body" type="Node">
</argument>
<description>
- Emitted when a body exits contact with this one. [member contact_monitor] must be [code]true[/code] and [member contacts_reported] greater than [code]0[/code].
+ Emitted when a body exits contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions.
</description>
</signal>
<signal name="body_shape_entered">
@@ -196,7 +203,7 @@
<argument index="3" name="local_shape" type="int">
</argument>
<description>
- Emitted when a body enters into contact with this one. Reports colliding shape information. See [CollisionObject2D] for shape index information. [member contact_monitor] must be [code]true[/code] and [member contacts_reported] greater than [code]0[/code].
+ Emitted when a body enters into contact with this one. Reports colliding shape information. See [CollisionObject2D] for shape index information. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions.
</description>
</signal>
<signal name="body_shape_exited">
@@ -209,12 +216,13 @@
<argument index="3" name="local_shape" type="int">
</argument>
<description>
- Emitted when a body shape exits contact with this one. Reports colliding shape information. See [CollisionObject2D] for shape index information. [member contact_monitor] must be [code]true[/code] and [member contacts_reported] greater than [code]0[/code].
+ Emitted when a body shape exits contact with this one. Reports colliding shape information. See [CollisionObject2D] for shape index information. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions.
</description>
</signal>
<signal name="sleeping_state_changed">
<description>
- Emitted when [member sleeping] changes.
+ Emitted when the physics engine changes the body's sleeping state.
+ [b]Note:[/b] Changing the value [member sleeping] will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or [code]emit_signal("sleeping_state_changed")[/code] is used.
</description>
</signal>
</signals>
diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml
index 1db818d6af..f8dc9887a9 100644
--- a/doc/classes/RigidBody3D.xml
+++ b/doc/classes/RigidBody3D.xml
@@ -8,9 +8,12 @@
A RigidBody3D has 4 behavior [member mode]s: Rigid, Static, Character, and Kinematic.
[b]Note:[/b] Don't change a RigidBody3D's position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed Hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop may result in strange behavior. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state.
If you need to override the default physics behavior, you can write a custom force integration function. See [member custom_integrator].
+ With Bullet physics (the default), the center of mass is the RigidBody3D center. With GodotPhysics, the center of mass is the average of the [CollisionShape3D] centers.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
</tutorials>
<methods>
<method name="_integrate_forces" qualifiers="virtual">
@@ -37,7 +40,7 @@
</return>
<argument index="0" name="force" type="Vector3">
</argument>
- <argument index="1" name="position" type="Vector3">
+ <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Adds a constant directional force (i.e. acceleration).
@@ -66,9 +69,9 @@
<method name="apply_impulse">
<return type="void">
</return>
- <argument index="0" name="position" type="Vector3">
+ <argument index="0" name="impulse" type="Vector3">
</argument>
- <argument index="1" name="impulse" type="Vector3">
+ <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Applies a positioned impulse to the body. An impulse is time independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin.
@@ -96,10 +99,17 @@
<return type="Array">
</return>
<description>
- Returns a list of the bodies colliding with this one. By default, number of max contacts reported is at 0, see the [member contacts_reported] property to increase it.
+ Returns a list of the bodies colliding with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions.
[b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead.
</description>
</method>
+ <method name="get_inverse_inertia_tensor">
+ <return type="Basis">
+ </return>
+ <description>
+ Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the [RigidBody3D].
+ </description>
+ </method>
<method name="set_axis_lock">
<return type="void">
</return>
@@ -124,6 +134,7 @@
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="-1.0">
Damps RigidBody3D's rotational forces.
+ See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping.
</member>
<member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3( 0, 0, 0 )">
RigidBody3D's rotational velocity.
@@ -147,13 +158,15 @@
Lock the body's movement in the Z axis.
</member>
<member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true">
- If [code]true[/code], the body is deactivated when there is no movement, so it will not take part in the simulation until it is awaken by an external force.
+ If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping].
+ [b]Note:[/b] A RigidBody3D will never enter sleep mode automatically if its [member mode] is [constant MODE_CHARACTER]. It can still be put to sleep manually by setting its [member sleeping] property to [code]true[/code].
</member>
<member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false">
- If [code]true[/code], the RigidBody3D will emit signals when it collides with another RigidBody3D.
+ If [code]true[/code], the RigidBody3D will emit signals when it collides with another RigidBody3D. See also [member contacts_reported].
</member>
<member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" default="0">
- The maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0.
+ The maximum number of contacts that will be recorded. Requires [member contact_monitor] to be set to [code]true[/code].
+ [b]Note:[/b] The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner).
</member>
<member name="continuous_cd" type="bool" setter="set_use_continuous_collision_detection" getter="is_using_continuous_collision_detection" default="false">
If [code]true[/code], continuous collision detection is used.
@@ -167,6 +180,7 @@
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="-1.0">
The body's linear damp. Cannot be less than -1.0. If this value is different from -1.0, any linear damp derived from the world or areas will be overridden.
+ See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping.
</member>
<member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3( 0, 0, 0 )">
The body's linear velocity. Can be used sporadically, but [b]don't set this every frame[/b], because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state.
@@ -182,7 +196,7 @@
If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.
</member>
<member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false">
- If [code]true[/code], the body is sleeping and will not calculate forces until woken up by a collision or the [code]apply_impulse[/code] method.
+ If [code]true[/code], the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method add_force] methods.
</member>
<member name="weight" type="float" setter="set_weight" getter="get_weight" default="9.8">
The body's weight based on its mass and the global 3D gravity. Global values are set in [b]Project &gt; Project Settings &gt; Physics &gt; 3d[/b].
@@ -193,14 +207,14 @@
<argument index="0" name="body" type="Node">
</argument>
<description>
- Emitted when a body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work.
+ Emitted when a body enters into contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions.
</description>
</signal>
<signal name="body_exited">
<argument index="0" name="body" type="Node">
</argument>
<description>
- Emitted when a body shape exits contact with this one. Contact monitor and contacts reported must be enabled for this to work.
+ Emitted when a body shape exits contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions.
</description>
</signal>
<signal name="body_shape_entered">
@@ -213,7 +227,7 @@
<argument index="3" name="local_shape" type="int">
</argument>
<description>
- Emitted when a body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work.
+ Emitted when a body enters into contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions.
This signal not only receives the body that collided with this one, but also its [RID] ([code]body_id[/code]), the shape index from the colliding body ([code]body_shape[/code]), and the shape index from this body ([code]local_shape[/code]) the other body collided with.
</description>
</signal>
@@ -227,13 +241,14 @@
<argument index="3" name="local_shape" type="int">
</argument>
<description>
- Emitted when a body shape exits contact with this one. Contact monitor and contacts reported must be enabled for this to work.
+ Emitted when a body shape exits contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions.
This signal not only receives the body that stopped colliding with this one, but also its [RID] ([code]body_id[/code]), the shape index from the colliding body ([code]body_shape[/code]), and the shape index from this body ([code]local_shape[/code]) the other body stopped colliding with.
</description>
</signal>
<signal name="sleeping_state_changed">
<description>
- Emitted when the body changes its sleeping state. Either by sleeping or waking up.
+ Emitted when the physics engine changes the body's sleeping state.
+ [b]Note:[/b] Changing the value [member sleeping] will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or [code]emit_signal("sleeping_state_changed")[/code] is used.
</description>
</signal>
</signals>
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index 00ca5c6e9f..4ea457047f 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -9,8 +9,8 @@
[SceneTree] is the default [MainLoop] implementation used by scenes, and is thus in charge of the game loop.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/scene_tree.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html</link>
+ <link title="SceneTree">https://docs.godotengine.org/en/latest/getting_started/step_by_step/scene_tree.html</link>
+ <link title="Multiple resolutions">https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html</link>
</tutorials>
<methods>
<method name="call_group" qualifiers="vararg">
diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml
index 0d94453e52..56272760bd 100644
--- a/doc/classes/Script.xml
+++ b/doc/classes/Script.xml
@@ -8,7 +8,7 @@
The [code]new[/code] method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/scripting.html</link>
+ <link title="Scripting">https://docs.godotengine.org/en/latest/getting_started/step_by_step/scripting.html</link>
</tutorials>
<methods>
<method name="can_instance" qualifiers="const">
diff --git a/doc/classes/ScriptEditor.xml b/doc/classes/ScriptEditor.xml
index f0ad781f77..d5a32dd20c 100644
--- a/doc/classes/ScriptEditor.xml
+++ b/doc/classes/ScriptEditor.xml
@@ -33,6 +33,12 @@
<description>
</description>
</method>
+ <method name="get_current_editor" qualifiers="const">
+ <return type="ScriptEditorBase">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_current_script">
<return type="Script">
</return>
@@ -50,6 +56,12 @@
<description>
</description>
</method>
+ <method name="get_open_script_editors" qualifiers="const">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_open_scripts" qualifiers="const">
<return type="Array">
</return>
@@ -74,6 +86,23 @@
<argument index="1" name="base_path" type="String">
</argument>
<description>
+ Opens the script create dialog. The script will extend [code]base_name[/code]. The file extension can be omitted from [code]base_path[/code]. It will be added based on the selected scripting language.
+ </description>
+ </method>
+ <method name="register_syntax_highlighter">
+ <return type="void">
+ </return>
+ <argument index="0" name="syntax_highlighter" type="EditorSyntaxHighlighter">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="unregister_syntax_highlighter">
+ <return type="void">
+ </return>
+ <argument index="0" name="syntax_highlighter" type="EditorSyntaxHighlighter">
+ </argument>
+ <description>
</description>
</method>
</methods>
diff --git a/doc/classes/ScriptEditorBase.xml b/doc/classes/ScriptEditorBase.xml
new file mode 100644
index 0000000000..9968ae06c3
--- /dev/null
+++ b/doc/classes/ScriptEditorBase.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="ScriptEditorBase" inherits="VBoxContainer" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_syntax_highlighter" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="highlighter" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <signals>
+ <signal name="edited_script_changed">
+ <description>
+ </description>
+ </signal>
+ <signal name="go_to_help">
+ <argument index="0" name="what" type="String">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ <signal name="name_changed">
+ <description>
+ </description>
+ </signal>
+ <signal name="replace_in_files_requested">
+ <argument index="0" name="text" type="String">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ <signal name="request_help">
+ <argument index="0" name="topic" type="String">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ <signal name="request_open_script_at_line">
+ <argument index="0" name="script" type="Object">
+ </argument>
+ <argument index="1" name="line" type="int">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ <signal name="request_save_history">
+ <description>
+ </description>
+ </signal>
+ <signal name="search_in_files_requested">
+ <argument index="0" name="text" type="String">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Semaphore.xml b/doc/classes/Semaphore.xml
index c9745acfcd..f311e1c72f 100644
--- a/doc/classes/Semaphore.xml
+++ b/doc/classes/Semaphore.xml
@@ -7,7 +7,7 @@
A synchronization semaphore which can be used to synchronize multiple [Thread]s. Initialized to zero on creation. Be careful to avoid deadlocks. For a binary version, see [Mutex].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link>
+ <link title="Using multiple threads">https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link>
</tutorials>
<methods>
<method name="post">
diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml
index 109c500a63..a717eba438 100644
--- a/doc/classes/Shader.xml
+++ b/doc/classes/Shader.xml
@@ -7,8 +7,8 @@
This class allows you to define a custom shader program that can be used by a [ShaderMaterial]. Shaders allow you to write your own custom behavior for rendering objects or updating particle information. For a detailed explanation and usage, please see the tutorials linked below.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/shading/index.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/shading/your_first_shader/what_are_shaders.html</link>
+ <link title="Shading tutorial index">https://docs.godotengine.org/en/latest/tutorials/shading/index.html</link>
+ <link title="What are shaders?">https://docs.godotengine.org/en/latest/tutorials/shading/your_first_shader/what_are_shaders.html</link>
</tutorials>
<methods>
<method name="get_default_texture_param" qualifiers="const">
diff --git a/doc/classes/ShaderMaterial.xml b/doc/classes/ShaderMaterial.xml
index 7e0e1ce831..b1748703ff 100644
--- a/doc/classes/ShaderMaterial.xml
+++ b/doc/classes/ShaderMaterial.xml
@@ -7,7 +7,7 @@
A material that uses a custom [Shader] program to render either items to screen or process particles. You can create multiple materials for the same shader but configure different values for the uniforms defined in the shader.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/shading/index.html</link>
+ <link title="Shading tutorial index">https://docs.godotengine.org/en/latest/tutorials/shading/index.html</link>
</tutorials>
<methods>
<method name="get_shader_param" qualifiers="const">
diff --git a/doc/classes/Shape2D.xml b/doc/classes/Shape2D.xml
index 9e913cb44d..65a37314f6 100644
--- a/doc/classes/Shape2D.xml
+++ b/doc/classes/Shape2D.xml
@@ -7,7 +7,7 @@
Base class for all 2D shapes. All 2D shape types inherit from this.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
</tutorials>
<methods>
<method name="collide">
@@ -74,6 +74,17 @@
This method needs the transformation matrix for this shape ([code]local_xform[/code]), the movement to test on this shape ([code]local_motion[/code]), the shape to check collisions with ([code]with_shape[/code]), the transformation matrix of that shape ([code]shape_xform[/code]), and the movement to test onto the other object ([code]shape_motion[/code]).
</description>
</method>
+ <method name="draw">
+ <return type="void">
+ </return>
+ <argument index="0" name="canvas_item" type="RID">
+ </argument>
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <description>
+ Draws a solid shape onto a [CanvasItem] with the [RenderingServer] API filled with the specified [code]color[/code]. The exact drawing method is specific for each shape and cannot be configured.
+ </description>
+ </method>
</methods>
<members>
<member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias" default="0.0">
diff --git a/doc/classes/Shape3D.xml b/doc/classes/Shape3D.xml
index 1af6550dc5..2d8bb5d051 100644
--- a/doc/classes/Shape3D.xml
+++ b/doc/classes/Shape3D.xml
@@ -7,7 +7,7 @@
Base class for all 3D shape resources. Nodes that inherit from this can be used as shapes for a [PhysicsBody3D] or [Area3D] objects.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/ShortCut.xml b/doc/classes/Shortcut.xml
index 9a2a761969..55bbb083c9 100644
--- a/doc/classes/ShortCut.xml
+++ b/doc/classes/Shortcut.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="ShortCut" inherits="Resource" version="4.0">
+<class name="Shortcut" inherits="Resource" version="4.0">
<brief_description>
A shortcut for binding input.
</brief_description>
diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml
index 1a05c02b60..b7a2258fc1 100644
--- a/doc/classes/Signal.xml
+++ b/doc/classes/Signal.xml
@@ -8,15 +8,31 @@
<tutorials>
</tutorials>
<methods>
- <method name="Signal">
+ <method name="Signal" qualifiers="constructor">
+ <return type="Signal">
+ </return>
+ <description>
+ Constructs a null [Signal] with no object nor signal name bound.
+ </description>
+ </method>
+ <method name="Signal" qualifiers="constructor">
+ <return type="Signal">
+ </return>
+ <argument index="0" name="from" type="Signal">
+ </argument>
+ <description>
+ Constructs a [Signal] as a copy of the given [Signal].
+ </description>
+ </method>
+ <method name="Signal" qualifiers="constructor">
<return type="Signal">
</return>
<argument index="0" name="object" type="Object">
</argument>
- <argument index="1" name="signal_name" type="StringName">
+ <argument index="1" name="signal" type="StringName">
</argument>
<description>
- Creates a new signal named [code]signal_name[/code] in the given object.
+ Creates a new [Signal] with the name [code]signal[/code] in the specified [code]object[/code].
</description>
</method>
<method name="connect">
@@ -33,7 +49,7 @@
</description>
</method>
<method name="disconnect">
- <return type="Variant">
+ <return type="void">
</return>
<argument index="0" name="callable" type="Callable">
</argument>
@@ -91,6 +107,22 @@
<description>
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Signal">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Signal">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/Skeleton2D.xml b/doc/classes/Skeleton2D.xml
index e1b7d60763..0ddbac9ba4 100644
--- a/doc/classes/Skeleton2D.xml
+++ b/doc/classes/Skeleton2D.xml
@@ -7,7 +7,7 @@
Skeleton2D parents a hierarchy of [Bone2D] objects. It is a requirement of [Bone2D]. Skeleton2D holds a reference to the rest pose of its children and acts as a single point of access to its bones.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/animation/2d_skeletons.html</link>
+ <link title="2D skeletons">https://docs.godotengine.org/en/latest/tutorials/animation/2d_skeletons.html</link>
</tutorials>
<methods>
<method name="get_bone">
diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml
index 4460b519fc..fe2cc1f5ad 100644
--- a/doc/classes/Skeleton3D.xml
+++ b/doc/classes/Skeleton3D.xml
@@ -9,6 +9,8 @@
Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone.
</description>
<tutorials>
+ <link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="add_bone">
@@ -31,6 +33,16 @@
[i]Deprecated soon.[/i]
</description>
</method>
+ <method name="bone_transform_to_world_transform">
+ <return type="Transform">
+ </return>
+ <argument index="0" name="bone_transform" type="Transform">
+ </argument>
+ <description>
+ Takes the given bone pose/transform and converts it to a world transform, relative to the [Skeleton3D] node.
+ This is useful for using the bone transform in calculations with transforms from [Node3D]-based nodes.
+ </description>
+ </method>
<method name="clear_bones">
<return type="void">
</return>
@@ -42,6 +54,7 @@
<return type="void">
</return>
<description>
+ Removes the global pose override on all bones in the skeleton.
</description>
</method>
<method name="find_bone" qualifiers="const">
@@ -106,6 +119,12 @@
Returns the pose transform of the specified bone. Pose is applied on top of the custom pose, which is applied on top the rest pose.
</description>
</method>
+ <method name="get_bone_process_orders">
+ <return type="PackedInt32Array">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_bone_rest" qualifiers="const">
<return type="Transform">
</return>
@@ -130,12 +149,14 @@
<argument index="0" name="bone_idx" type="int">
</argument>
<description>
+ Returns whether the bone rest for the bone at [code]bone_idx[/code] is disabled.
</description>
</method>
<method name="localize_rests">
<return type="void">
</return>
<description>
+ Returns all bones in the skeleton to their rest poses.
</description>
</method>
<method name="physical_bones_add_collision_exception">
@@ -144,6 +165,8 @@
<argument index="0" name="exception" type="RID">
</argument>
<description>
+ Adds a collision exception to the physical bone.
+ Works just like the [RigidBody3D] node.
</description>
</method>
<method name="physical_bones_remove_collision_exception">
@@ -152,6 +175,8 @@
<argument index="0" name="exception" type="RID">
</argument>
<description>
+ Removes a collision exception to the physical bone.
+ Works just like the [RigidBody3D] node.
</description>
</method>
<method name="physical_bones_start_simulation">
@@ -160,12 +185,15 @@
<argument index="0" name="bones" type="StringName[]" default="[ ]">
</argument>
<description>
+ Tells the [PhysicalBone3D] nodes in the Skeleton to start simulating and reacting to the physics world.
+ Optionally, a list of bone names can be passed-in, allowing only the passed-in bones to be simulated.
</description>
</method>
<method name="physical_bones_stop_simulation">
<return type="void">
</return>
<description>
+ Tells the [PhysicalBone3D] nodes in the Skeleton to stop simulating.
</description>
</method>
<method name="register_skin">
@@ -174,6 +202,7 @@
<argument index="0" name="skin" type="Skin">
</argument>
<description>
+ Binds the given Skin to the Skeleton.
</description>
</method>
<method name="set_bone_custom_pose">
@@ -184,6 +213,8 @@
<argument index="1" name="custom_pose" type="Transform">
</argument>
<description>
+ Sets the custom pose transform, [code]custom_pose[/code], for the bone at [code]bone_idx[/code]. This pose is an addition to the bone rest pose.
+ [b]Note[/b]: The pose transform needs to be in bone space. Use [method world_transform_to_bone_transform] to convert a world transform, like one you can get from a [Node3D], to bone space.
</description>
</method>
<method name="set_bone_disable_rest">
@@ -194,6 +225,7 @@
<argument index="1" name="disable" type="bool">
</argument>
<description>
+ Disables the rest pose for the bone at [code]bone_idx[/code] if [code]true[/code], enables the bone rest if [code]false[/code].
</description>
</method>
<method name="set_bone_global_pose_override">
@@ -208,6 +240,9 @@
<argument index="3" name="persistent" type="bool" default="false">
</argument>
<description>
+ Sets the global pose transform, [code]pose[/code], for the bone at [code]bone_idx[/code].
+ [code]amount[/code] is the interpolation strength that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain.
+ [b]Note[/b]: The pose transform needs to be in bone space. Use [method world_transform_to_bone_transform] to convert a world transform, like one you can get from a [Node3D], to bone space.
</description>
</method>
<method name="set_bone_parent">
@@ -230,7 +265,8 @@
<argument index="1" name="pose" type="Transform">
</argument>
<description>
- Returns the pose transform for bone [code]bone_idx[/code].
+ Sets the pose transform for bone [code]bone_idx[/code].
+ [b]Note[/b]: The pose transform needs to be in bone space. Use [method world_transform_to_bone_transform] to convert a world transform, like one you can get from a [Node3D], to bone space.
</description>
</method>
<method name="set_bone_rest">
@@ -261,6 +297,17 @@
<argument index="0" name="bone_idx" type="int">
</argument>
<description>
+ Unparents the bone at [code]bone_idx[/code] and sets its rest position to that of it's parent prior to being reset.
+ </description>
+ </method>
+ <method name="world_transform_to_bone_transform">
+ <return type="Transform">
+ </return>
+ <argument index="0" name="world_transform" type="Transform">
+ </argument>
+ <description>
+ Takes the given world transform, relative to the [Skeleton3D], and converts it to a bone pose/transform.
+ This is useful for using setting bone poses using transforms from [Node3D]-based nodes.
</description>
</method>
</methods>
@@ -268,6 +315,12 @@
<member name="animate_physical_bones" type="bool" setter="set_animate_physical_bones" getter="get_animate_physical_bones" default="true">
</member>
</members>
+ <signals>
+ <signal name="pose_updated">
+ <description>
+ </description>
+ </signal>
+ </signals>
<constants>
<constant name="NOTIFICATION_UPDATE_SKELETON" value="50">
</constant>
diff --git a/doc/classes/SkeletonIK3D.xml b/doc/classes/SkeletonIK3D.xml
index de83847403..5193109447 100644
--- a/doc/classes/SkeletonIK3D.xml
+++ b/doc/classes/SkeletonIK3D.xml
@@ -5,6 +5,7 @@
<description>
</description>
<tutorials>
+ <link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link>
</tutorials>
<methods>
<method name="get_parent_skeleton" qualifiers="const">
diff --git a/doc/classes/Sky.xml b/doc/classes/Sky.xml
index 78c75d9c2b..a77515b3e6 100644
--- a/doc/classes/Sky.xml
+++ b/doc/classes/Sky.xml
@@ -48,11 +48,17 @@
<constant name="RADIANCE_SIZE_MAX" value="7" enum="RadianceSize">
Represents the size of the [enum RadianceSize] enum.
</constant>
- <constant name="PROCESS_MODE_QUALITY" value="0" enum="ProcessMode">
+ <constant name="PROCESS_MODE_AUTOMATIC" value="0" enum="ProcessMode">
+ Automatically selects the appropriate process mode based on your sky shader. If your shader uses [code]TIME[/code] or [code]POSITION[/code], this will use [constant PROCESS_MODE_REALTIME]. If your shader uses any of the [code]LIGHT_*[/code] variables or any custom uniforms, this uses [constant PROCESS_MODE_INCREMENTAL]. Otherwise, this defaults to [constant PROCESS_MODE_QUALITY].
+ </constant>
+ <constant name="PROCESS_MODE_QUALITY" value="1" enum="ProcessMode">
Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than [constant PROCESS_MODE_REALTIME] but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing [member ProjectSettings.rendering/quality/reflections/ggx_samples].
</constant>
- <constant name="PROCESS_MODE_REALTIME" value="1" enum="ProcessMode">
- Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times.
+ <constant name="PROCESS_MODE_INCREMENTAL" value="2" enum="ProcessMode">
+ Uses the same high quality importance sampling to process the radiance map as [constant PROCESS_MODE_QUALITY], but updates over several frames. The number of frames is determined by [member ProjectSettings.rendering/quality/reflections/roughness_layers]. Use this when you need highest quality radiance maps, but have a sky that updates slowly.
+ </constant>
+ <constant name="PROCESS_MODE_REALTIME" value="3" enum="ProcessMode">
+ Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. If you need better quality, but still need to update the sky every frame, consider turning on [member ProjectSettings.rendering/quality/reflections/fast_filter_high_quality].
[b]Note:[/b] The fast filtering algorithm is limited to 256x256 cubemaps, so [member radiance_size] must be set to [constant RADIANCE_SIZE_256].
</constant>
</constants>
diff --git a/doc/classes/Slider.xml b/doc/classes/Slider.xml
index 68776df603..f18b2ce39f 100644
--- a/doc/classes/Slider.xml
+++ b/doc/classes/Slider.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Base class for GUI sliders.
+ [b]Note:[/b] The [signal Range.changed] and [signal Range.value_changed] signals are part of the [Range] class which this class inherits from.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/SoftBody3D.xml b/doc/classes/SoftBody3D.xml
index 24d6609900..d3ab955570 100644
--- a/doc/classes/SoftBody3D.xml
+++ b/doc/classes/SoftBody3D.xml
@@ -7,7 +7,7 @@
A deformable physics body. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/soft_body.html</link>
+ <link title="SoftBody">https://docs.godotengine.org/en/latest/tutorials/physics/soft_body.html</link>
</tutorials>
<methods>
<method name="add_collision_exception_with">
@@ -82,10 +82,10 @@
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
The physics layers this SoftBody3D is in.
Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property.
- A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
+ A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The physics layers this SoftBody3D scans for collisions.
+ The physics layers this SoftBody3D scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="damping_coefficient" type="float" setter="set_damping_coefficient" getter="get_damping_coefficient" default="0.01">
</member>
diff --git a/doc/classes/SphereShape3D.xml b/doc/classes/SphereShape3D.xml
index 1eaf890639..e90493fca2 100644
--- a/doc/classes/SphereShape3D.xml
+++ b/doc/classes/SphereShape3D.xml
@@ -7,6 +7,7 @@
Sphere shape for 3D collisions, which can be set into a [PhysicsBody3D] or [Area3D]. This shape is useful for modeling sphere-like 3D objects.
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml
index c8ba8ab697..e674ceb57e 100644
--- a/doc/classes/SpinBox.xml
+++ b/doc/classes/SpinBox.xml
@@ -45,7 +45,7 @@
Adds the specified [code]prefix[/code] string before the numerical value of the [SpinBox].
</member>
<member name="suffix" type="String" setter="set_suffix" getter="get_suffix" default="&quot;&quot;">
- Adds the specified [code]prefix[/code] string after the numerical value of the [SpinBox].
+ Adds the specified [code]suffix[/code] string after the numerical value of the [SpinBox].
</member>
</members>
<constants>
diff --git a/doc/classes/SpotLight3D.xml b/doc/classes/SpotLight3D.xml
index f094818c21..f868503bbd 100644
--- a/doc/classes/SpotLight3D.xml
+++ b/doc/classes/SpotLight3D.xml
@@ -7,11 +7,14 @@
A Spotlight is a type of [Light3D] node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance. This attenuation can be configured by changing the energy, radius and attenuation parameters of [Light3D].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
+ <link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
<members>
+ <member name="shadow_bias" type="float" setter="set_param" getter="get_param" override="true" default="0.02" />
+ <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" override="true" default="1.0" />
<member name="spot_angle" type="float" setter="set_param" getter="get_param" default="45.0">
The spotlight's angle in degrees.
</member>
@@ -22,7 +25,7 @@
The spotlight's light energy attenuation curve.
</member>
<member name="spot_range" type="float" setter="set_param" getter="get_param" default="5.0">
- The maximal range that can be reached by the spotlight.
+ The maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the [member spot_attenuation] in use. No matter the [member spot_attenuation] in use, the light will never reach anything outside this range.
</member>
</members>
<constants>
diff --git a/doc/classes/SpringArm3D.xml b/doc/classes/SpringArm3D.xml
index 8305494c2b..3ffdbebae8 100644
--- a/doc/classes/SpringArm3D.xml
+++ b/doc/classes/SpringArm3D.xml
@@ -32,7 +32,7 @@
<return type="float">
</return>
<description>
- Returns the proportion between the current arm length (after checking for collisions) and the [member spring_length]. Ranges from 0 to 1.
+ Returns the spring arm's current length.
</description>
</method>
<method name="remove_excluded_object">
@@ -47,7 +47,7 @@
</methods>
<members>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The layers against which the collision check shall be done.
+ The layers against which the collision check shall be done. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.01">
When the collision check is made, a candidate length for the SpringArm3D is given.
diff --git a/doc/classes/Sprite2D.xml b/doc/classes/Sprite2D.xml
index 950fda4e20..c56596423d 100644
--- a/doc/classes/Sprite2D.xml
+++ b/doc/classes/Sprite2D.xml
@@ -7,6 +7,7 @@
A node that displays a 2D texture. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation.
</description>
<tutorials>
+ <link title="Instancing Demo">https://godotengine.org/asset-library/asset/148</link>
</tutorials>
<methods>
<method name="get_rect" qualifiers="const">
@@ -44,17 +45,14 @@
If [code]true[/code], texture is flipped vertically.
</member>
<member name="frame" type="int" setter="set_frame" getter="get_frame" default="0">
- Current frame to display from sprite sheet. [member vframes] or [member hframes] must be greater than 1.
+ Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1.
</member>
<member name="frame_coords" type="Vector2" setter="set_frame_coords" getter="get_frame_coords" default="Vector2( 0, 0 )">
- Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member vframes] or [member hframes] must be greater than 1.
+ Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member hframes] or [member vframes] must be greater than 1.
</member>
<member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1">
The number of columns in the sprite sheet.
</member>
- <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map">
- The normal map gives depth to the Sprite2D.
- </member>
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )">
The texture's drawing offset.
</member>
@@ -67,15 +65,6 @@
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )">
The region of the atlas texture to display. [member region_enabled] must be [code]true[/code].
</member>
- <member name="shininess" type="float" setter="set_shininess" getter="get_shininess" default="1.0">
- Strength of the specular light effect of this [Sprite2D].
- </member>
- <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )">
- The color of the specular light effect.
- </member>
- <member name="specular_map" type="Texture2D" setter="set_specular_map" getter="get_specular_map">
- The specular map is used for more control on the shininess effect.
- </member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
[Texture2D] object to draw.
</member>
diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml
index f59d5130c9..f9b947fa3d 100644
--- a/doc/classes/Sprite3D.xml
+++ b/doc/classes/Sprite3D.xml
@@ -4,8 +4,7 @@
2D sprite node in a 3D world.
</brief_description>
<description>
- A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation.
- [b]Note:[/b] There are [url=https://github.com/godotengine/godot/issues/20855]known performance issues[/url] when using [Sprite3D]. Consider using a [MeshInstance3D] with a [QuadMesh] as the mesh instead. You can still have billboarding by enabling billboard properties in the QuadMesh's [StandardMaterial3D].
+ A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. See also [SpriteBase3D] where properties such as the billboard mode are defined.
</description>
<tutorials>
</tutorials>
@@ -13,10 +12,10 @@
</methods>
<members>
<member name="frame" type="int" setter="set_frame" getter="get_frame" default="0">
- Current frame to display from sprite sheet. [member vframes] or [member hframes] must be greater than 1.
+ Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1.
</member>
<member name="frame_coords" type="Vector2" setter="set_frame_coords" getter="get_frame_coords" default="Vector2( 0, 0 )">
- Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member vframes] or [member hframes] must be greater than 1.
+ Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member hframes] or [member vframes] must be greater than 1.
</member>
<member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1">
The number of columns in the sprite sheet.
diff --git a/doc/classes/SpriteBase3D.xml b/doc/classes/SpriteBase3D.xml
index 479dc5f94c..44b08408c1 100644
--- a/doc/classes/SpriteBase3D.xml
+++ b/doc/classes/SpriteBase3D.xml
@@ -4,7 +4,7 @@
2D sprite node in 3D environment.
</brief_description>
<description>
- A node that displays 2D texture information in a 3D environment.
+ A node that displays 2D texture information in a 3D environment. See also [Sprite3D] where many other properties are defined.
</description>
<tutorials>
</tutorials>
@@ -13,6 +13,7 @@
<return type="TriangleMesh">
</return>
<description>
+ Returns a [TriangleMesh] with the sprite's vertices following its current configuration (such as its [member axis] and [member pixel_size]).
</description>
</method>
<method name="get_draw_flag" qualifiers="const">
@@ -39,17 +40,19 @@
<argument index="1" name="enabled" type="bool">
</argument>
<description>
- If [code]true[/code], the specified flag will be enabled.
+ If [code]true[/code], the specified flag will be enabled. See [enum SpriteBase3D.DrawFlags] for a list of flags.
</description>
</method>
</methods>
<members>
<member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" enum="SpriteBase3D.AlphaCutMode" default="0">
+ The alpha cutting mode to use for the sprite. See [enum AlphaCutMode] for possible values.
</member>
<member name="axis" type="int" setter="set_axis" getter="get_axis" enum="Vector3.Axis" default="2">
The direction in which the front of the texture faces.
</member>
<member name="billboard" type="int" setter="set_billboard_mode" getter="get_billboard_mode" enum="BaseMaterial3D.BillboardMode" default="0">
+ The billboard mode to use for the sprite. See [enum BaseMaterial3D.BillboardMode] for possible values.
</member>
<member name="centered" type="bool" setter="set_centered" getter="is_centered" default="true">
If [code]true[/code], texture will be centered.
@@ -90,16 +93,19 @@
If set, lights in the environment affect the sprite.
</constant>
<constant name="FLAG_DOUBLE_SIDED" value="2" enum="DrawFlags">
- If set, texture can be seen from the back as well, if not, it is invisible when looking at it from behind.
+ If set, texture can be seen from the back as well. If not, the texture is invisible when looking at it from behind.
</constant>
<constant name="FLAG_MAX" value="3" enum="DrawFlags">
Represents the size of the [enum DrawFlags] enum.
</constant>
<constant name="ALPHA_CUT_DISABLED" value="0" enum="AlphaCutMode">
+ This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping.
</constant>
<constant name="ALPHA_CUT_DISCARD" value="1" enum="AlphaCutMode">
+ This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see [member ProjectSettings.rendering/quality/screen_filters/screen_space_aa]). On the bright side, this mode doesn't suffer from transparency sorting issues when multiple transparent materials are overlapping. This mode is also known as [i]alpha testing[/i] or [i]1-bit transparency[/i].
</constant>
<constant name="ALPHA_CUT_OPAQUE_PREPASS" value="2" enum="AlphaCutMode">
+ This mode draws fully opaque pixels in the depth prepass. This is slower than [constant ALPHA_CUT_DISABLED] or [constant ALPHA_CUT_DISCARD], but it allows displaying translucent areas and smooth edges while using proper sorting.
</constant>
</constants>
</class>
diff --git a/doc/classes/SpriteFrames.xml b/doc/classes/SpriteFrames.xml
index 6e1e1688f4..1c7d84c5a2 100644
--- a/doc/classes/SpriteFrames.xml
+++ b/doc/classes/SpriteFrames.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Sprite frame library for [AnimatedSprite2D]. Contains frames and animation data for playback.
+ [b]Note:[/b] You can associate a set of normal or specular maps by creating additional [SpriteFrames] resources with a [code]_normal[/code] or [code]_specular[/code] suffix. For example, having 3 [SpriteFrames] resources [code]run[/code], [code]run_normal[/code], and [code]run_specular[/code] will make it so the [code]run[/code] animation uses normal and specular maps.
</description>
<tutorials>
</tutorials>
@@ -53,7 +54,7 @@
<argument index="0" name="anim" type="StringName">
</argument>
<description>
- If [code]true[/code], the given animation will loop.
+ Returns [code]true[/code] if the given animation is configured to loop when it finishes playing. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="get_animation_names" qualifiers="const">
diff --git a/doc/classes/StaticBody3D.xml b/doc/classes/StaticBody3D.xml
index c896efc314..63a15cbe1d 100644
--- a/doc/classes/StaticBody3D.xml
+++ b/doc/classes/StaticBody3D.xml
@@ -8,6 +8,9 @@
Additionally, a constant linear or angular velocity can be set for the static body, so even if it doesn't move, it affects other bodies as if it was moving (this is useful for simulating conveyor belts or conveyor wheels).
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/StreamCubemap.xml b/doc/classes/StreamCubemap.xml
new file mode 100644
index 0000000000..16648266eb
--- /dev/null
+++ b/doc/classes/StreamCubemap.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="StreamCubemap" inherits="StreamTextureLayered" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/StreamCubemapArray.xml b/doc/classes/StreamCubemapArray.xml
new file mode 100644
index 0000000000..b84973fd14
--- /dev/null
+++ b/doc/classes/StreamCubemapArray.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="StreamCubemapArray" inherits="StreamTextureLayered" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/StreamPeerSSL.xml b/doc/classes/StreamPeerSSL.xml
index 69e8f67a5e..6a06c0b3f4 100644
--- a/doc/classes/StreamPeerSSL.xml
+++ b/doc/classes/StreamPeerSSL.xml
@@ -7,7 +7,7 @@
SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link>
+ <link title="SSL certificates">https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link>
</tutorials>
<methods>
<method name="accept_stream">
diff --git a/doc/classes/StreamPeerTCP.xml b/doc/classes/StreamPeerTCP.xml
index dbd53f8ba0..bb85d94bf9 100644
--- a/doc/classes/StreamPeerTCP.xml
+++ b/doc/classes/StreamPeerTCP.xml
@@ -52,7 +52,7 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if this peer is currently connected to a host, [code]false[/code] otherwise.
+ Returns [code]true[/code] if this peer is currently connected or is connecting to a host, [code]false[/code] otherwise.
</description>
</method>
<method name="set_no_delay">
diff --git a/doc/classes/StreamTexture.xml b/doc/classes/StreamTexture2D.xml
index 03afcb5b0d..214298475c 100644
--- a/doc/classes/StreamTexture.xml
+++ b/doc/classes/StreamTexture2D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="StreamTexture" inherits="Texture2D" version="4.0">
+<class name="StreamTexture2D" inherits="Texture2D" version="4.0">
<brief_description>
A [code].stex[/code] texture.
</brief_description>
diff --git a/doc/classes/StreamTexture2DArray.xml b/doc/classes/StreamTexture2DArray.xml
new file mode 100644
index 0000000000..ec545b24d0
--- /dev/null
+++ b/doc/classes/StreamTexture2DArray.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="StreamTexture2DArray" inherits="StreamTextureLayered" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/StreamTexture3D.xml b/doc/classes/StreamTexture3D.xml
new file mode 100644
index 0000000000..7054a4ee99
--- /dev/null
+++ b/doc/classes/StreamTexture3D.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="StreamTexture3D" inherits="Texture3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="load">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="load_path" type="String" setter="load" getter="get_load_path" default="&quot;&quot;">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/StreamTextureLayered.xml b/doc/classes/StreamTextureLayered.xml
new file mode 100644
index 0000000000..10a7aae976
--- /dev/null
+++ b/doc/classes/StreamTextureLayered.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="StreamTextureLayered" inherits="TextureLayered" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="load">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="load_path" type="String" setter="load" getter="get_load_path" default="&quot;&quot;">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index a72b8f05d8..4ee9dbf1f9 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -4,166 +4,29 @@
Built-in string class.
</brief_description>
<description>
- This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference counted and use a copy-on-write approach, so passing them around is cheap in resources.
+ This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference-counted and use a copy-on-write approach, so passing them around is cheap in resources.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_format_string.html</link>
+ <link title="GDScript format strings">https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_format_string.html</link>
</tutorials>
<methods>
- <method name="String">
+ <method name="String" qualifiers="constructor">
<return type="String">
</return>
- <argument index="0" name="from" type="bool">
- </argument>
- <description>
- Constructs a new String from the given [bool].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="int">
- </argument>
- <description>
- Constructs a new String from the given [int].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="float">
- </argument>
- <description>
- Constructs a new String from the given [float].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Vector2">
- </argument>
<description>
- Constructs a new String from the given [Vector2].
+ Constructs an empty [String] ([code]""[/code]).
</description>
</method>
- <method name="String">
+ <method name="String" qualifiers="constructor">
<return type="String">
</return>
- <argument index="0" name="from" type="Vector2i">
+ <argument index="0" name="from" type="String">
</argument>
<description>
- Constructs a new String from the given [Vector2i].
+ Constructs a [String] as a copy of the given [String].
</description>
</method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Rect2">
- </argument>
- <description>
- Constructs a new String from the given [Rect2].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Rect2i">
- </argument>
- <description>
- Constructs a new String from the given [Rect2i].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Vector3">
- </argument>
- <description>
- Constructs a new String from the given [Vector3].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Vector3i">
- </argument>
- <description>
- Constructs a new String from the given [Vector3i].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Transform2D">
- </argument>
- <description>
- Constructs a new String from the given [Transform2D].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Plane">
- </argument>
- <description>
- Constructs a new String from the given [Plane].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Quat">
- </argument>
- <description>
- Constructs a new String from the given [Quat].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="AABB">
- </argument>
- <description>
- Constructs a new String from the given [AABB].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Basis">
- </argument>
- <description>
- Constructs a new String from the given [Basis].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Transform">
- </argument>
- <description>
- Constructs a new String from the given [Transform].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Color">
- </argument>
- <description>
- Constructs a new String from the given [Color].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="StringName">
- </argument>
- <description>
- Constructs a new String from the given [StringName].
- </description>
- </method>
- <method name="String">
+ <method name="String" qualifiers="constructor">
<return type="String">
</return>
<argument index="0" name="from" type="NodePath">
@@ -172,130 +35,13 @@
Constructs a new String from the given [NodePath].
</description>
</method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="RID">
- </argument>
- <description>
- Constructs a new String from the given [RID].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Callable">
- </argument>
- <description>
- Constructs a new String from the given [Callable].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Signal">
- </argument>
- <description>
- Constructs a new String from the given [Signal].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Dictionary">
- </argument>
- <description>
- Constructs a new String from the given [Dictionary].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Array">
- </argument>
- <description>
- Constructs a new String from the given [Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedByteArray">
- </argument>
- <description>
- Constructs a new String from the given [PackedByteArray].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedInt32Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedInt32Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedInt64Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedInt64Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedFloat32Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedFloat32Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedFloat64Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedFloat64Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedStringArray">
- </argument>
- <description>
- Constructs a new String from the given [PackedStringArray].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedVector2Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedVector2Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedVector3Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedVector3Array].
- </description>
- </method>
- <method name="String">
+ <method name="String" qualifiers="constructor">
<return type="String">
</return>
- <argument index="0" name="from" type="PackedColorArray">
+ <argument index="0" name="from" type="StringName">
</argument>
<description>
- Constructs a new String from the given [PackedColorArray].
+ Constructs a new String from the given [StringName].
</description>
</method>
<method name="begins_with">
@@ -314,6 +60,14 @@
Returns the bigrams (pairs of consecutive letters) of this string.
</description>
</method>
+ <method name="bin_to_int">
+ <return type="int">
+ </return>
+ <argument index="0" name="with_prefix" type="bool" default="true">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="c_escape">
<return type="String">
</return>
@@ -325,14 +79,15 @@
<return type="String">
</return>
<description>
- Returns a copy of the string with escaped characters replaced by their meanings according to the C language standard.
+ Returns a copy of the string with escaped characters replaced by their meanings. Supported escape sequences are [code]\'[/code], [code]\"[/code], [code]\?[/code], [code]\\[/code], [code]\a[/code], [code]\b[/code], [code]\f[/code], [code]\n[/code], [code]\r[/code], [code]\t[/code], [code]\v[/code].
+ [b]Note:[/b] Unlike the GDScript parser, this method doesn't support the [code]\uXXXX[/code] escape sequence.
</description>
</method>
<method name="capitalize">
<return type="String">
</return>
<description>
- Changes the case of some letters. Replaces underscores with spaces, converts all letters to lowercase, then capitalizes first and every letter following the space character. For [code]capitalize camelCase mixed_with_underscores[/code], it will return [code]Capitalize Camelcase Mixed With Underscores[/code].
+ Changes the case of some letters. Replaces underscores with spaces, adds spaces before in-word uppercase characters, converts all letters to lowercase, then capitalizes the first letter and every letter following a space character. For [code]capitalize camelCase mixed_with_underscores[/code], it will return [code]Capitalize Camel Case Mixed With Underscores[/code].
</description>
</method>
<method name="casecmp_to">
@@ -341,7 +96,10 @@
<argument index="0" name="to" type="String">
</argument>
<description>
- Performs a case-sensitive comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal.
+ Performs a case-sensitive comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/code] of each string, which roughly matches the alphabetical order.
+ [b]Behavior with different string lengths:[/b] Returns [code]1[/code] if the "base" string is longer than the [code]to[/code] string or [code]-1[/code] if the "base" string is shorter than the [code]to[/code] string. Keep in mind this length is determined by the number of Unicode codepoints, [i]not[/i] the actual visible characters.
+ [b]Behavior with empty strings:[/b] Returns [code]-1[/code] if the "base" string is empty, [code]1[/code] if the [code]to[/code] string is empty or [code]0[/code] if both strings are empty.
+ To get a boolean result from a string comparison, use the [code]==[/code] operator instead. See also [method nocasecmp_to] and [method naturalnocasecmp_to].
</description>
</method>
<method name="count">
@@ -381,7 +139,7 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the string is empty.
+ Returns [code]true[/code] if the length of the string equals [code]0[/code].
</description>
</method>
<method name="ends_with">
@@ -393,17 +151,6 @@
Returns [code]true[/code] if the string ends with the given string.
</description>
</method>
- <method name="erase">
- <return type="void">
- </return>
- <argument index="0" name="position" type="int">
- </argument>
- <argument index="1" name="chars" type="int">
- </argument>
- <description>
- Erases [code]chars[/code] characters from the string starting from [code]position[/code].
- </description>
- </method>
<method name="find">
<return type="int">
</return>
@@ -412,16 +159,13 @@
<argument index="1" name="from" type="int" default="0">
</argument>
<description>
- Finds the first occurrence of a substring. Returns the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
- </description>
- </method>
- <method name="find_last">
- <return type="int">
- </return>
- <argument index="0" name="what" type="String">
- </argument>
- <description>
- Finds the last occurrence of a substring. Returns the starting position of the substring or -1 if not found.
+ Returns the index of the [b]first[/b] case-sensitive occurrence of the specified string in this instance, or [code]-1[/code]. Optionally, the starting search index can be specified, continuing to the end of the string.
+ [b]Note:[/b] If you just want to know whether a string contains a substring, use the [code]in[/code] operator as follows:
+ [codeblock]
+ # Will evaluate to `false`.
+ if "i" in "team":
+ pass
+ [/codeblock]
</description>
</method>
<method name="findn">
@@ -432,7 +176,7 @@
<argument index="1" name="from" type="int" default="0">
</argument>
<description>
- Finds the first occurrence of a substring, ignoring case. Returns the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
+ Returns the index of the [b]first[/b] case-insensitive occurrence of the specified string in this instance, or [code]-1[/code]. Optionally, the starting search index can be specified, continuing to the end of the string.
</description>
</method>
<method name="format">
@@ -484,10 +228,13 @@
<method name="hex_to_int">
<return type="int">
</return>
+ <argument index="0" name="with_prefix" type="bool" default="true">
+ </argument>
<description>
- Converts a string containing a hexadecimal number into an integer. Hexadecimal strings are expected to be prefixed with "[code]0x[/code]" otherwise [code]0[/code] is returned.
+ Converts a string containing a hexadecimal number into a decimal integer. If [code]with_prefix[/code] is [code]true[/code], the hexadecimal string should start with the [code]0x[/code] prefix, otherwise [code]0[/code] is returned.
[codeblock]
print("0xff".hex_to_int()) # Print "255"
+ print("ab".hex_to_int(false)) # Print "171"
[/codeblock]
</description>
</method>
@@ -511,20 +258,6 @@
[/codeblock]
</description>
</method>
- <method name="humanize_size">
- <return type="String">
- </return>
- <argument index="0" name="size" type="int">
- </argument>
- <description>
- Converts [code]size[/code] represented as number of bytes to human-readable format using internationalized set of data size units, namely: B, KiB, MiB, GiB, TiB, PiB, EiB. Note that the next smallest unit is picked automatically to hold at most 1024 units.
- [codeblock]
- var bytes = 133790307
- var size = String.humanize_size(bytes)
- print(size) # prints "127.5 MiB"
- [/codeblock]
- </description>
- </method>
<method name="insert">
<return type="String">
</return>
@@ -617,7 +350,20 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if this string contains a valid IP address.
+ Returns [code]true[/code] if this string contains only a well-formatted IPv4 or IPv6 address. This method considers [url=https://en.wikipedia.org/wiki/Reserved_IP_addresses]reserved IP addresses[/url] such as [code]0.0.0.0[/code] as valid.
+ </description>
+ </method>
+ <method name="join">
+ <return type="String">
+ </return>
+ <argument index="0" name="parts" type="PackedStringArray">
+ </argument>
+ <description>
+ Return a [String] which is the concatenation of the [code]parts[/code]. The separator between elements is the string providing this method.
+ Example:
+ [codeblock]
+ print(", ".join(["One", "Two", "Three", "Four"]))
+ [/codeblock]
</description>
</method>
<method name="json_escape">
@@ -643,6 +389,17 @@
Returns the string's amount of characters.
</description>
</method>
+ <method name="lpad">
+ <return type="String">
+ </return>
+ <argument index="0" name="min_length" type="int">
+ </argument>
+ <argument index="1" name="character" type="String" default="&quot; &quot;">
+ </argument>
+ <description>
+ Formats a string to be at least [code]min_length[/code] long by adding [code]character[/code]s to the left of the string.
+ </description>
+ </method>
<method name="lstrip">
<return type="String">
</return>
@@ -684,13 +441,109 @@
Returns the MD5 hash of the string as a string.
</description>
</method>
+ <method name="naturalnocasecmp_to">
+ <return type="int">
+ </return>
+ <argument index="0" name="to" type="String">
+ </argument>
+ <description>
+ Performs a case-insensitive [i]natural order[/i] comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/code] of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison.
+ When used for sorting, natural order comparison will order suites of numbers as expected by most people. If you sort the numbers from 1 to 10 using natural order, you will get [code][1, 2, 3, ...][/code] instead of [code][1, 10, 2, 3, ...][/code].
+ [b]Behavior with different string lengths:[/b] Returns [code]1[/code] if the "base" string is longer than the [code]to[/code] string or [code]-1[/code] if the "base" string is shorter than the [code]to[/code] string. Keep in mind this length is determined by the number of Unicode codepoints, [i]not[/i] the actual visible characters.
+ [b]Behavior with empty strings:[/b] Returns [code]-1[/code] if the "base" string is empty, [code]1[/code] if the [code]to[/code] string is empty or [code]0[/code] if both strings are empty.
+ To get a boolean result from a string comparison, use the [code]==[/code] operator instead. See also [method nocasecmp_to] and [method casecmp_to].
+ </description>
+ </method>
<method name="nocasecmp_to">
<return type="int">
</return>
<argument index="0" name="to" type="String">
</argument>
<description>
- Performs a case-insensitive comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal.
+ Performs a case-insensitive comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/code] of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison.
+ [b]Behavior with different string lengths:[/b] Returns [code]1[/code] if the "base" string is longer than the [code]to[/code] string or [code]-1[/code] if the "base" string is shorter than the [code]to[/code] string. Keep in mind this length is determined by the number of Unicode codepoints, [i]not[/i] the actual visible characters.
+ [b]Behavior with empty strings:[/b] Returns [code]-1[/code] if the "base" string is empty, [code]1[/code] if the [code]to[/code] string is empty or [code]0[/code] if both strings are empty.
+ To get a boolean result from a string comparison, use the [code]==[/code] operator instead. See also [method casecmp_to] and [method naturalnocasecmp_to].
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="StringName">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="String">
+ </return>
+ <argument index="0" name="right" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="String">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="StringName">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
</description>
</method>
<method name="ord_at">
@@ -782,7 +635,7 @@
<argument index="1" name="from" type="int" default="-1">
</argument>
<description>
- Performs a case-sensitive search for a substring, but starts from the end of the string instead of the beginning.
+ Returns the index of the [b]last[/b] case-sensitive occurrence of the specified string in this instance, or [code]-1[/code]. Optionally, the starting search index can be specified, continuing to the beginning of the string.
</description>
</method>
<method name="rfindn">
@@ -793,7 +646,7 @@
<argument index="1" name="from" type="int" default="-1">
</argument>
<description>
- Performs a case-insensitive search for a substring, but starts from the end of the string instead of the beginning.
+ Returns the index of the [b]last[/b] case-insensitive occurrence of the specified string in this instance, or [code]-1[/code]. Optionally, the starting search index can be specified, continuing to the beginning of the string.
</description>
</method>
<method name="right">
@@ -805,6 +658,17 @@
Returns the right side of the string from a given position.
</description>
</method>
+ <method name="rpad">
+ <return type="String">
+ </return>
+ <argument index="0" name="min_length" type="int">
+ </argument>
+ <argument index="1" name="character" type="String" default="&quot; &quot;">
+ </argument>
+ <description>
+ Formats a string to be at least [code]min_length[/code] long by adding [code]character[/code]s to the right of the string.
+ </description>
+ </method>
<method name="rsplit">
<return type="PackedStringArray">
</return>
@@ -884,8 +748,8 @@
<argument index="2" name="maxsplit" type="int" default="0">
</argument>
<description>
- Splits the string by a [code]delimiter[/code] string and returns an array of the substrings.
- If [code]maxsplit[/code] is specified, it defines the number of splits to do from the left up to [code]maxsplit[/code]. The default value of 0 means that all items are split.
+ Splits the string by a [code]delimiter[/code] string and returns an array of the substrings. The [code]delimiter[/code] can be of any length.
+ If [code]maxsplit[/code] is specified, it defines the number of splits to do from the left up to [code]maxsplit[/code]. The default value of [code]0[/code] means that all items are split.
Example:
[codeblock]
var some_string = "One,Two,Three,Four"
@@ -894,6 +758,7 @@
print(some_array[0]) # Prints "One"
print(some_array[1]) # Prints "Two,Three,Four"
[/codeblock]
+ If you need to split strings with more complex rules, use the [RegEx] class instead.
</description>
</method>
<method name="split_floats">
@@ -934,14 +799,14 @@
<argument index="1" name="len" type="int" default="-1">
</argument>
<description>
- Returns part of the string from the position [code]from[/code] with length [code]len[/code]. Argument [code]len[/code] is optional and using -1 will return remaining characters from given position.
+ Returns part of the string from the position [code]from[/code] with length [code]len[/code]. Argument [code]len[/code] is optional and using [code]-1[/code] will return remaining characters from given position.
</description>
</method>
- <method name="to_ascii">
+ <method name="to_ascii_buffer">
<return type="PackedByteArray">
</return>
<description>
- Converts the String (which is a character array) to [PackedByteArray] (which is an array of bytes). The conversion is faster compared to [method to_utf8], as this method assumes that all the characters in the String are ASCII characters.
+ Converts the String (which is a character array) to ASCII/Latin-1 encoded [PackedByteArray] (which is an array of bytes). The conversion is faster compared to [method to_utf8_buffer], as this method assumes that all the characters in the String are ASCII/Latin-1 characters, unsupported characters are replaced with spaces.
</description>
</method>
<method name="to_float">
@@ -972,11 +837,25 @@
Returns the string converted to uppercase.
</description>
</method>
- <method name="to_utf8">
+ <method name="to_utf16_buffer">
<return type="PackedByteArray">
</return>
<description>
- Converts the String (which is an array of characters) to [PackedByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii].
+ Converts the String (which is an array of characters) to UTF-16 encoded [PackedByteArray] (which is an array of bytes).
+ </description>
+ </method>
+ <method name="to_utf32_buffer">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ Converts the String (which is an array of characters) to UTF-32 encoded [PackedByteArray] (which is an array of bytes).
+ </description>
+ </method>
+ <method name="to_utf8_buffer">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ Converts the String (which is an array of characters) to UTF-8 encode [PackedByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii_buffer], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii_buffer].
</description>
</method>
<method name="trim_prefix">
@@ -1000,8 +879,10 @@
<method name="xml_escape">
<return type="String">
</return>
+ <argument index="0" name="escape_quotes" type="bool" default="false">
+ </argument>
<description>
- Returns a copy of the string with special characters escaped using the XML standard.
+ Returns a copy of the string with special characters escaped using the XML standard. If [code]escape_quotes[/code] is [code]true[/code], the single quote ([code]'[/code]) and double quote ([code]"[/code]) characters are also escaped.
</description>
</method>
<method name="xml_unescape">
diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml
index 5d8ac6fdcc..af0074f080 100644
--- a/doc/classes/StringName.xml
+++ b/doc/classes/StringName.xml
@@ -9,7 +9,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="StringName">
+ <method name="StringName" qualifiers="constructor">
+ <return type="StringName">
+ </return>
+ <description>
+ Constructs an empty [StringName].
+ </description>
+ </method>
+ <method name="StringName" qualifiers="constructor">
+ <return type="StringName">
+ </return>
+ <argument index="0" name="from" type="StringName">
+ </argument>
+ <description>
+ Constructs a [StringName] as a copy of the given [StringName].
+ </description>
+ </method>
+ <method name="StringName" qualifiers="constructor">
<return type="StringName">
</return>
<argument index="0" name="from" type="String">
@@ -18,6 +34,38 @@
Creates a new [StringName] from the given [String].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="StringName">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="StringName">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/StyleBox.xml b/doc/classes/StyleBox.xml
index 0e848a1bf6..04f8eb9d13 100644
--- a/doc/classes/StyleBox.xml
+++ b/doc/classes/StyleBox.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
StyleBox is [Resource] that provides an abstract base class for drawing stylized boxes for the UI. StyleBoxes are used for drawing the styles of buttons, line edit backgrounds, tree backgrounds, etc. and also for testing a transparency mask for pointer signals. If mask test fails on a StyleBox assigned as mask to a control, clicks and motion signals will go through it to the one below.
+ [b]Note:[/b] For children of [Control] that have [i]Theme Properties[/i], the [code]focus[/code] [StyleBox] is displayed over the [code]normal[/code], [code]hover[/code] or [code]pressed[/code] [StyleBox]. This makes the [code]focus[/code] [StyleBox] more reusable across different nodes.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml
index 8ed94c8c26..6f5577b61b 100644
--- a/doc/classes/StyleBoxTexture.xml
+++ b/doc/classes/StyleBoxTexture.xml
@@ -119,9 +119,6 @@
<member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )">
Modulates the color of the texture when this style box is drawn.
</member>
- <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map">
- The normal map to use when drawing this style box.
- </member>
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )">
Species a sub-region of the texture to use.
This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region.
diff --git a/doc/classes/SubViewport.xml b/doc/classes/SubViewport.xml
index 6014762e3d..4736401395 100644
--- a/doc/classes/SubViewport.xml
+++ b/doc/classes/SubViewport.xml
@@ -1,16 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SubViewport" inherits="Viewport" version="4.0">
<brief_description>
+ Creates a sub-view into the screen.
</brief_description>
<description>
</description>
<tutorials>
+ <link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
+ <link title="Viewports tutorial index">https://docs.godotengine.org/en/latest/tutorials/viewports/index.html</link>
+ <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
+ <link title="3D in 2D Demo">https://godotengine.org/asset-library/asset/128</link>
+ <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link>
+ <link title="Screen Capture Demo">https://godotengine.org/asset-library/asset/130</link>
+ <link title="Dynamic Split Screen Demo">https://godotengine.org/asset-library/asset/541</link>
+ <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link>
</tutorials>
<methods>
</methods>
<members>
<member name="render_target_clear_mode" type="int" setter="set_clear_mode" getter="get_clear_mode" enum="SubViewport.ClearMode" default="0">
The clear mode when the sub-viewport is used as a render target.
+ [b]Note:[/b] This property is intended for 2D usage.
</member>
<member name="render_target_update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="SubViewport.UpdateMode" default="2">
The update mode when the sub-viewport is used as a render target.
diff --git a/doc/classes/SubViewportContainer.xml b/doc/classes/SubViewportContainer.xml
index e6a0bd4866..16d483e7f8 100644
--- a/doc/classes/SubViewportContainer.xml
+++ b/doc/classes/SubViewportContainer.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
A [Container] node that holds a [SubViewport], automatically setting its size.
+ [b]Note:[/b] Changing a SubViewportContainer's [member Control.rect_scale] will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container).
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml
index eeb6b6cd9d..4f02cd00dd 100644
--- a/doc/classes/SurfaceTool.xml
+++ b/doc/classes/SurfaceTool.xml
@@ -19,6 +19,7 @@
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
</description>
<tutorials>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="add_bones">
@@ -37,6 +38,7 @@
</argument>
<description>
Specifies a [Color] for the next vertex to use.
+ [b]Note:[/b] The material must have [member BaseMaterial3D.vertex_color_use_as_albedo] enabled for the vertex color to be visible.
</description>
</method>
<method name="add_index">
diff --git a/doc/classes/SyntaxHighlighter.xml b/doc/classes/SyntaxHighlighter.xml
new file mode 100644
index 0000000000..2d6e3de02a
--- /dev/null
+++ b/doc/classes/SyntaxHighlighter.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="SyntaxHighlighter" inherits="Resource" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="_get_line_syntax_highlighting" qualifiers="virtual">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="p_line" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="_update_cache" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="clear_highlighting_cache">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_line_syntax_highlighting">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="p_line" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_text_edit">
+ <return type="TextEdit">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="update_cache">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml
index 22e92ae5d9..d56781105b 100644
--- a/doc/classes/TabContainer.xml
+++ b/doc/classes/TabContainer.xml
@@ -204,8 +204,8 @@
<theme_item name="font_color_fg" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
Font color of the currently selected tab.
</theme_item>
- <theme_item name="hseparation" type="int" default="4">
- Horizontal separation between tabs.
+ <theme_item name="icon_separation" type="int" default="4">
+ Space between tab's name and its icon.
</theme_item>
<theme_item name="increment" type="Texture2D">
Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent.
diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml
index 3fc1db9dc6..15c2d3504c 100644
--- a/doc/classes/Tabs.xml
+++ b/doc/classes/Tabs.xml
@@ -4,7 +4,7 @@
Tabs control.
</brief_description>
<description>
- Simple tabs control, similar to [TabContainer] but is only in charge of drawing tabs, not interact with children.
+ Simple tabs control, similar to [TabContainer] but is only in charge of drawing tabs, not interacting with children.
</description>
<tutorials>
</tutorials>
@@ -36,6 +36,13 @@
Returns [code]true[/code] if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible.
</description>
</method>
+ <method name="get_previous_tab" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the previously active tab index.
+ </description>
+ </method>
<method name="get_select_with_rmb" qualifiers="const">
<return type="bool">
</return>
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index b7cf93d672..168cc8a1c3 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -9,30 +9,12 @@
<tutorials>
</tutorials>
<methods>
- <method name="add_color_region">
+ <method name="add_gutter">
<return type="void">
</return>
- <argument index="0" name="begin_key" type="String">
- </argument>
- <argument index="1" name="end_key" type="String">
- </argument>
- <argument index="2" name="color" type="Color">
- </argument>
- <argument index="3" name="line_only" type="bool" default="false">
- </argument>
- <description>
- Adds color region (given the delimiters) and its colors.
- </description>
- </method>
- <method name="add_keyword_color">
- <return type="void">
- </return>
- <argument index="0" name="keyword" type="String">
- </argument>
- <argument index="1" name="color" type="Color">
+ <argument index="0" name="at" type="int" default="-1">
</argument>
<description>
- Adds a [code]keyword[/code] and its [Color].
</description>
</method>
<method name="can_fold" qualifiers="const">
@@ -48,13 +30,7 @@
<return type="void">
</return>
<description>
- </description>
- </method>
- <method name="clear_colors">
- <return type="void">
- </return>
- <description>
- Clears all custom syntax coloring information previously added with [method add_color_region] or [method add_keyword_color].
+ Centers the viewport on the line the editing cursor is at. This also resets the [member scroll_horizontal] value to [code]0[/code].
</description>
</method>
<method name="clear_undo_history">
@@ -144,20 +120,34 @@
Folds the given line, if possible (see [method can_fold]).
</description>
</method>
- <method name="get_breakpoints" qualifiers="const">
- <return type="Array">
+ <method name="get_gutter_count" qualifiers="const">
+ <return type="int">
</return>
<description>
- Returns an array containing the line number of each breakpoint.
</description>
</method>
- <method name="get_keyword_color" qualifiers="const">
- <return type="Color">
+ <method name="get_gutter_name" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_gutter_type" qualifiers="const">
+ <return type="int" enum="TextEdit.GutterType">
</return>
- <argument index="0" name="keyword" type="String">
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_gutter_width" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="gutter" type="int">
</argument>
<description>
- Returns the [Color] of the specified [code]keyword[/code].
</description>
</method>
<method name="get_line" qualifiers="const">
@@ -176,6 +166,46 @@
Returns the amount of total lines in the text.
</description>
</method>
+ <method name="get_line_gutter_icon" qualifiers="const">
+ <return type="Texture2D">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_line_gutter_item_color">
+ <return type="Color">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_line_gutter_metadata" qualifiers="const">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_line_gutter_text" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_menu" qualifiers="const">
<return type="PopupMenu">
</return>
@@ -183,6 +213,12 @@
Returns the [PopupMenu] of this [TextEdit]. By default, this menu is displayed when right-clicking on the [TextEdit].
</description>
</method>
+ <method name="get_selection_column" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_selection_from_column" qualifiers="const">
<return type="int">
</return>
@@ -197,6 +233,18 @@
Returns the selection begin line.
</description>
</method>
+ <method name="get_selection_line" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_selection_mode" qualifiers="const">
+ <return type="int" enum="TextEdit.SelectionMode">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_selection_text" qualifiers="const">
<return type="String">
</return>
@@ -222,16 +270,7 @@
<return type="String">
</return>
<description>
- Returns a [String] text with the word under the mouse cursor location.
- </description>
- </method>
- <method name="has_keyword_color" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="keyword" type="String">
- </argument>
- <description>
- Returns whether the specified [code]keyword[/code] has a color set to it or not.
+ Returns a [String] text with the word under the caret (text cursor) location.
</description>
</method>
<method name="insert_text_at_cursor">
@@ -252,6 +291,40 @@
Returns whether the line at the specified index is folded or not.
</description>
</method>
+ <method name="is_gutter_clickable" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_gutter_drawn" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_gutter_overwritable" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_line_gutter_clickable" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="is_line_hidden" qualifiers="const">
<return type="bool">
</return>
@@ -291,15 +364,16 @@
Perform redo operation.
</description>
</method>
- <method name="remove_breakpoints">
+ <method name="remove_gutter">
<return type="void">
</return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
<description>
- Removes all the breakpoints. This will not fire the [signal breakpoint_toggled] signal.
</description>
</method>
<method name="search" qualifiers="const">
- <return type="PackedInt32Array">
+ <return type="Dictionary">
</return>
<argument index="0" name="key" type="String">
</argument>
@@ -311,13 +385,13 @@
</argument>
<description>
Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum.
- Returns an empty [code]PackedInt32Array[/code] if no result was found. Otherwise, the result line and column can be accessed at indices specified in the [enum SearchResult] enum, e.g:
+ Returns an empty [code]Dictionary[/code] if no result was found. Otherwise, returns a [code]Dictionary[/code] containing [code]line[/code] and [code]column[/code] entries, e.g:
[codeblock]
var result = search(key, flags, line, column)
- if result.size() &gt; 0:
+ if !result.empty():
# Result found.
- var res_line = result[TextEdit.SEARCH_RESULT_LINE]
- var res_column = result[TextEdit.SEARCH_RESULT_COLUMN]
+ var line_number = result.line
+ var column_number = result.column
[/codeblock]
</description>
</method>
@@ -334,6 +408,7 @@
</argument>
<description>
Perform selection, from line/column to line/column.
+ If [member selecting_enabled] is [code]false[/code], no selection will occur.
</description>
</method>
<method name="select_all">
@@ -341,6 +416,90 @@
</return>
<description>
Select all the text.
+ If [member selecting_enabled] is [code]false[/code], no selection will occur.
+ </description>
+ </method>
+ <method name="set_gutter_clickable">
+ <return type="void">
+ </return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <argument index="1" name="clickable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_gutter_custom_draw">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="object" type="Object">
+ </argument>
+ <argument index="2" name="callback" type="StringName">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_gutter_draw">
+ <return type="void">
+ </return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <argument index="1" name="draw" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_gutter_name">
+ <return type="void">
+ </return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <argument index="1" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_gutter_overwritable">
+ <return type="void">
+ </return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <argument index="1" name="overwritable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_gutter_type">
+ <return type="void">
+ </return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <argument index="1" name="type" type="int" enum="TextEdit.GutterType">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_gutter_width">
+ <return type="void">
+ </return>
+ <argument index="0" name="gutter" type="int">
+ </argument>
+ <argument index="1" name="width" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_line">
+ <return type="void">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="new_text" type="String">
+ </argument>
+ <description>
+ Sets the text for a specific line.
</description>
</method>
<method name="set_line_as_hidden">
@@ -354,6 +513,78 @@
If [code]true[/code], hides the line of the specified index.
</description>
</method>
+ <method name="set_line_gutter_clickable">
+ <return type="void">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
+ </argument>
+ <argument index="2" name="clickable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_line_gutter_icon">
+ <return type="void">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
+ </argument>
+ <argument index="2" name="icon" type="Texture2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_line_gutter_item_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
+ </argument>
+ <argument index="2" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_line_gutter_metadata">
+ <return type="void">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
+ </argument>
+ <argument index="2" name="metadata" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_line_gutter_text">
+ <return type="void">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
+ </argument>
+ <argument index="2" name="text" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_selection_mode">
+ <return type="void">
+ </return>
+ <argument index="0" name="mode" type="int" enum="TextEdit.SelectionMode">
+ </argument>
+ <argument index="1" name="line" type="int" default="-1">
+ </argument>
+ <argument index="2" name="column" type="int" default="-1">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="toggle_fold_line">
<return type="void">
</return>
@@ -388,9 +619,6 @@
</method>
</methods>
<members>
- <member name="breakpoint_gutter" type="bool" setter="set_breakpoint_gutter_enabled" getter="is_breakpoint_gutter_enabled" default="false">
- If [code]true[/code], the breakpoint gutter is visible.
- </member>
<member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled" default="false">
If [code]true[/code], the caret (visual cursor) blinks.
</member>
@@ -415,9 +643,6 @@
If [code]true[/code], the "tab" character will have a visible representation.
</member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" />
- <member name="fold_gutter" type="bool" setter="set_draw_fold_gutter" getter="is_drawing_fold_gutter" default="false">
- If [code]true[/code], the fold gutter is visible. This enables folding groups of indented lines.
- </member>
<member name="hiding_enabled" type="bool" setter="set_hiding_enabled" getter="is_hiding_enabled" default="false">
If [code]true[/code], all lines that have been set to hidden by [method set_line_as_hidden], will not be visible.
</member>
@@ -428,8 +653,10 @@
If [code]true[/code], the line containing the cursor is highlighted.
</member>
<member name="minimap_draw" type="bool" setter="draw_minimap" getter="is_drawing_minimap" default="false">
+ If [code]true[/code], a minimap is shown, providing an outline of your source code.
</member>
<member name="minimap_width" type="int" setter="set_minimap_width" getter="get_minimap_width" default="80">
+ The width, in pixels, of the minimap.
</member>
<member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" override="true" enum="Control.CursorShape" default="1" />
<member name="override_selected_font_color" type="bool" setter="set_override_selected_font_color" getter="is_overriding_selected_font_color" default="false">
@@ -439,23 +666,22 @@
If [code]true[/code], read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
</member>
<member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0">
- The current horizontal scroll value.
+ If there is a horizontal scrollbar this determines the current horizontal scroll value in pixels.
</member>
<member name="scroll_vertical" type="float" setter="set_v_scroll" getter="get_v_scroll" default="0.0">
- The current vertical scroll value.
+ If there is a vertical scrollbar this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
</member>
<member name="selecting_enabled" type="bool" setter="set_selecting_enabled" getter="is_selecting_enabled" default="true">
+ If [code]true[/code], text can be selected.
+ If [code]false[/code], text can not be selected by the user or by the [method select] or [method select_all] methods.
</member>
<member name="shortcut_keys_enabled" type="bool" setter="set_shortcut_keys_enabled" getter="is_shortcut_keys_enabled" default="true">
- </member>
- <member name="show_line_numbers" type="bool" setter="set_show_line_numbers" getter="is_show_line_numbers_enabled" default="false">
- If [code]true[/code], line numbers are displayed to the left of the text.
+ If [code]true[/code], shortcut keys for context menu items are enabled, even if the context menu is disabled.
</member>
<member name="smooth_scrolling" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled" default="false">
If [code]true[/code], sets the [code]step[/code] of the scrollbars to [code]0.25[/code] which results in smoother scrolling.
</member>
- <member name="syntax_highlighting" type="bool" setter="set_syntax_coloring" getter="is_syntax_coloring_enabled" default="false">
- If [code]true[/code], any custom color properties that have been set for this [TextEdit] will be visible.
+ <member name="syntax_highlighter" type="SyntaxHighlighter" setter="set_syntax_highlighter" getter="get_syntax_highlighter">
</member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
String value of the [TextEdit].
@@ -463,30 +689,41 @@
<member name="v_scroll_speed" type="float" setter="set_v_scroll_speed" getter="get_v_scroll_speed" default="80.0">
Vertical scroll sensitivity.
</member>
+ <member name="virtual_keyboard_enabled" type="bool" setter="set_virtual_keyboard_enabled" getter="is_virtual_keyboard_enabled" default="true">
+ If [code]true[/code], the native virtual keyboard is shown when focused on platforms that support it.
+ </member>
<member name="wrap_enabled" type="bool" setter="set_wrap_enabled" getter="is_wrap_enabled" default="false">
If [code]true[/code], enables text wrapping when it goes beyond the edge of what is visible.
</member>
</members>
<signals>
- <signal name="breakpoint_toggled">
- <argument index="0" name="row" type="int">
+ <signal name="cursor_changed">
+ <description>
+ Emitted when the cursor changes.
+ </description>
+ </signal>
+ <signal name="gutter_added">
+ <description>
+ </description>
+ </signal>
+ <signal name="gutter_clicked">
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="gutter" type="int">
</argument>
<description>
- Emitted when a breakpoint is placed via the breakpoint gutter.
</description>
</signal>
- <signal name="cursor_changed">
+ <signal name="gutter_removed">
<description>
- Emitted when the cursor changes.
</description>
</signal>
- <signal name="info_clicked">
- <argument index="0" name="row" type="int">
+ <signal name="lines_edited_from">
+ <argument index="0" name="from_line" type="int">
</argument>
- <argument index="1" name="info" type="String">
+ <argument index="1" name="to_line" type="int">
</argument>
<description>
- Emitted when the info icon is clicked.
</description>
</signal>
<signal name="request_completion">
@@ -525,11 +762,21 @@
<constant name="SEARCH_BACKWARDS" value="4" enum="SearchFlags">
Search from end to beginning.
</constant>
- <constant name="SEARCH_RESULT_COLUMN" value="0" enum="SearchResult">
- Used to access the result column from [method search].
+ <constant name="SELECTION_MODE_NONE" value="0" enum="SelectionMode">
+ </constant>
+ <constant name="SELECTION_MODE_SHIFT" value="1" enum="SelectionMode">
+ </constant>
+ <constant name="SELECTION_MODE_POINTER" value="2" enum="SelectionMode">
+ </constant>
+ <constant name="SELECTION_MODE_WORD" value="3" enum="SelectionMode">
</constant>
- <constant name="SEARCH_RESULT_LINE" value="1" enum="SearchResult">
- Used to access the result line from [method search].
+ <constant name="SELECTION_MODE_LINE" value="4" enum="SelectionMode">
+ </constant>
+ <constant name="GUTTER_TYPE_STRING" value="0" enum="GutterType">
+ </constant>
+ <constant name="GUTTER_TPYE_ICON" value="1" enum="GutterType">
+ </constant>
+ <constant name="GUTTER_TPYE_CUSTOM" value="2" enum="GutterType">
</constant>
<constant name="MENU_CUT" value="0" enum="MenuItems">
Cuts (copies and clears) the selected text.
@@ -560,14 +807,8 @@
<theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 0 )">
Sets the background [Color] of this [TextEdit]. [member syntax_highlighting] has to be enabled.
</theme_item>
- <theme_item name="bookmark_color" type="Color" default="Color( 0.08, 0.49, 0.98, 1 )">
- Sets the [Color] of the bookmark marker. [member syntax_highlighting] has to be enabled.
- </theme_item>
<theme_item name="brace_mismatch_color" type="Color" default="Color( 1, 0.2, 0.2, 1 )">
</theme_item>
- <theme_item name="breakpoint_color" type="Color" default="Color( 0.8, 0.8, 0.4, 0.2 )">
- Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled.
- </theme_item>
<theme_item name="caret_background_color" type="Color" default="Color( 0, 0, 0, 1 )">
</theme_item>
<theme_item name="caret_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
@@ -595,14 +836,8 @@
<theme_item name="current_line_color" type="Color" default="Color( 0.25, 0.25, 0.26, 0.8 )">
Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled.
</theme_item>
- <theme_item name="executing_line_color" type="Color" default="Color( 0.2, 0.8, 0.2, 0.4 )">
- </theme_item>
<theme_item name="focus" type="StyleBox">
</theme_item>
- <theme_item name="fold" type="Texture2D">
- </theme_item>
- <theme_item name="folded" type="Texture2D">
- </theme_item>
<theme_item name="font" type="Font">
Sets the default [Font].
</theme_item>
@@ -614,36 +849,23 @@
<theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )">
Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled.
</theme_item>
- <theme_item name="function_color" type="Color" default="Color( 0.4, 0.64, 0.81, 1 )">
- </theme_item>
- <theme_item name="line_number_color" type="Color" default="Color( 0.67, 0.67, 0.67, 0.4 )">
- Sets the [Color] of the line numbers. [member show_line_numbers] has to be enabled.
- </theme_item>
<theme_item name="line_spacing" type="int" default="4">
Sets the spacing between the lines.
</theme_item>
<theme_item name="mark_color" type="Color" default="Color( 1, 0.4, 0.4, 0.4 )">
Sets the [Color] of marked text.
</theme_item>
- <theme_item name="member_variable_color" type="Color" default="Color( 0.9, 0.31, 0.35, 1 )">
- </theme_item>
<theme_item name="normal" type="StyleBox">
Sets the [StyleBox] of this [TextEdit].
</theme_item>
- <theme_item name="number_color" type="Color" default="Color( 0.92, 0.58, 0.2, 1 )">
- </theme_item>
<theme_item name="read_only" type="StyleBox">
Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled.
</theme_item>
- <theme_item name="safe_line_number_color" type="Color" default="Color( 0.67, 0.78, 0.67, 0.6 )">
- </theme_item>
<theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )">
Sets the highlight [Color] of text selections.
</theme_item>
<theme_item name="space" type="Texture2D">
</theme_item>
- <theme_item name="symbol_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
- </theme_item>
<theme_item name="tab" type="Texture2D">
Sets a custom [Texture2D] for tab text characters.
</theme_item>
diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml
index ffe806cef7..ff8b439a3d 100644
--- a/doc/classes/Texture2D.xml
+++ b/doc/classes/Texture2D.xml
@@ -22,16 +22,6 @@
</argument>
<argument index="3" name="transpose" type="bool" default="false">
</argument>
- <argument index="4" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="5" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_color_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="7" name="texture_filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" default="0">
- </argument>
- <argument index="8" name="texture_repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" default="0">
- </argument>
<description>
Draws the texture using a [CanvasItem] with the [RenderingServer] API at the specified [code]position[/code].
</description>
@@ -49,16 +39,6 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
- <argument index="5" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="7" name="specular_color_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="8" name="texture_filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" default="0">
- </argument>
- <argument index="9" name="texture_repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" default="0">
- </argument>
<description>
Draws the texture using a [CanvasItem] with the [RenderingServer] API.
</description>
@@ -76,17 +56,7 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
- <argument index="5" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="7" name="specular_color_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="8" name="texture_filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" default="0">
- </argument>
- <argument index="9" name="texture_repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" default="0">
- </argument>
- <argument index="10" name="clip_uv" type="bool" default="true">
+ <argument index="5" name="clip_uv" type="bool" default="true">
</argument>
<description>
Draws a part of the texture using a [CanvasItem] with the [RenderingServer] API.
@@ -96,7 +66,7 @@
<return type="Image">
</return>
<description>
- Returns an [Image] with the data from this [Texture2D]. [Image]s can be accessed and manipulated directly.
+ Returns an [Image] that is a copy of data from this [Texture2D]. [Image]s can be accessed and manipulated directly.
</description>
</method>
<method name="get_height" qualifiers="const">
diff --git a/doc/classes/Texture2DArray.xml b/doc/classes/Texture2DArray.xml
index 657506120e..bb9283803d 100644
--- a/doc/classes/Texture2DArray.xml
+++ b/doc/classes/Texture2DArray.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="Texture2DArray" inherits="TextureLayered" version="4.0">
+<class name="Texture2DArray" inherits="ImageTextureLayered" version="4.0">
<brief_description>
</brief_description>
<description>
diff --git a/doc/classes/Texture3D.xml b/doc/classes/Texture3D.xml
new file mode 100644
index 0000000000..85e940716d
--- /dev/null
+++ b/doc/classes/Texture3D.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="Texture3D" inherits="Texture" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="get_data" qualifiers="const">
+ <return type="Image[]">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_depth" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_format" qualifiers="const">
+ <return type="int" enum="Image.Format">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_height" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_width" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="has_mipmaps" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml
index 0e2872755e..70bf138f27 100644
--- a/doc/classes/TextureButton.xml
+++ b/doc/classes/TextureButton.xml
@@ -6,8 +6,10 @@
<description>
[TextureButton] has the same functionality as [Button], except it uses sprites instead of Godot's [Theme] resource. It is faster to create, but it doesn't support localization like more complex [Control]s.
The "normal" state must contain a texture ([member texture_normal]); other textures are optional.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
@@ -15,6 +17,12 @@
<member name="expand" type="bool" setter="set_expand" getter="get_expand" default="false">
If [code]true[/code], the texture stretches to the edges of the node's bounding rectangle using the [member stretch_mode]. If [code]false[/code], the texture will not scale with the node.
</member>
+ <member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" default="false">
+ If [code]true[/code], texture is flipped horizontally.
+ </member>
+ <member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v" default="false">
+ If [code]true[/code], texture is flipped vertically.
+ </member>
<member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureButton.StretchMode" default="0">
Controls the texture's behavior when you resize the node's bounding rectangle, [b]only if[/b] [member expand] is [code]true[/code]. Set it to one of the [enum StretchMode] constants. See the constants to learn more.
</member>
diff --git a/doc/classes/TextureLayered.xml b/doc/classes/TextureLayered.xml
index 66e5b69ab4..d81c3c7c5a 100644
--- a/doc/classes/TextureLayered.xml
+++ b/doc/classes/TextureLayered.xml
@@ -9,14 +9,6 @@
<tutorials>
</tutorials>
<methods>
- <method name="create_from_images">
- <return type="int" enum="Error">
- </return>
- <argument index="0" name="images" type="Array">
- </argument>
- <description>
- </description>
- </method>
<method name="get_format" qualifiers="const">
<return type="int" enum="Image.Format">
</return>
@@ -40,6 +32,12 @@
Returns an [Image] resource with the data from specified [code]layer[/code].
</description>
</method>
+ <method name="get_layered_type" qualifiers="const">
+ <return type="int" enum="TextureLayered.LayeredType">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_layers" qualifiers="const">
<return type="int">
</return>
@@ -53,17 +51,19 @@
Returns the width of the texture. Width is typically represented by the X-axis.
</description>
</method>
- <method name="update_layer">
- <return type="void">
+ <method name="has_mipmaps" qualifiers="const">
+ <return type="bool">
</return>
- <argument index="0" name="image" type="Image">
- </argument>
- <argument index="1" name="layer" type="int">
- </argument>
<description>
</description>
</method>
</methods>
<constants>
+ <constant name="LAYERED_TYPE_2D_ARRAY" value="0" enum="LayeredType">
+ </constant>
+ <constant name="LAYERED_TYPE_CUBEMAP" value="1" enum="LayeredType">
+ </constant>
+ <constant name="LAYERED_TYPE_CUBEMAP_ARRAY" value="2" enum="LayeredType">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml
index 709d87b858..743e7f6d1e 100644
--- a/doc/classes/TextureRect.xml
+++ b/doc/classes/TextureRect.xml
@@ -7,6 +7,7 @@
Used to draw icons and sprites in a user interface. The texture's placement can be controlled with the [member stretch_mode] property. It can scale, tile, or stay centered inside its bounding rectangle.
</description>
<tutorials>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml
index 70a4eda867..783614c4af 100644
--- a/doc/classes/Theme.xml
+++ b/doc/classes/Theme.xml
@@ -8,7 +8,7 @@
Theme resources can alternatively be loaded by writing them in a [code].theme[/code] file, see the documentation for more information.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/gui/gui_skinning.html</link>
+ <link title="GUI skinning">https://docs.godotengine.org/en/latest/tutorials/gui/gui_skinning.html</link>
</tutorials>
<methods>
<method name="clear">
@@ -23,10 +23,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Clears the [Color] at [code]name[/code] if the theme has [code]type[/code].
+ Clears the [Color] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="clear_constant">
@@ -34,10 +34,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Clears the constant at [code]name[/code] if the theme has [code]type[/code].
+ Clears the constant at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="clear_font">
@@ -45,10 +45,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Clears the [Font] at [code]name[/code] if the theme has [code]type[/code].
+ Clears the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="clear_icon">
@@ -56,10 +56,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Clears the icon at [code]name[/code] if the theme has [code]type[/code].
+ Clears the icon at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="clear_stylebox">
@@ -67,10 +67,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Clears [StyleBox] at [code]name[/code] if the theme has [code]type[/code].
+ Clears [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="copy_default_theme">
@@ -94,19 +94,19 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns the [Color] at [code]name[/code] if the theme has [code]type[/code].
+ Returns the [Color] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_color_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the [Color]s as a [PackedStringArray] filled with each [Color]'s name, for use in [method get_color], if the theme has [code]type[/code].
+ Returns all the [Color]s as a [PackedStringArray] filled with each [Color]'s name, for use in [method get_color], if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_constant" qualifiers="const">
@@ -114,19 +114,19 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns the constant at [code]name[/code] if the theme has [code]type[/code].
+ Returns the constant at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_constant_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the constants as a [PackedStringArray] filled with each constant's name, for use in [method get_constant], if the theme has [code]type[/code].
+ Returns all the constants as a [PackedStringArray] filled with each constant's name, for use in [method get_constant], if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_font" qualifiers="const">
@@ -134,19 +134,19 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns the [Font] at [code]name[/code] if the theme has [code]type[/code].
+ Returns the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_font_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the [Font]s as a [PackedStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]type[/code].
+ Returns all the [Font]s as a [PackedStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_icon" qualifiers="const">
@@ -154,19 +154,19 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns the icon [Texture2D] at [code]name[/code] if the theme has [code]type[/code].
+ Returns the icon [Texture2D] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_icon_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the icons as a [PackedStringArray] filled with each [Texture2D]'s name, for use in [method get_icon], if the theme has [code]type[/code].
+ Returns all the icons as a [PackedStringArray] filled with each [Texture2D]'s name, for use in [method get_icon], if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_stylebox" qualifiers="const">
@@ -174,35 +174,35 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns the icon [StyleBox] at [code]name[/code] if the theme has [code]type[/code].
+ Returns the icon [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_stylebox_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the [StyleBox]s as a [PackedStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the theme has [code]type[/code].
+ Returns all the [StyleBox]s as a [PackedStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_stylebox_types" qualifiers="const">
<return type="PackedStringArray">
</return>
<description>
- Returns all the [StyleBox] types as a [PackedStringArray] filled with each [StyleBox]'s type, for use in [method get_stylebox] and/or [method get_stylebox_list], if the theme has [code]type[/code].
+ Returns all the [StyleBox] types as a [PackedStringArray] filled with each [StyleBox]'s type, for use in [method get_stylebox] and/or [method get_stylebox_list], if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_type_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the types in [code]type[/code] as a [PackedStringArray] for use in any of the [code]get_*[/code] functions, if the theme has [code]type[/code].
+ Returns all the types in [code]node_type[/code] as a [PackedStringArray] for use in any of the [code]get_*[/code] functions, if the theme has [code]node_type[/code].
</description>
</method>
<method name="has_color" qualifiers="const">
@@ -210,11 +210,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the theme does not have [code]type[/code].
+ Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="has_constant" qualifiers="const">
@@ -222,11 +222,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns [code]true[/code] if constant with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the theme does not have [code]type[/code].
+ Returns [code]true[/code] if constant with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="has_font" qualifiers="const">
@@ -234,11 +234,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the theme does not have [code]type[/code].
+ Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="has_icon" qualifiers="const">
@@ -246,11 +246,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns [code]true[/code] if icon [Texture2D] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the theme does not have [code]type[/code].
+ Returns [code]true[/code] if icon [Texture2D] with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="has_stylebox" qualifiers="const">
@@ -258,11 +258,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the theme does not have [code]type[/code].
+ Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="set_color">
@@ -270,13 +270,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<argument index="2" name="color" type="Color">
</argument>
<description>
- Sets the theme's [Color] to [code]color[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the theme does not have [code]type[/code].
+ Sets the theme's [Color] to [code]color[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="set_constant">
@@ -284,13 +284,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<argument index="2" name="constant" type="int">
</argument>
<description>
- Sets the theme's constant to [code]constant[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the theme does not have [code]type[/code].
+ Sets the theme's constant to [code]constant[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="set_font">
@@ -298,13 +298,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<argument index="2" name="font" type="Font">
</argument>
<description>
- Sets the theme's [Font] to [code]font[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the theme does not have [code]type[/code].
+ Sets the theme's [Font] to [code]font[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="set_icon">
@@ -312,13 +312,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<argument index="2" name="texture" type="Texture2D">
</argument>
<description>
- Sets the theme's icon [Texture2D] to [code]texture[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the theme does not have [code]type[/code].
+ Sets the theme's icon [Texture2D] to [code]texture[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="set_stylebox">
@@ -326,13 +326,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<argument index="2" name="texture" type="StyleBox">
</argument>
<description>
- Sets theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the theme does not have [code]type[/code].
+ Sets theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/Thread.xml b/doc/classes/Thread.xml
index 4d6e89fa6f..88f46e3937 100644
--- a/doc/classes/Thread.xml
+++ b/doc/classes/Thread.xml
@@ -5,16 +5,19 @@
</brief_description>
<description>
A unit of execution in a process. Can run methods on [Object]s simultaneously. The use of synchronization via [Mutex] or [Semaphore] is advised if working with shared objects.
+ [b]Note:[/b] Breakpoints won't break on code if it's running in a thread. This is a current limitation of the GDScript debugger.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link>
+ <link title="Using multiple threads">https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link>
+ <link title="Thread-safe APIs">https://docs.godotengine.org/en/latest/tutorials/threads/thread_safe_apis.html</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="get_id" qualifiers="const">
<return type="String">
</return>
<description>
- Returns the current [Thread]'s ID, uniquely identifying it among all threads.
+ Returns the current [Thread]'s ID, uniquely identifying it among all threads. If the [Thread] is not running this returns an empty string.
</description>
</method>
<method name="is_active" qualifiers="const">
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index bfe6983f06..c500052592 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -7,7 +7,13 @@
Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link>
+ <link title="Using Tilemaps">https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link>
+ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
+ <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link>
+ <link title="2D Hexagonal Demo">https://godotengine.org/asset-library/asset/111</link>
+ <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
+ <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
<method name="clear">
@@ -80,13 +86,13 @@
Returns a [Vector2] array with the positions of all cells containing a tile from the tileset (i.e. a tile index different from [code]-1[/code]).
</description>
</method>
- <method name="get_used_cells_by_id" qualifiers="const">
+ <method name="get_used_cells_by_index" qualifiers="const">
<return type="Vector2i[]">
</return>
- <argument index="0" name="id" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
- Returns an array of all cells with the given tile [code]id[/code].
+ Returns an array of all cells with the given tile [code]index[/code].
</description>
</method>
<method name="get_used_rect">
@@ -166,7 +172,7 @@
If you need these to be immediately updated, you can call [method update_dirty_quadrants].
Overriding this method also overrides it internally, allowing custom logic to be implemented when tiles are placed/removed:
[codeblock]
- func set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord)
+ func set_cell(x, y, tile, flip_x=false, flip_y=false, transpose=false, autotile_coord=Vector2())
# Write your custom logic here.
# To call the default method:
.set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord)
@@ -273,8 +279,8 @@
<member name="cell_tile_origin" type="int" setter="set_tile_origin" getter="get_tile_origin" enum="TileMap.TileOrigin" default="0">
Position for tile origin. See [enum TileOrigin] for possible values.
</member>
- <member name="cell_y_sort" type="bool" setter="set_y_sort_mode" getter="is_y_sort_mode_enabled" default="false">
- If [code]true[/code], the TileMap's children will be drawn in order of their Y coordinate.
+ <member name="cell_y_sort" type="bool" setter="set_y_sort_enabled" getter="is_y_sort_enabled" default="false">
+ If [code]true[/code], the TileMap's direct children will be drawn in order of their Y coordinate.
</member>
<member name="centered_textures" type="bool" setter="set_centered_textures" getter="is_centered_textures_enabled" default="false">
If [code]true[/code], the textures will be centered in the middle of each tile. This is useful for certain isometric or top-down modes when textures are made larger or smaller than the tiles (e.g. to avoid flickering on tile edges). The offset is still applied, but from the center of the tile. If used, [member compatibility_mode] is ignored.
@@ -287,10 +293,10 @@
Friction value for static body collisions (see [code]collision_use_kinematic[/code]).
</member>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
- The collision layer(s) for all colliders in the TileMap.
+ The collision layer(s) for all colliders in the TileMap. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The collision mask(s) for all colliders in the TileMap.
+ The collision mask(s) for all colliders in the TileMap. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="collision_use_kinematic" type="bool" setter="set_collision_use_kinematic" getter="get_collision_use_kinematic" default="false">
If [code]true[/code], TileMap collisions will be handled as a kinematic body. If [code]false[/code], collisions will be handled as static body.
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml
index 65988ae2b7..adc5880c71 100644
--- a/doc/classes/TileSet.xml
+++ b/doc/classes/TileSet.xml
@@ -8,6 +8,13 @@
Tiles are referenced by a unique integer ID.
</description>
<tutorials>
+ <link title="Using Tilemaps">https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link>
+ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
+ <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link>
+ <link title="2D Hexagonal Demo">https://godotengine.org/asset-library/asset/111</link>
+ <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
+ <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
<method name="_forward_atlas_subtile_selection" qualifiers="virtual">
@@ -44,6 +51,8 @@
<argument index="1" name="neighbor_id" type="int">
</argument>
<description>
+ Determines when the auto-tiler should consider two different auto-tile IDs to be bound together.
+ [b]Note:[/b] [code]neighbor_id[/code] will be [code]-1[/code] ([constant TileMap.INVALID_CELL]) when checking a tile against an empty neighbor tile.
</description>
</method>
<method name="autotile_clear_bitmask_map">
@@ -380,15 +389,6 @@
Returns the offset of the tile's navigation polygon.
</description>
</method>
- <method name="tile_get_normal_map" qualifiers="const">
- <return type="Texture2D">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile's normal map texture.
- </description>
- </method>
<method name="tile_get_occluder_offset" qualifiers="const">
<return type="Vector2">
</return>
@@ -476,7 +476,17 @@
<argument index="0" name="id" type="int">
</argument>
<description>
- Returns an array of the tile's shapes.
+ Returns an array of dictionaries describing the tile's shapes.
+ [b]Dictionary structure in the array returned by this method:[/b]
+ [codeblock]
+ {
+ "autotile_coord": Vector2,
+ "one_way": bool,
+ "one_way_margin": int,
+ "shape": CollisionShape2D,
+ "shape_transform": Transform2D,
+ }
+ [/codeblock]
</description>
</method>
<method name="tile_get_texture" qualifiers="const">
@@ -581,17 +591,6 @@
Sets an offset for the tile's navigation polygon.
</description>
</method>
- <method name="tile_set_normal_map">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="normal_map" type="Texture2D">
- </argument>
- <description>
- Sets the tile's normal map texture.
- </description>
- </method>
<method name="tile_set_occluder_offset">
<return type="void">
</return>
diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml
index c1e5987a06..ab75e21ce8 100644
--- a/doc/classes/Timer.xml
+++ b/doc/classes/Timer.xml
@@ -5,8 +5,10 @@
</brief_description>
<description>
Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one-shot" mode.
+ [b]Note:[/b] To create an one-shot timer without instantiating a node, use [method SceneTree.create_timer].
</description>
<tutorials>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="is_stopped" qualifiers="const">
diff --git a/doc/classes/ToolButton.xml b/doc/classes/ToolButton.xml
deleted file mode 100644
index f78627b163..0000000000
--- a/doc/classes/ToolButton.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="ToolButton" inherits="Button" version="4.0">
- <brief_description>
- Flat button helper class.
- </brief_description>
- <description>
- This is a helper class to generate a flat [Button] (see [member Button.flat]), creating a [ToolButton] is equivalent to:
- [codeblock]
- var btn = Button.new()
- btn.flat = true
- [/codeblock]
- </description>
- <tutorials>
- </tutorials>
- <methods>
- </methods>
- <members>
- <member name="flat" type="bool" setter="set_flat" getter="is_flat" override="true" default="true" />
- </members>
- <constants>
- </constants>
- <theme_items>
- <theme_item name="disabled" type="StyleBox">
- [StyleBox] used when the [ToolButton] is disabled.
- </theme_item>
- <theme_item name="focus" type="StyleBox">
- [StyleBox] used when the [ToolButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect.
- </theme_item>
- <theme_item name="font" type="Font">
- [Font] of the [ToolButton]'s text.
- </theme_item>
- <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
- Default text [Color] of the [ToolButton].
- </theme_item>
- <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.95, 1, 0.3 )">
- Text [Color] used when the [ToolButton] is disabled.
- </theme_item>
- <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
- Text [Color] used when the [ToolButton] is being hovered.
- </theme_item>
- <theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
- Text [Color] used when the [ToolButton] is being pressed.
- </theme_item>
- <theme_item name="hover" type="StyleBox">
- [StyleBox] used when the [ToolButton] is being hovered.
- </theme_item>
- <theme_item name="hseparation" type="int" default="3">
- The horizontal space between [ToolButton]'s icon and text.
- </theme_item>
- <theme_item name="normal" type="StyleBox">
- Default [StyleBox] for the [ToolButton].
- </theme_item>
- <theme_item name="pressed" type="StyleBox">
- [StyleBox] used when the [ToolButton] is being pressed.
- </theme_item>
- </theme_items>
-</class>
diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml
index c7f886b3f2..355804f2a3 100644
--- a/doc/classes/TouchScreenButton.xml
+++ b/doc/classes/TouchScreenButton.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="TouchScreenButton" inherits="Node2D" version="4.0">
<brief_description>
- Button for touch screen devices.
+ Button for touch screen devices for gameplay use.
</brief_description>
<description>
- Button for touch screen devices. You can set it to be visible on all screens, or only on touch devices.
+ TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move.
+ This node inherits from [Node2D]. Unlike with [Control] nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [Button] nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings.
+ You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml
index e4d367c344..cda69f6a64 100644
--- a/doc/classes/Transform.xml
+++ b/doc/classes/Transform.xml
@@ -4,64 +4,58 @@
3D transformation (3×4 matrix).
</brief_description>
<description>
- Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a [member basis] and an [member origin]. It is similar to a 3×4 matrix.
+ 3×4 matrix (3 rows, 4 columns) used for 3D linear transformations. It can represent transformations such as translation, rotation, or scaling. It consists of a [member basis] (first 3 columns) and a [Vector3] for the [member origin] (last column).
+ For more information, read the "Matrices and transforms" documentation article.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Matrices and transforms">https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link>
+ <link title="Using 3D transforms">https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link>
</tutorials>
<methods>
- <method name="Transform">
+ <method name="Transform" qualifiers="constructor">
<return type="Transform">
</return>
- <argument index="0" name="x_axis" type="Vector3">
- </argument>
- <argument index="1" name="y_axis" type="Vector3">
- </argument>
- <argument index="2" name="z_axis" type="Vector3">
- </argument>
- <argument index="3" name="origin" type="Vector3">
- </argument>
<description>
- Constructs the Transform from four [Vector3]. Each axis corresponds to local basis vectors (some of which may be scaled).
+ Constructs a default-initialized [Transform] set to [constant IDENTITY].
</description>
</method>
- <method name="Transform">
+ <method name="Transform" qualifiers="constructor">
<return type="Transform">
</return>
- <argument index="0" name="basis" type="Basis">
- </argument>
- <argument index="1" name="origin" type="Vector3">
+ <argument index="0" name="from" type="Transform">
</argument>
<description>
- Constructs the Transform from a [Basis] and [Vector3].
+ Constructs a [Transform] as a copy of the given [Transform].
</description>
</method>
- <method name="Transform">
+ <method name="Transform" qualifiers="constructor">
<return type="Transform">
</return>
- <argument index="0" name="from" type="Transform2D">
+ <argument index="0" name="basis" type="Basis">
</argument>
- <description>
- Constructs the Transform from a [Transform2D].
- </description>
- </method>
- <method name="Transform">
- <return type="Transform">
- </return>
- <argument index="0" name="from" type="Quat">
+ <argument index="1" name="origin" type="Vector3">
</argument>
<description>
- Constructs the Transform from a [Quat]. The origin will be Vector3(0, 0, 0).
+ Constructs a Transform from a [Basis] and [Vector3].
</description>
</method>
- <method name="Transform">
+ <method name="Transform" qualifiers="constructor">
<return type="Transform">
</return>
- <argument index="0" name="from" type="Basis">
+ <argument index="0" name="x_axis" type="Vector3">
+ </argument>
+ <argument index="1" name="y_axis" type="Vector3">
+ </argument>
+ <argument index="2" name="z_axis" type="Vector3">
+ </argument>
+ <argument index="3" name="origin" type="Vector3">
</argument>
<description>
- Constructs the Transform from a [Basis]. The origin will be Vector3(0, 0, 0).
+ Constructs a Transform from four [Vector3] values (matrix columns). Each axis corresponds to local basis vectors (some of which may be scaled).
</description>
</method>
<method name="affine_inverse">
@@ -74,12 +68,12 @@
<method name="interpolate_with">
<return type="Transform">
</return>
- <argument index="0" name="transform" type="Transform">
+ <argument index="0" name="xform" type="Transform">
</argument>
<argument index="1" name="weight" type="float">
</argument>
<description>
- Interpolates the transform to other Transform by weight amount (0-1).
+ Interpolates the transform to other Transform by weight amount (on the range of 0.0 to 1.0).
</description>
</method>
<method name="inverse">
@@ -92,7 +86,7 @@
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="transform" type="Transform">
+ <argument index="0" name="xform" type="Transform">
</argument>
<description>
Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
@@ -111,6 +105,54 @@
Operations take place in global space.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="right" type="PackedVector3Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Transform">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="AABB">
+ </return>
+ <argument index="0" name="right" type="AABB">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="orthonormalized">
<return type="Transform">
</return>
@@ -135,7 +177,7 @@
<argument index="0" name="scale" type="Vector3">
</argument>
<description>
- Scales the transform by the given scale factor, using matrix multiplication.
+ Scales basis and origin of the transform by the given scale factor, using matrix multiplication.
</description>
</method>
<method name="translated">
@@ -148,31 +190,13 @@
Unlike [method rotated] and [method scaled], this does not use matrix multiplication.
</description>
</method>
- <method name="xform">
- <return type="Variant">
- </return>
- <argument index="0" name="v" type="Variant">
- </argument>
- <description>
- Transforms the given [Vector3], [Plane], [AABB], or [PackedVector3Array] by this transform.
- </description>
- </method>
- <method name="xform_inv">
- <return type="Variant">
- </return>
- <argument index="0" name="v" type="Variant">
- </argument>
- <description>
- Inverse-transforms the given [Vector3], [Plane], [AABB], or [PackedVector3Array] by this transform.
- </description>
- </method>
</methods>
<members>
<member name="basis" type="Basis" setter="" getter="" default="Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )">
The basis is a matrix containing 3 [Vector3] as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.
</member>
<member name="origin" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
- The translation offset of the transform.
+ The translation offset of the transform (column 3, the fourth column). Equivalent to array index [code]3[/code].
</member>
</members>
<constants>
diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml
index af93d4c654..ff291663fa 100644
--- a/doc/classes/Transform2D.xml
+++ b/doc/classes/Transform2D.xml
@@ -1,37 +1,36 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Transform2D" version="4.0">
<brief_description>
- 2D transformation (3×2 matrix).
+ 2D transformation (2×3 matrix).
</brief_description>
<description>
- Represents one or many transformations in 2D space such as translation, rotation, or scaling. It consists of two [member x] and [member y] [Vector2]s and an [member origin]. It is similar to a 3×2 matrix.
+ 2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, or scaling. It consists of a three [Vector2] values: [member x], [member y], and the [member origin].
+ For more information, read the "Matrices and transforms" documentation article.
</description>
<tutorials>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Matrices and transforms">https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link>
</tutorials>
<methods>
- <method name="Transform2D">
+ <method name="Transform2D" qualifiers="constructor">
<return type="Transform2D">
</return>
- <argument index="0" name="from" type="Transform">
- </argument>
<description>
- Constructs the transform from a 3D [Transform].
+ Constructs a default-initialized [Transform] set to [constant IDENTITY].
</description>
</method>
- <method name="Transform2D">
+ <method name="Transform2D" qualifiers="constructor">
<return type="Transform2D">
</return>
- <argument index="0" name="x_axis" type="Vector2">
- </argument>
- <argument index="1" name="y_axis" type="Vector2">
- </argument>
- <argument index="2" name="origin" type="Vector2">
+ <argument index="0" name="from" type="Transform2D">
</argument>
<description>
- Constructs the transform from 3 [Vector2]s representing x, y, and origin.
+ Constructs a [Transform2D] as a copy of the given [Transform2D].
</description>
</method>
- <method name="Transform2D">
+ <method name="Transform2D" qualifiers="constructor">
<return type="Transform2D">
</return>
<argument index="0" name="rotation" type="float">
@@ -42,11 +41,24 @@
Constructs the transform from a given angle (in radians) and position.
</description>
</method>
+ <method name="Transform2D" qualifiers="constructor">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="x_axis" type="Vector2">
+ </argument>
+ <argument index="1" name="y_axis" type="Vector2">
+ </argument>
+ <argument index="2" name="origin" type="Vector2">
+ </argument>
+ <description>
+ Constructs the transform from 3 [Vector2] values representing [member x], [member y], and the [member origin] (the three column vectors).
+ </description>
+ </method>
<method name="affine_inverse">
<return type="Transform2D">
</return>
<description>
- Returns the inverse of the matrix.
+ Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation.
</description>
</method>
<method name="basis_xform">
@@ -55,7 +67,8 @@
<argument index="0" name="v" type="Vector2">
</argument>
<description>
- Transforms the given vector by this transform's basis (no translation).
+ Returns a vector transformed (multiplied) by the basis matrix.
+ This method does not account for translation (the origin vector).
</description>
</method>
<method name="basis_xform_inv">
@@ -64,7 +77,8 @@
<argument index="0" name="v" type="Vector2">
</argument>
<description>
- Inverse-transforms the given vector by this transform's basis (no translation).
+ Returns a vector transformed (multiplied) by the inverse basis matrix.
+ This method does not account for translation (the origin vector).
</description>
</method>
<method name="get_origin">
@@ -91,35 +105,91 @@
<method name="interpolate_with">
<return type="Transform2D">
</return>
- <argument index="0" name="transform" type="Transform2D">
+ <argument index="0" name="xform" type="Transform2D">
</argument>
- <argument index="1" name="weight" type="float">
+ <argument index="1" name="t" type="float">
</argument>
<description>
- Returns a transform interpolated between this transform and another by a given weight (0-1).
+ Returns a transform interpolated between this transform and another by a given weight (on the range of 0.0 to 1.0).
</description>
</method>
<method name="inverse">
<return type="Transform2D">
</return>
<description>
- Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling).
+ Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use [method affine_inverse] for transforms with scaling).
</description>
</method>
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="transform" type="Transform2D">
+ <argument index="0" name="xform" type="Transform2D">
</argument>
<description>
Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="right" type="Rect2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="PackedVector2Array">
+ </return>
+ <argument index="0" name="right" type="PackedVector2Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="orthonormalized">
<return type="Transform2D">
</return>
<description>
- Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors.
+ Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors (scale of 1 or -1).
</description>
</method>
<method name="rotated">
@@ -150,45 +220,27 @@
Unlike [method rotated] and [method scaled], this does not use matrix multiplication.
</description>
</method>
- <method name="xform">
- <return type="Variant">
- </return>
- <argument index="0" name="v" type="Variant">
- </argument>
- <description>
- Transforms the given [Vector2], [Rect2], or [PackedVector2Array] by this transform.
- </description>
- </method>
- <method name="xform_inv">
- <return type="Variant">
- </return>
- <argument index="0" name="v" type="Variant">
- </argument>
- <description>
- Inverse-transforms the given [Vector2], [Rect2], or [PackedVector2Array] by this transform.
- </description>
- </method>
</methods>
<members>
<member name="origin" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )">
- The transform's translation offset.
+ The origin vector (column 2, the third column). Equivalent to array index [code]2[/code]. The origin vector represents translation.
</member>
<member name="x" type="Vector2" setter="" getter="" default="Vector2( 1, 0 )">
- The X axis of 2×2 basis matrix containing 2 [Vector2]s as its columns: X axis and Y axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.
+ The basis matrix's X vector (column 0). Equivalent to array index [code]0[/code].
</member>
<member name="y" type="Vector2" setter="" getter="" default="Vector2( 0, 1 )">
- The Y axis of 2×2 basis matrix containing 2 [Vector2]s as its columns: X axis and Y axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.
+ The basis matrix's Y vector (column 1). Equivalent to array index [code]1[/code].
</member>
</members>
<constants>
<constant name="IDENTITY" value="Transform2D( 1, 0, 0, 1, 0, 0 )">
- [Transform2D] with no translation, rotation or scaling applied. When applied to other data structures, [constant IDENTITY] performs no transformation.
+ The identity [Transform2D] with no translation, rotation or scaling applied. When applied to other data structures, [constant IDENTITY] performs no transformation.
</constant>
<constant name="FLIP_X" value="Transform2D( -1, 0, 0, 1, 0, 0 )">
- [Transform2D] with mirroring applied parallel to the X axis.
+ The [Transform2D] that will flip something along the X axis.
</constant>
<constant name="FLIP_Y" value="Transform2D( 1, 0, 0, -1, 0, 0 )">
- [Transform2D] with mirroring applied parallel to the Y axis.
+ The [Transform2D] that will flip something along the Y axis.
</constant>
</constants>
</class>
diff --git a/doc/classes/Translation.xml b/doc/classes/Translation.xml
index 11245195bf..d286c6cf0c 100644
--- a/doc/classes/Translation.xml
+++ b/doc/classes/Translation.xml
@@ -7,8 +7,8 @@
Translations are resources that can be loaded and unloaded on demand. They map a string to another string.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/i18n/locales.html</link>
+ <link title="Internationalizing games">https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html</link>
+ <link title="Locales">https://docs.godotengine.org/en/latest/tutorials/i18n/locales.html</link>
</tutorials>
<methods>
<method name="add_message">
@@ -18,8 +18,25 @@
</argument>
<argument index="1" name="xlated_message" type="StringName">
</argument>
+ <argument index="2" name="context" type="StringName" default="&quot;&quot;">
+ </argument>
<description>
Adds a message if nonexistent, followed by its translation.
+ An additional context could be used to specify the translation context or differentiate polysemic words.
+ </description>
+ </method>
+ <method name="add_plural_message">
+ <return type="void">
+ </return>
+ <argument index="0" name="src_message" type="StringName">
+ </argument>
+ <argument index="1" name="xlated_messages" type="PackedStringArray">
+ </argument>
+ <argument index="2" name="context" type="StringName" default="&quot;&quot;">
+ </argument>
+ <description>
+ Adds a message involving plural translation if nonexistent, followed by its translation.
+ An additional context could be used to specify the translation context or differentiate polysemic words.
</description>
</method>
<method name="erase_message">
@@ -27,6 +44,8 @@
</return>
<argument index="0" name="src_message" type="StringName">
</argument>
+ <argument index="1" name="context" type="StringName" default="&quot;&quot;">
+ </argument>
<description>
Erases a message.
</description>
@@ -36,6 +55,8 @@
</return>
<argument index="0" name="src_message" type="StringName">
</argument>
+ <argument index="1" name="context" type="StringName" default="&quot;&quot;">
+ </argument>
<description>
Returns a message's translation.
</description>
@@ -54,6 +75,22 @@
Returns all the messages (keys).
</description>
</method>
+ <method name="get_plural_message" qualifiers="const">
+ <return type="StringName">
+ </return>
+ <argument index="0" name="src_message" type="StringName">
+ </argument>
+ <argument index="1" name="src_plural_message" type="StringName">
+ </argument>
+ <argument index="2" name="n" type="int">
+ </argument>
+ <argument index="3" name="context" type="StringName" default="&quot;&quot;">
+ </argument>
+ <description>
+ Returns a message's translation involving plurals.
+ The number [code]n[/code] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language.
+ </description>
+ </method>
</methods>
<members>
<member name="locale" type="String" setter="set_locale" getter="get_locale" default="&quot;en&quot;">
diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml
index aaf7a4d160..664cb3e2e3 100644
--- a/doc/classes/TranslationServer.xml
+++ b/doc/classes/TranslationServer.xml
@@ -7,8 +7,8 @@
Server that manages all translations. Translations can be set to it and removed from it.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/i18n/locales.html</link>
+ <link title="Internationalizing games">https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html</link>
+ <link title="Locales">https://docs.godotengine.org/en/latest/tutorials/i18n/locales.html</link>
</tutorials>
<methods>
<method name="add_translation">
@@ -50,6 +50,16 @@
Returns a locale's language and its variant (e.g. [code]"en_US"[/code] would return [code]"English (United States)"[/code]).
</description>
</method>
+ <method name="get_translation_object">
+ <return type="Translation">
+ </return>
+ <argument index="0" name="locale" type="String">
+ </argument>
+ <description>
+ Returns the [Translation] instance based on the [code]locale[/code] passed in.
+ It will return a [code]nullptr[/code] if there is no [Translation] instance that matches the [code]locale[/code].
+ </description>
+ </method>
<method name="remove_translation">
<return type="void">
</return>
@@ -73,8 +83,26 @@
</return>
<argument index="0" name="message" type="StringName">
</argument>
+ <argument index="1" name="context" type="StringName" default="&quot;&quot;">
+ </argument>
+ <description>
+ Returns the current locale's translation for the given message (key) and context.
+ </description>
+ </method>
+ <method name="translate_plural" qualifiers="const">
+ <return type="StringName">
+ </return>
+ <argument index="0" name="message" type="StringName">
+ </argument>
+ <argument index="1" name="plural_message" type="StringName">
+ </argument>
+ <argument index="2" name="n" type="int">
+ </argument>
+ <argument index="3" name="context" type="StringName" default="&quot;&quot;">
+ </argument>
<description>
- Returns the current locale's translation for the given message (key).
+ Returns the current locale's translation for the given message (key), plural_message and context.
+ The number [code]n[/code] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language.
</description>
</method>
</methods>
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index b01ba3850f..73575b4309 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -16,7 +16,7 @@
var subchild1 = tree.create_item(child1)
subchild1.set_text(0, "Subchild1")
[/codeblock]
- To iterate over all the [TreeItem] objects in a [Tree] object, use [method TreeItem.get_next] and [method TreeItem.get_children] after getting the root through [method get_root].
+ To iterate over all the [TreeItem] objects in a [Tree] object, use [method TreeItem.get_next] and [method TreeItem.get_children] after getting the root through [method get_root]. You can use [method Object.free] on a [TreeItem] to remove it from the [Tree].
</description>
<tutorials>
</tutorials>
@@ -106,14 +106,21 @@
<return type="TreeItem">
</return>
<description>
- Returns the currently edited item. This is only available for custom cell mode.
+ Returns the currently edited item. Can be used with [signal item_edited] to get the item that was modified.
+ [codeblock]
+ func _ready():
+ $Tree.item_edited.connect(on_Tree_item_edited)
+
+ func on_Tree_item_edited():
+ print($Tree.get_edited()) # This item just got edited (e.g. checked).
+ [/codeblock]
</description>
</method>
<method name="get_edited_column" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the column for the currently edited item. This is only available for custom cell mode.
+ Returns the column for the currently edited item.
</description>
</method>
<method name="get_item_area_rect" qualifiers="const">
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index 84aa3a3686..22e643a51d 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Control for a single item inside a [Tree]. May have child [TreeItem]s and be styled as well as contain buttons.
+ You can remove a [TreeItem] by using [method Object.free].
</description>
<tutorials>
</tutorials>
@@ -117,7 +118,7 @@
<return type="TreeItem">
</return>
<description>
- Returns the TreeItem's child items.
+ Returns the TreeItem's first child item or a null object if there is none.
</description>
</method>
<method name="get_custom_bg_color" qualifiers="const">
@@ -195,7 +196,7 @@
<return type="TreeItem">
</return>
<description>
- Returns the next TreeItem in the tree.
+ Returns the next TreeItem in the tree or a null object if there is none.
</description>
</method>
<method name="get_next_visible">
@@ -204,7 +205,7 @@
<argument index="0" name="wrap" type="bool" default="false">
</argument>
<description>
- Returns the next visible TreeItem in the tree.
+ Returns the next visible TreeItem in the tree or a null object if there is none.
If [code]wrap[/code] is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns [code]null[/code].
</description>
</method>
@@ -212,14 +213,14 @@
<return type="TreeItem">
</return>
<description>
- Returns the parent TreeItem.
+ Returns the parent TreeItem or a null object if there is none.
</description>
</method>
<method name="get_prev">
<return type="TreeItem">
</return>
<description>
- Returns the previous TreeItem in the tree.
+ Returns the previous TreeItem in the tree or a null object if there is none.
</description>
</method>
<method name="get_prev_visible">
@@ -228,7 +229,7 @@
<argument index="0" name="wrap" type="bool" default="false">
</argument>
<description>
- Returns the previous visible TreeItem in the tree.
+ Returns the previous visible TreeItem in the tree or a null object if there is none.
If [code]wrap[/code] is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns [code]null[/code].
</description>
</method>
@@ -248,6 +249,14 @@
<description>
</description>
</method>
+ <method name="get_suffix" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_text" qualifiers="const">
<return type="String">
</return>
@@ -350,7 +359,7 @@
<argument index="0" name="child" type="Object">
</argument>
<description>
- Removes the given child TreeItem.
+ Removes the given child [TreeItem] and all its children from the [Tree]. Note that it doesn't free the item from memory, so it can be reused later. To completely remove a [TreeItem] use [method Object.free].
</description>
</method>
<method name="select">
@@ -571,6 +580,16 @@
If [code]true[/code], the given column is selectable.
</description>
</method>
+ <method name="set_suffix">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="text" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_text">
<return type="void">
</return>
diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml
index 371b027534..56ccaaf383 100644
--- a/doc/classes/Tween.xml
+++ b/doc/classes/Tween.xml
@@ -6,7 +6,7 @@
<description>
Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name [i]tween[/i] comes from [i]in-betweening[/i], an animation technique where you specify [i]keyframes[/i] and the computer interpolates the frames that appear between them.
[Tween] is more suited than [AnimationPlayer] for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a [Tween] node; it would be difficult to do the same thing with an [AnimationPlayer] node.
- Here is a brief usage example that causes a 2D node to move smoothly between two positions:
+ Here is a brief usage example that makes a 2D node move smoothly between two positions:
[codeblock]
var tween = get_node("Tween")
tween.interpolate_property($Node2D, "position",
@@ -15,7 +15,8 @@
tween.start()
[/codeblock]
Many methods require a property name, such as [code]"position"[/code] above. You can find the correct property name by hovering over the property in the Inspector. You can also provide the components of a property directly by using [code]"property:component"[/code] (eg. [code]position:x[/code]), where it would only apply to that particular component.
- Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [code]http://easings.net/[/code] for some examples). The second accepts an [enum EaseType] constant, and controls the where [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best.
+ Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls where the [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best.
+ [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/tween_cheatsheet.png]Tween easing and transition types cheatsheet[/url]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/UDPServer.xml b/doc/classes/UDPServer.xml
index f3c865c392..aabfed85f0 100644
--- a/doc/classes/UDPServer.xml
+++ b/doc/classes/UDPServer.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
A simple server that opens a UDP socket and returns connected [PacketPeerUDP] upon receiving new packets. See also [method PacketPeerUDP.connect_to_host].
+ After starting the server ([method listen]), you will need to [method poll] it at regular intervals (e.g. inside [method Node._process]) for it to process new packets, delivering them to the appropriate [PacketPeerUDP], and taking new connections.
Below a small example of how it can be used:
[codeblock]
# server.gd
@@ -17,6 +18,7 @@
server.listen(4242)
func _process(delta):
+ server.poll() # Important!
if server.is_connection_available():
var peer : PacketPeerUDP = server.take_connection()
var pkt = peer.get_packet()
@@ -57,7 +59,7 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if a packet with a new address/port combination is received on the socket.
+ Returns [code]true[/code] if a packet with a new address/port combination was received on the socket.
</description>
</method>
<method name="is_listening" qualifiers="const">
@@ -78,21 +80,33 @@
Starts the server by opening a UDP socket listening on the given port. You can optionally specify a [code]bind_address[/code] to only listen for packets sent to that address. See also [method PacketPeerUDP.listen].
</description>
</method>
+ <method name="poll">
+ <return type="int" enum="Error">
+ </return>
+ <description>
+ Call this method at regular intervals (e.g. inside [method Node._process]) to process new packets. And packet from known address/port pair will be delivered to the appropriate [PacketPeerUDP], any packet received from an unknown address/port pair will be added as a pending connection (see [method is_connection_available], [method take_connection]). The maximum number of pending connection is defined via [member max_pending_connections].
+ </description>
+ </method>
<method name="stop">
<return type="void">
</return>
<description>
- Stops the server, closing the UDP socket if open. Will not disconnect any connected [PacketPeerUDP].
+ Stops the server, closing the UDP socket if open. Will close all connected [PacketPeerUDP] accepted via [method take_connection] (remote peers will not be notified).
</description>
</method>
<method name="take_connection">
<return type="PacketPeerUDP">
</return>
<description>
- Returns a [PacketPeerUDP] connected to the address/port combination of the first packet in queue. Will return [code]null[/code] if no packet is in queue. See also [method PacketPeerUDP.connect_to_host].
+ Returns the first pending connection (connected to the appropriate address/port). Will return [code]null[/code] if no new connection is available. See also [method is_connection_available], [method PacketPeerUDP.connect_to_host].
</description>
</method>
</methods>
+ <members>
+ <member name="max_pending_connections" type="int" setter="set_max_pending_connections" getter="get_max_pending_connections" default="16">
+ Define the maximum number of pending connections, during [method poll], any new pending connection exceeding that value will be automatically dropped. Setting this value to [code]0[/code] effectively prevents any new pending connection to be accepted (e.g. when all your players have connected).
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/VBoxContainer.xml b/doc/classes/VBoxContainer.xml
index 6b32a08f93..213f8fd742 100644
--- a/doc/classes/VBoxContainer.xml
+++ b/doc/classes/VBoxContainer.xml
@@ -7,6 +7,7 @@
Vertical box container. See [BoxContainer].
</description>
<tutorials>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/VSlider.xml b/doc/classes/VSlider.xml
index 9394d6b430..5830c9eaf3 100644
--- a/doc/classes/VSlider.xml
+++ b/doc/classes/VSlider.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Vertical slider. See [Slider]. This one goes from bottom (min) to top (max).
+ [b]Note:[/b] The [signal Range.changed] and [signal Range.value_changed] signals are part of the [Range] class which this class inherits from.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Variant.xml b/doc/classes/Variant.xml
index 042c8d8e67..cd76689ffe 100644
--- a/doc/classes/Variant.xml
+++ b/doc/classes/Variant.xml
@@ -50,7 +50,7 @@
Modifications to a container will modify all references to it. A [Mutex] should be created to lock it if multi-threaded access is desired.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/development/cpp/variant_class.html</link>
+ <link title="Variant class">https://docs.godotengine.org/en/latest/development/cpp/variant_class.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index 7b02a1a4c9..f99231de39 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -5,13 +5,35 @@
</brief_description>
<description>
2-element structure that can be used to represent positions in 2D space or any other pair of numeric values.
- It uses floating point coordinates.
+ It uses floating-point coordinates. See [Vector2i] for its integer counterpart.
+ [b]Note:[/b] In a boolean context, a Vector2 will evaluate to [code]false[/code] if it's equal to [code]Vector2(0, 0)[/code]. Otherwise, a Vector2 will always evaluate to [code]true[/code].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link>
+ <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="All 2D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/2d</link>
</tutorials>
<methods>
- <method name="Vector2">
+ <method name="Vector2" qualifiers="constructor">
+ <return type="Vector2">
+ </return>
+ <description>
+ Constructs a default-initialized [Vector2] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Vector2" qualifiers="constructor">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="from" type="Vector2">
+ </argument>
+ <description>
+ Constructs a [Vector2] as a copy of the given [Vector2].
+ </description>
+ </method>
+ <method name="Vector2" qualifiers="constructor">
<return type="Vector2">
</return>
<argument index="0" name="from" type="Vector2i">
@@ -20,7 +42,7 @@
Constructs a new [Vector2] from [Vector2i].
</description>
</method>
- <method name="Vector2">
+ <method name="Vector2" qualifiers="constructor">
<return type="Vector2">
</return>
<argument index="0" name="x" type="float">
@@ -42,8 +64,9 @@
<return type="float">
</return>
<description>
- Returns the vector's angle in radians with respect to the X axis, or [code](1, 0)[/code] vector.
- Equivalent to the result of [method @GDScript.atan2] when called with the vector's [member x] and [member y] as parameters: [code]atan2(x, y)[/code].
+ Returns this vector's angle with respect to the positive X axis, or [code](1, 0)[/code] vector, in radians.
+ For example, [code]Vector2.RIGHT.angle()[/code] will return zero, [code]Vector2.DOWN.angle()[/code] will return [code]PI / 2[/code] (a quarter turn, or 90 degrees), and [code]Vector2(1, -1).angle()[/code] will return [code]-PI / 4[/code] (a negative eighth turn, or -45 degrees).
+ Equivalent to the result of [method @GDScript.atan2] when called with the vector's [member y] and [member x] as parameters: [code]atan2(y, x)[/code].
</description>
</method>
<method name="angle_to">
@@ -52,7 +75,7 @@
<argument index="0" name="to" type="Vector2">
</argument>
<description>
- Returns the angle in radians between the two vectors.
+ Returns the angle to the given vector, in radians.
</description>
</method>
<method name="angle_to_point">
@@ -61,14 +84,14 @@
<argument index="0" name="to" type="Vector2">
</argument>
<description>
- Returns the angle in radians between the line connecting the two points and the X coordinate.
+ Returns the angle between the line connecting the two points and the X axis, in radians.
</description>
</method>
<method name="aspect">
<return type="float">
</return>
<description>
- Returns the ratio of [member x] to [member y].
+ Returns the aspect ratio of this vector, the ratio of [member x] to [member y].
</description>
</method>
<method name="bounce">
@@ -84,7 +107,7 @@
<return type="Vector2">
</return>
<description>
- Returns the vector with all components rounded up.
+ Returns the vector with all components rounded up (towards positive infinity).
</description>
</method>
<method name="clamped">
@@ -93,7 +116,7 @@
<argument index="0" name="length" type="float">
</argument>
<description>
- Returns the vector with a maximum length.
+ Returns the vector with a maximum length by limiting its length to [code]length[/code].
</description>
</method>
<method name="cross">
@@ -102,7 +125,7 @@
<argument index="0" name="with" type="Vector2">
</argument>
<description>
- Returns the 2-dimensional analog of the cross product with the given vector.
+ Returns the cross product of this vector and [code]with[/code].
</description>
</method>
<method name="cubic_interpolate">
@@ -117,7 +140,7 @@
<argument index="3" name="t" type="float">
</argument>
<description>
- Cubically interpolates between this vector and [code]b[/code] using [code]pre_a[/code] and [code]post_b[/code] as handles, and returns the result at position [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
+ Cubically interpolates between this vector and [code]b[/code] using [code]pre_a[/code] and [code]post_b[/code] as handles, and returns the result at position [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="direction_to">
@@ -135,7 +158,8 @@
<argument index="0" name="to" type="Vector2">
</argument>
<description>
- Returns the squared distance to vector [code]b[/code]. Prefer this function over [method distance_to] if you need to sort vectors or need the squared distance for some formula.
+ Returns the squared distance between this vector and [code]b[/code].
+ This method runs faster than [method distance_to], so prefer it if you need to compare vectors or need the squared distance for some formula.
</description>
</method>
<method name="distance_to">
@@ -144,7 +168,7 @@
<argument index="0" name="to" type="Vector2">
</argument>
<description>
- Returns the distance to vector [code]b[/code].
+ Returns the distance between this vector and [code]to[/code].
</description>
</method>
<method name="dot">
@@ -153,20 +177,23 @@
<argument index="0" name="with" type="Vector2">
</argument>
<description>
- Returns the dot product with vector [code]b[/code].
+ Returns the dot product of this vector and [code]with[/code]. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player.
+ The dot product will be [code]0[/code] for a straight angle (90 degrees), greater than 0 for angles narrower than 90 degrees and lower than 0 for angles wider than 90 degrees.
+ When using unit (normalized) vectors, the result will always be between [code]-1.0[/code] (180 degree angle) when the vectors are facing opposite directions, and [code]1.0[/code] (0 degree angle) when the vectors are aligned.
+ [b]Note:[/b] [code]a.dot(b)[/code] is equivalent to [code]b.dot(a)[/code].
</description>
</method>
<method name="floor">
<return type="Vector2">
</return>
<description>
- Returns the vector with all components rounded down.
+ Returns the vector with all components rounded down (towards negative infinity).
</description>
</method>
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="v" type="Vector2">
+ <argument index="0" name="to" type="Vector2">
</argument>
<description>
Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
@@ -176,32 +203,33 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the vector is normalized.
+ Returns [code]true[/code] if the vector is normalized, [code]false[/code] otherwise.
</description>
</method>
<method name="length">
<return type="float">
</return>
<description>
- Returns the vector's length.
+ Returns the length (magnitude) of this vector.
</description>
</method>
<method name="length_squared">
<return type="float">
</return>
<description>
- Returns the vector's length squared. Prefer this method over [method length] if you need to sort vectors or need the squared length for some formula.
+ Returns the squared length (squared magnitude) of this vector.
+ This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula.
</description>
</method>
- <method name="linear_interpolate">
+ <method name="lerp">
<return type="Vector2">
</return>
- <argument index="0" name="b" type="Vector2">
+ <argument index="0" name="with" type="Vector2">
</argument>
<argument index="1" name="t" type="float">
</argument>
<description>
- Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
+ Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="move_toward">
@@ -222,13 +250,153 @@
Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="posmod">
<return type="Vector2">
</return>
<argument index="0" name="mod" type="float">
</argument>
<description>
- Returns a vector composed of the [code]fposmod[/code] of this vector's components and [code]mod[/code].
+ Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]mod[/code].
</description>
</method>
<method name="posmodv">
@@ -237,7 +405,7 @@
<argument index="0" name="modv" type="Vector2">
</argument>
<description>
- Returns a vector composed of the [code]fposmod[/code] of this vector's components and [code]modv[/code]'s components.
+ Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]modv[/code]'s components.
</description>
</method>
<method name="project">
@@ -278,18 +446,18 @@
<return type="Vector2">
</return>
<description>
- Returns the vector with each component set to one or negative one, depending on the signs of the components.
+ Returns the vector with each component set to one or negative one, depending on the signs of the components, or zero if the component is zero, by calling [method @GDScript.sign] on each component.
</description>
</method>
<method name="slerp">
<return type="Vector2">
</return>
- <argument index="0" name="b" type="Vector2">
+ <argument index="0" name="with" type="Vector2">
</argument>
<argument index="1" name="t" type="float">
</argument>
<description>
- Returns the result of spherical linear interpolation between this vector and [code]b[/code], by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
+ Returns the result of spherical linear interpolation between this vector and [code]b[/code], by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
[b]Note:[/b] Both vectors must be normalized.
</description>
</method>
@@ -299,7 +467,7 @@
<argument index="0" name="n" type="Vector2">
</argument>
<description>
- Returns the component of the vector along a plane defined by the given normal.
+ Returns this vector slid along a plane defined by the given normal.
</description>
</method>
<method name="snapped">
@@ -308,14 +476,14 @@
<argument index="0" name="by" type="Vector2">
</argument>
<description>
- Returns the vector snapped to a grid with the given size.
+ Returns this vector with each component snapped to the nearest multiple of [code]step[/code]. This can also be used to round to an arbitrary number of decimals.
</description>
</method>
<method name="tangent">
<return type="Vector2">
</return>
<description>
- Returns a perpendicular vector.
+ Returns a perpendicular vector rotated 90 degrees counter-clockwise compared to the original, with the same length.
</description>
</method>
</methods>
@@ -335,25 +503,25 @@
Enumerated value for the Y axis.
</constant>
<constant name="ZERO" value="Vector2( 0, 0 )">
- Zero vector.
+ Zero vector, a vector with all components set to [code]0[/code].
</constant>
<constant name="ONE" value="Vector2( 1, 1 )">
- One vector.
+ One vector, a vector with all components set to [code]1[/code].
</constant>
<constant name="INF" value="Vector2( inf, inf )">
- Infinity vector.
+ Infinity vector, a vector with all components set to [constant @GDScript.INF].
</constant>
<constant name="LEFT" value="Vector2( -1, 0 )">
- Left unit vector.
+ Left unit vector. Represents the direction of left.
</constant>
<constant name="RIGHT" value="Vector2( 1, 0 )">
- Right unit vector.
+ Right unit vector. Represents the direction of right.
</constant>
<constant name="UP" value="Vector2( 0, -1 )">
- Up unit vector.
+ Up unit vector. Y is down in 2D, so this vector points -Y.
</constant>
<constant name="DOWN" value="Vector2( 0, 1 )">
- Down unit vector.
+ Down unit vector. Y is down in 2D, so this vector points +Y.
</constant>
</constants>
</class>
diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml
index a516eb01dd..a4ea5c2742 100644
--- a/doc/classes/Vector2i.xml
+++ b/doc/classes/Vector2i.xml
@@ -5,13 +5,41 @@
</brief_description>
<description>
2-element structure that can be used to represent positions in 2D space or any other pair of numeric values.
- It uses integer coordinates.
+ It uses integer coordinates and is therefore preferable to [Vector2] when exact precision is required.
+ [b]Note:[/b] In a boolean context, a Vector2i will evaluate to [code]false[/code] if it's equal to [code]Vector2i(0, 0)[/code]. Otherwise, a Vector2i will always evaluate to [code]true[/code].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link>
</tutorials>
<methods>
- <method name="Vector2i">
+ <method name="Vector2i" qualifiers="constructor">
+ <return type="Vector2i">
+ </return>
+ <description>
+ Constructs a default-initialized [Vector2i] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Vector2i" qualifiers="constructor">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="from" type="Vector2i">
+ </argument>
+ <description>
+ Constructs a [Vector2i] as a copy of the given [Vector2i].
+ </description>
+ </method>
+ <method name="Vector2i" qualifiers="constructor">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="from" type="Vector2">
+ </argument>
+ <description>
+ Constructs a new [Vector2i] from [Vector2]. The floating point coordinates will be truncated.
+ </description>
+ </method>
+ <method name="Vector2i" qualifiers="constructor">
<return type="Vector2i">
</return>
<argument index="0" name="x" type="int">
@@ -22,16 +50,184 @@
Constructs a new [Vector2i] from the given [code]x[/code] and [code]y[/code].
</description>
</method>
- <method name="Vector2i">
+ <method name="abs">
<return type="Vector2i">
</return>
- <argument index="0" name="from" type="Vector2">
+ <description>
+ Returns a new vector with all components in absolute values (i.e. positive).
+ </description>
+ </method>
+ <method name="aspect">
+ <return type="float">
+ </return>
+ <description>
+ Returns the ratio of [member x] to [member y].
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
</argument>
<description>
- Constructs a new [Vector2i] from [Vector2]. The floating point coordinates will be truncated.
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="sign">
+ <return type="Vector2i">
+ </return>
+ <description>
+ Returns the vector with each component set to one or negative one, depending on the signs of the components.
</description>
</method>
</methods>
+ <members>
+ <member name="x" type="int" setter="" getter="" default="0">
+ The vector's X component. Also accessible by using the index position [code][0][/code].
+ </member>
+ <member name="y" type="int" setter="" getter="" default="0">
+ The vector's Y component. Also accessible by using the index position [code][1][/code].
+ </member>
+ </members>
<constants>
<constant name="AXIS_X" value="0">
Enumerated value for the X axis.
@@ -40,22 +236,22 @@
Enumerated value for the Y axis.
</constant>
<constant name="ZERO" value="Vector2i( 0, 0 )">
- Zero vector.
+ Zero vector, a vector with all components set to [code]0[/code].
</constant>
<constant name="ONE" value="Vector2i( 1, 1 )">
- One vector.
+ One vector, a vector with all components set to [code]1[/code].
</constant>
<constant name="LEFT" value="Vector2i( -1, 0 )">
- Left unit vector.
+ Left unit vector. Represents the direction of left.
</constant>
<constant name="RIGHT" value="Vector2i( 1, 0 )">
- Right unit vector.
+ Right unit vector. Represents the direction of right.
</constant>
<constant name="UP" value="Vector2i( 0, -1 )">
- Up unit vector.
+ Up unit vector. Y is down in 2D, so this vector points -Y.
</constant>
<constant name="DOWN" value="Vector2i( 0, 1 )">
- Down unit vector.
+ Down unit vector. Y is down in 2D, so this vector points +Y.
</constant>
</constants>
</class>
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index 600c03ba7d..6ba0d6ab8d 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -5,13 +5,35 @@
</brief_description>
<description>
3-element structure that can be used to represent positions in 3D space or any other pair of numeric values.
- It uses floating point coordinates.
+ It uses floating-point coordinates. See [Vector3i] for its integer counterpart.
+ [b]Note:[/b] In a boolean context, a Vector3 will evaluate to [code]false[/code] if it's equal to [code]Vector3(0, 0, 0)[/code]. Otherwise, a Vector3 will always evaluate to [code]true[/code].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link>
+ <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="All 3D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/3d</link>
</tutorials>
<methods>
- <method name="Vector3">
+ <method name="Vector3" qualifiers="constructor">
+ <return type="Vector3">
+ </return>
+ <description>
+ Constructs a default-initialized [Vector3] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Vector3" qualifiers="constructor">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <description>
+ Constructs a [Vector3] as a copy of the given [Vector3].
+ </description>
+ </method>
+ <method name="Vector3" qualifiers="constructor">
<return type="Vector3">
</return>
<argument index="0" name="from" type="Vector3i">
@@ -20,7 +42,7 @@
Constructs a new [Vector3] from [Vector3i].
</description>
</method>
- <method name="Vector3">
+ <method name="Vector3" qualifiers="constructor">
<return type="Vector3">
</return>
<argument index="0" name="x" type="float">
@@ -46,7 +68,7 @@
<argument index="0" name="to" type="Vector3">
</argument>
<description>
- Returns the minimum angle to the given vector.
+ Returns the minimum angle to the given vector, in radians.
</description>
</method>
<method name="bounce">
@@ -62,16 +84,16 @@
<return type="Vector3">
</return>
<description>
- Returns a new vector with all components rounded up.
+ Returns a new vector with all components rounded up (towards positive infinity).
</description>
</method>
<method name="cross">
<return type="Vector3">
</return>
- <argument index="0" name="b" type="Vector3">
+ <argument index="0" name="with" type="Vector3">
</argument>
<description>
- Returns the cross product with [code]b[/code].
+ Returns the cross product of this vector and [code]b[/code].
</description>
</method>
<method name="cubic_interpolate">
@@ -86,7 +108,7 @@
<argument index="3" name="t" type="float">
</argument>
<description>
- Performs a cubic interpolation between vectors [code]pre_a[/code], [code]a[/code], [code]b[/code], [code]post_b[/code] ([code]a[/code] is current), by the given amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
+ Performs a cubic interpolation between vectors [code]pre_a[/code], [code]a[/code], [code]b[/code], [code]post_b[/code] ([code]a[/code] is current), by the given amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="direction_to">
@@ -104,7 +126,8 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the squared distance to [code]b[/code]. Prefer this function over [method distance_to] if you need to sort vectors or need the squared distance for some formula.
+ Returns the squared distance between this vector and [code]b[/code].
+ This method runs faster than [method distance_to], so prefer it if you need to compare vectors or need the squared distance for some formula.
</description>
</method>
<method name="distance_to">
@@ -113,23 +136,26 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the distance to [code]b[/code].
+ Returns the distance between this vector and [code]b[/code].
</description>
</method>
<method name="dot">
<return type="float">
</return>
- <argument index="0" name="b" type="Vector3">
+ <argument index="0" name="with" type="Vector3">
</argument>
<description>
- Returns the dot product with [code]b[/code].
+ Returns the dot product of this vector and [code]b[/code]. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player.
+ The dot product will be [code]0[/code] for a straight angle (90 degrees), greater than 0 for angles narrower than 90 degrees and lower than 0 for angles wider than 90 degrees.
+ When using unit (normalized) vectors, the result will always be between [code]-1.0[/code] (180 degree angle) when the vectors are facing opposite directions, and [code]1.0[/code] (0 degree angle) when the vectors are aligned.
+ [b]Note:[/b] [code]a.dot(b)[/code] is equivalent to [code]b.dot(a)[/code].
</description>
</method>
<method name="floor">
<return type="Vector3">
</return>
<description>
- Returns a new vector with all components rounded down.
+ Returns a new vector with all components rounded down (towards negative infinity).
</description>
</method>
<method name="inverse">
@@ -142,7 +168,7 @@
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="v" type="Vector3">
+ <argument index="0" name="to" type="Vector3">
</argument>
<description>
Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
@@ -152,24 +178,25 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the vector is normalized.
+ Returns [code]true[/code] if the vector is normalized, [code]false[/code] otherwise.
</description>
</method>
<method name="length">
<return type="float">
</return>
<description>
- Returns the vector's length.
+ Returns the length (magnitude) of this vector.
</description>
</method>
<method name="length_squared">
<return type="float">
</return>
<description>
- Returns the vector's length squared. Prefer this function over [method length] if you need to sort vectors or need the squared length for some formula.
+ Returns the squared length (squared magnitude) of this vector.
+ This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula.
</description>
</method>
- <method name="linear_interpolate">
+ <method name="lerp">
<return type="Vector3">
</return>
<argument index="0" name="b" type="Vector3">
@@ -177,21 +204,21 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation..
+ Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="max_axis">
<return type="int">
</return>
<description>
- Returns the axis of the vector's largest value. See [code]AXIS_*[/code] constants.
+ Returns the axis of the vector's largest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X].
</description>
</method>
<method name="min_axis">
<return type="int">
</return>
<description>
- Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants.
+ Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z].
</description>
</method>
<method name="move_toward">
@@ -202,7 +229,7 @@
<argument index="1" name="delta" type="float">
</argument>
<description>
- Moves the vector toward [code]to[/code] by the fixed [code]delta[/code] amount.
+ Moves this vector toward [code]to[/code] by the fixed [code]delta[/code] amount.
</description>
</method>
<method name="normalized">
@@ -212,10 +239,166 @@
Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Basis">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Quat">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="outer">
<return type="Basis">
</return>
- <argument index="0" name="b" type="Vector3">
+ <argument index="0" name="with" type="Vector3">
</argument>
<description>
Returns the outer product with [code]b[/code].
@@ -227,7 +410,7 @@
<argument index="0" name="mod" type="float">
</argument>
<description>
- Returns a vector composed of the [code]fposmod[/code] of this vector's components and [code]mod[/code].
+ Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]mod[/code].
</description>
</method>
<method name="posmodv">
@@ -236,7 +419,7 @@
<argument index="0" name="modv" type="Vector3">
</argument>
<description>
- Returns a vector composed of the [code]fposmod[/code] of this vector's components and [code]modv[/code]'s components.
+ Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]modv[/code]'s components.
</description>
</method>
<method name="project">
@@ -245,7 +428,7 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the vector projected onto the vector [code]b[/code].
+ Returns this vector projected onto another vector [code]b[/code].
</description>
</method>
<method name="reflect">
@@ -254,32 +437,32 @@
<argument index="0" name="n" type="Vector3">
</argument>
<description>
- Returns the vector reflected from a plane defined by the given normal.
+ Returns this vector reflected from a plane defined by the given normal.
</description>
</method>
<method name="rotated">
<return type="Vector3">
</return>
- <argument index="0" name="axis" type="Vector3">
+ <argument index="0" name="by_axis" type="Vector3">
</argument>
<argument index="1" name="phi" type="float">
</argument>
<description>
- Rotates the vector around a given axis by [code]phi[/code] radians. The axis must be a normalized vector.
+ Rotates this vector around a given axis by [code]phi[/code] radians. The axis must be a normalized vector.
</description>
</method>
<method name="round">
<return type="Vector3">
</return>
<description>
- Returns the vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
+ Returns this vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
</description>
</method>
<method name="sign">
<return type="Vector3">
</return>
<description>
- Returns the vector with each component set to one or negative one, depending on the signs of the components.
+ Returns a vector with each component set to one or negative one, depending on the signs of this vector's components, or zero if the component is zero, by calling [method @GDScript.sign] on each component.
</description>
</method>
<method name="slerp">
@@ -290,7 +473,7 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Returns the result of spherical linear interpolation between this vector and [code]b[/code], by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
+ Returns the result of spherical linear interpolation between this vector and [code]b[/code], by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
[b]Note:[/b] Both vectors must be normalized.
</description>
</method>
@@ -300,7 +483,7 @@
<argument index="0" name="n" type="Vector3">
</argument>
<description>
- Returns the component of the vector along a plane defined by the given normal.
+ Returns this vector slid along a plane defined by the given normal.
</description>
</method>
<method name="snapped">
@@ -309,7 +492,7 @@
<argument index="0" name="by" type="Vector3">
</argument>
<description>
- Returns a copy of the vector snapped to the lowest neared multiple.
+ Returns this vector with each component snapped to the nearest multiple of [code]step[/code]. This can also be used to round to an arbitrary number of decimals.
</description>
</method>
<method name="to_diagonal_matrix">
@@ -317,6 +500,7 @@
</return>
<description>
Returns a diagonal matrix with the vector as main diagonal.
+ This is equivalent to a Basis with no rotation or shearing and this vector's components set as the scale.
</description>
</method>
</methods>
@@ -342,19 +526,19 @@
Enumerated value for the Z axis. Returned by [method max_axis] and [method min_axis].
</constant>
<constant name="ZERO" value="Vector3( 0, 0, 0 )">
- Zero vector.
+ Zero vector, a vector with all components set to [code]0[/code].
</constant>
<constant name="ONE" value="Vector3( 1, 1, 1 )">
- One vector.
+ One vector, a vector with all components set to [code]1[/code].
</constant>
<constant name="INF" value="Vector3( inf, inf, inf )">
- Infinity vector.
+ Infinity vector, a vector with all components set to [constant @GDScript.INF].
</constant>
<constant name="LEFT" value="Vector3( -1, 0, 0 )">
- Left unit vector.
+ Left unit vector. Represents the local direction of left, and the global direction of west.
</constant>
<constant name="RIGHT" value="Vector3( 1, 0, 0 )">
- Right unit vector.
+ Right unit vector. Represents the local direction of right, and the global direction of east.
</constant>
<constant name="UP" value="Vector3( 0, 1, 0 )">
Up unit vector.
@@ -363,10 +547,10 @@
Down unit vector.
</constant>
<constant name="FORWARD" value="Vector3( 0, 0, -1 )">
- Forward unit vector.
+ Forward unit vector. Represents the local direction of forward, and the global direction of north.
</constant>
<constant name="BACK" value="Vector3( 0, 0, 1 )">
- Back unit vector.
+ Back unit vector. Represents the local direction of back, and the global direction of south.
</constant>
</constants>
</class>
diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml
index 4f5a658b89..a1ae2aceab 100644
--- a/doc/classes/Vector3i.xml
+++ b/doc/classes/Vector3i.xml
@@ -5,13 +5,41 @@
</brief_description>
<description>
3-element structure that can be used to represent positions in 3D space or any other pair of numeric values.
- It uses integer coordinates.
+ It uses integer coordinates and is therefore preferable to [Vector3] when exact precision is required.
+ [b]Note:[/b] In a boolean context, a Vector3i will evaluate to [code]false[/code] if it's equal to [code]Vector3i(0, 0, 0)[/code]. Otherwise, a Vector3i will always evaluate to [code]true[/code].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link>
</tutorials>
<methods>
- <method name="Vector3i">
+ <method name="Vector3i" qualifiers="constructor">
+ <return type="Vector3i">
+ </return>
+ <description>
+ Constructs a default-initialized [Vector3i] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Vector3i" qualifiers="constructor">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="from" type="Vector3i">
+ </argument>
+ <description>
+ Constructs a [Vector3i] as a copy of the given [Vector3i].
+ </description>
+ </method>
+ <method name="Vector3i" qualifiers="constructor">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <description>
+ Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated.
+ </description>
+ </method>
+ <method name="Vector3i" qualifiers="constructor">
<return type="Vector3i">
</return>
<argument index="0" name="x" type="int">
@@ -24,16 +52,193 @@
Returns a [Vector3i] with the given components.
</description>
</method>
- <method name="Vector3i">
+ <method name="abs">
<return type="Vector3i">
</return>
- <argument index="0" name="from" type="Vector3">
+ <description>
+ </description>
+ </method>
+ <method name="max_axis">
+ <return type="int">
+ </return>
+ <description>
+ Returns the axis of the vector's largest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X].
+ </description>
+ </method>
+ <method name="min_axis">
+ <return type="int">
+ </return>
+ <description>
+ Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z].
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
</argument>
<description>
- Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated.
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="sign">
+ <return type="Vector3i">
+ </return>
+ <description>
+ Returns the vector with each component set to one or negative one, depending on the signs of the components.
</description>
</method>
</methods>
+ <members>
+ <member name="x" type="int" setter="" getter="" default="0">
+ The vector's X component. Also accessible by using the index position [code][0][/code].
+ </member>
+ <member name="y" type="int" setter="" getter="" default="0">
+ The vector's Y component. Also accessible by using the index position [code][1][/code].
+ </member>
+ <member name="z" type="int" setter="" getter="" default="0">
+ The vector's Z component. Also accessible by using the index position [code][2][/code].
+ </member>
+ </members>
<constants>
<constant name="AXIS_X" value="0">
Enumerated value for the X axis.
@@ -45,16 +250,16 @@
Enumerated value for the Z axis.
</constant>
<constant name="ZERO" value="Vector3i( 0, 0, 0 )">
- Zero vector.
+ Zero vector, a vector with all components set to [code]0[/code].
</constant>
<constant name="ONE" value="Vector3i( 1, 1, 1 )">
- One vector.
+ One vector, a vector with all components set to [code]1[/code].
</constant>
<constant name="LEFT" value="Vector3i( -1, 0, 0 )">
- Left unit vector.
+ Left unit vector. Represents the local direction of left, and the global direction of west.
</constant>
<constant name="RIGHT" value="Vector3i( 1, 0, 0 )">
- Right unit vector.
+ Right unit vector. Represents the local direction of right, and the global direction of east.
</constant>
<constant name="UP" value="Vector3i( 0, 1, 0 )">
Up unit vector.
@@ -63,10 +268,10 @@
Down unit vector.
</constant>
<constant name="FORWARD" value="Vector3i( 0, 0, -1 )">
- Forward unit vector.
+ Forward unit vector. Represents the local direction of forward, and the global direction of north.
</constant>
<constant name="BACK" value="Vector3i( 0, 0, 1 )">
- Back unit vector.
+ Back unit vector. Represents the local direction of back, and the global direction of south.
</constant>
</constants>
</class>
diff --git a/doc/classes/VehicleBody3D.xml b/doc/classes/VehicleBody3D.xml
index b8b85ff605..1125a1da94 100644
--- a/doc/classes/VehicleBody3D.xml
+++ b/doc/classes/VehicleBody3D.xml
@@ -6,8 +6,10 @@
<description>
This node implements all the physics logic needed to simulate a car. It is based on the raycast vehicle system commonly found in physics engines. You will need to add a [CollisionShape3D] for the main body of your vehicle and add [VehicleWheel3D] nodes for the wheels. You should also add a [MeshInstance3D] to this node for the 3D model of your car but this model should not include meshes for the wheels. You should control the vehicle by using the [member brake], [member engine_force], and [member steering] properties and not change the position or orientation of this node directly.
[b]Note:[/b] The origin point of your VehicleBody3D will determine the center of gravity of your vehicle so it is better to keep this low and move the [CollisionShape3D] and [MeshInstance3D] upwards.
+ [b]Note:[/b] This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another [PhysicsBody3D] class.
</description>
<tutorials>
+ <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/VehicleWheel3D.xml b/doc/classes/VehicleWheel3D.xml
index c71d797eff..fb0cb03d1c 100644
--- a/doc/classes/VehicleWheel3D.xml
+++ b/doc/classes/VehicleWheel3D.xml
@@ -5,8 +5,10 @@
</brief_description>
<description>
This node needs to be used as a child node of [VehicleBody3D] and simulates the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface.
+ [b]Note:[/b] This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another [PhysicsBody3D] class.
</description>
<tutorials>
+ <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link>
</tutorials>
<methods>
<method name="get_rpm" qualifiers="const">
diff --git a/doc/classes/VideoPlayer.xml b/doc/classes/VideoPlayer.xml
index 91c8ad0a77..60f0a40159 100644
--- a/doc/classes/VideoPlayer.xml
+++ b/doc/classes/VideoPlayer.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
Control node for playing video streams using [VideoStream] resources.
- Supported video formats are [url=https://www.webmproject.org/]WebM[/url] ([VideoStreamWebm]), [url=https://www.theora.org/]Ogg Theora[/url] ([VideoStreamTheora]), and any format exposed via a GDNative plugin using [VideoStreamGDNative].
+ Supported video formats are [url=https://www.webmproject.org/]WebM[/url] ([code].webm[/code], [VideoStreamWebm]), [url=https://www.theora.org/]Ogg Theora[/url] ([code].ogv[/code], [VideoStreamTheora]), and any format exposed via a GDNative plugin using [VideoStreamGDNative].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index a2d53f8e0c..85dc5e8fd8 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -12,22 +12,28 @@
Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
- <link>https://docs.godotengine.org/en/latest/tutorials/viewports/index.html</link>
+ <link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
+ <link title="Viewports tutorial index">https://docs.godotengine.org/en/latest/tutorials/viewports/index.html</link>
+ <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
+ <link title="3D in 2D Demo">https://godotengine.org/asset-library/asset/128</link>
+ <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link>
+ <link title="Screen Capture Demo">https://godotengine.org/asset-library/asset/130</link>
+ <link title="Dynamic Split Screen Demo">https://godotengine.org/asset-library/asset/541</link>
+ <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link>
</tutorials>
<methods>
- <method name="find_world" qualifiers="const">
- <return type="World3D">
+ <method name="find_world_2d" qualifiers="const">
+ <return type="World2D">
</return>
<description>
- Returns the 3D world of the viewport, or if none the world of the parent viewport.
+ Returns the 2D world of the viewport.
</description>
</method>
- <method name="find_world_2d" qualifiers="const">
- <return type="World2D">
+ <method name="find_world_3d" qualifiers="const">
+ <return type="World3D">
</return>
<description>
- Returns the 2D world of the viewport.
+ Returns the 3D world of the viewport, or if none the world of the parent viewport.
</description>
</method>
<method name="get_camera" qualifiers="const">
@@ -219,8 +225,8 @@
<member name="msaa" type="int" setter="set_msaa" getter="get_msaa" enum="Viewport.MSAA" default="0">
The multisample anti-aliasing mode. A higher number results in smoother edges at the cost of significantly worse performance. A value of 4 is best unless targeting very high-end systems.
</member>
- <member name="own_world" type="bool" setter="set_use_own_world" getter="is_using_own_world" default="false">
- If [code]true[/code], the viewport will use [World3D] defined in [code]world[/code] property.
+ <member name="own_world_3d" type="bool" setter="set_use_own_world_3d" getter="is_using_own_world_3d" default="false">
+ If [code]true[/code], the viewport will use the [World3D] defined in [member world_3d].
</member>
<member name="physics_object_picking" type="bool" setter="set_physics_object_picking" getter="get_physics_object_picking" default="false">
If [code]true[/code], the objects rendered by viewport become subjects of mouse picking process.
@@ -244,15 +250,21 @@
The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2.
[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-created viewports default to a value of 0, this value must be set above 0 manually.
</member>
+ <member name="snap_2d_transforms_to_pixel" type="bool" setter="set_snap_2d_transforms_to_pixel" getter="is_snap_2d_transforms_to_pixel_enabled" default="false">
+ </member>
+ <member name="snap_2d_vertices_to_pixel" type="bool" setter="set_snap_2d_vertices_to_pixel" getter="is_snap_2d_vertices_to_pixel_enabled" default="false">
+ </member>
<member name="transparent_bg" type="bool" setter="set_transparent_background" getter="has_transparent_background" default="false">
If [code]true[/code], the viewport should render its background as transparent.
</member>
- <member name="world" type="World3D" setter="set_world" getter="get_world">
- The custom [World3D] which can be used as 3D environment source.
+ <member name="use_debanding" type="bool" setter="set_use_debanding" getter="is_using_debanding" default="false">
</member>
<member name="world_2d" type="World2D" setter="set_world_2d" getter="get_world_2d">
The custom [World2D] which can be used as 2D environment source.
</member>
+ <member name="world_3d" type="World3D" setter="set_world_3d" getter="get_world_3d">
+ The custom [World3D] which can be used as 3D environment source.
+ </member>
</members>
<signals>
<signal name="gui_focus_changed">
@@ -315,7 +327,7 @@
Do not perform any antialiasing in the full screen post-process.
</constant>
<constant name="SCREEN_SPACE_AA_FXAA" value="1" enum="ScreenSpaceAA">
- Use fast approximate antialiasing. FXAA is a popular screen-space antialising method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K.
+ Use fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K.
</constant>
<constant name="SCREEN_SPACE_AA_MAX" value="2" enum="ScreenSpaceAA">
Represents the size of the [enum ScreenSpaceAA] enum.
@@ -377,15 +389,18 @@
<constant name="DEBUG_DRAW_SSAO" value="12" enum="DebugDraw">
Draws the screen-space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssao_enabled] set in your [WorldEnvironment].
</constant>
- <constant name="DEBUG_DRAW_ROUGHNESS_LIMITER" value="13" enum="DebugDraw">
- Draws the roughness limiter post process over the Viewport so you can see where it has an effect. It must be enabled in [member ProjectSettings.rendering/quality/screen_filters/screen_space_roughness_limiter] to work.
- </constant>
- <constant name="DEBUG_DRAW_PSSM_SPLITS" value="14" enum="DebugDraw">
+ <constant name="DEBUG_DRAW_PSSM_SPLITS" value="13" enum="DebugDraw">
Colors each PSSM split for the [DirectionalLight3D]s in the scene a different color so you can see where the splits are. In order, they will be colored red, green, blue, and yellow.
</constant>
- <constant name="DEBUG_DRAW_DECAL_ATLAS" value="15" enum="DebugDraw">
+ <constant name="DEBUG_DRAW_DECAL_ATLAS" value="14" enum="DebugDraw">
Draws the decal atlas used by [Decal]s and light projector textures in the upper left quadrant of the [Viewport].
</constant>
+ <constant name="DEBUG_DRAW_SDFGI" value="15" enum="DebugDraw">
+ </constant>
+ <constant name="DEBUG_DRAW_SDFGI_PROBES" value="16" enum="DebugDraw">
+ </constant>
+ <constant name="DEBUG_DRAW_GI_BUFFER" value="17" enum="DebugDraw">
+ </constant>
<constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST" value="0" enum="DefaultCanvasItemTextureFilter">
The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized.
</constant>
diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml
index 14b460a43b..393f1bb0b8 100644
--- a/doc/classes/ViewportTexture.xml
+++ b/doc/classes/ViewportTexture.xml
@@ -8,6 +8,10 @@
To create a ViewportTexture in code, use the [method Viewport.get_texture] method on the target viewport.
</description>
<tutorials>
+ <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
+ <link title="3D in 2D Demo">https://godotengine.org/asset-library/asset/128</link>
+ <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link>
+ <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/VisibilityEnabler2D.xml b/doc/classes/VisibilityEnabler2D.xml
index f0e4c999ac..02fe7a7cd0 100644
--- a/doc/classes/VisibilityEnabler2D.xml
+++ b/doc/classes/VisibilityEnabler2D.xml
@@ -5,7 +5,8 @@
</brief_description>
<description>
The VisibilityEnabler2D will disable [RigidBody2D], [AnimationPlayer], and other nodes when they are not visible. It will only affect nodes with the same root node as the VisibilityEnabler2D, and the root node itself.
- [b]Note:[/b] VisibilityEnabler2D uses an approximate heuristic for performance reasons. If you need exact visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node.
+ If you just want to receive notifications, use [VisibilityNotifier2D] instead.
+ [b]Note:[/b] For performance reasons, VisibilityEnabler2D uses an approximate heuristic with precision determined by [member ProjectSettings.world/2d/cell_size]. If you need precise visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node.
[b]Note:[/b] VisibilityEnabler2D will not affect nodes added after scene initialization.
</description>
<tutorials>
diff --git a/doc/classes/VisibilityEnabler3D.xml b/doc/classes/VisibilityEnabler3D.xml
index 342a37e7a4..d78ebb55f2 100644
--- a/doc/classes/VisibilityEnabler3D.xml
+++ b/doc/classes/VisibilityEnabler3D.xml
@@ -5,7 +5,8 @@
</brief_description>
<description>
The VisibilityEnabler3D will disable [RigidBody3D] and [AnimationPlayer] nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler3D itself.
- [b]Note:[/b] VisibilityEnabler3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. If you need exact visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node.
+ If you just want to receive notifications, use [VisibilityNotifier3D] instead.
+ [b]Note:[/b] VisibilityEnabler3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot].
[b]Note:[/b] VisibilityEnabler3D will not affect nodes added after scene initialization.
</description>
<tutorials>
diff --git a/doc/classes/VisibilityNotifier2D.xml b/doc/classes/VisibilityNotifier2D.xml
index 813f74f404..761438b77e 100644
--- a/doc/classes/VisibilityNotifier2D.xml
+++ b/doc/classes/VisibilityNotifier2D.xml
@@ -5,9 +5,11 @@
</brief_description>
<description>
The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport.
- [b]Note:[/b] VisibilityNotifier2D uses an approximate heuristic for performance reasons. If you need exact visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node.
+ If you want nodes to be disabled automatically when they exit the screen, use [VisibilityEnabler2D] instead.
+ [b]Note:[/b] For performance reasons, VisibilityNotifier2D uses an approximate heuristic with precision determined by [member ProjectSettings.world/2d/cell_size]. If you need precise visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node.
</description>
<tutorials>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="is_on_screen" qualifiers="const">
diff --git a/doc/classes/VisibilityNotifier3D.xml b/doc/classes/VisibilityNotifier3D.xml
index eb7bb91f26..e5d3116612 100644
--- a/doc/classes/VisibilityNotifier3D.xml
+++ b/doc/classes/VisibilityNotifier3D.xml
@@ -5,7 +5,8 @@
</brief_description>
<description>
The VisibilityNotifier3D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a [Camera3D]'s view.
- [b]Note:[/b] VisibilityNotifier3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. If you need exact visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node.
+ If you want nodes to be disabled automatically when they exit the screen, use [VisibilityEnabler3D] instead.
+ [b]Note:[/b] VisibilityNotifier3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualInstance3D.xml b/doc/classes/VisualInstance3D.xml
index 6451b3f330..01d569d9c8 100644
--- a/doc/classes/VisualInstance3D.xml
+++ b/doc/classes/VisualInstance3D.xml
@@ -13,7 +13,7 @@
<return type="AABB">
</return>
<description>
- Returns the [AABB] (also known as the bounding box) for this [VisualInstance3D].
+ Returns the [AABB] (also known as the bounding box) for this [VisualInstance3D]. See also [method get_transformed_aabb].
</description>
</method>
<method name="get_base" qualifiers="const">
@@ -44,7 +44,7 @@
</return>
<description>
Returns the transformed [AABB] (also known as the bounding box) for this [VisualInstance3D].
- Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Node3D]'s [Transform].
+ Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Node3D]'s [Transform]. See also [method get_aabb].
</description>
</method>
<method name="set_base">
diff --git a/doc/classes/VisualShader.xml b/doc/classes/VisualShader.xml
index 40b0f52469..f03550bd5e 100644
--- a/doc/classes/VisualShader.xml
+++ b/doc/classes/VisualShader.xml
@@ -193,7 +193,6 @@
</method>
</methods>
<members>
- <member name="code" type="String" setter="set_code" getter="get_code" override="true" default="&quot;shader_type spatial;void vertex() {// Output:0}void fragment() {// Output:0}void light() {// Output:0}&quot;" />
<member name="graph_offset" type="Vector2" setter="set_graph_offset" getter="get_graph_offset" default="Vector2( 0, 0 )">
The offset vector of the whole graph.
</member>
@@ -210,7 +209,13 @@
<constant name="TYPE_LIGHT" value="2" enum="Type">
A shader for light calculations.
</constant>
- <constant name="TYPE_MAX" value="3" enum="Type">
+ <constant name="TYPE_EMIT" value="3" enum="Type">
+ </constant>
+ <constant name="TYPE_PROCESS" value="4" enum="Type">
+ </constant>
+ <constant name="TYPE_END" value="5" enum="Type">
+ </constant>
+ <constant name="TYPE_MAX" value="6" enum="Type">
Represents the size of the [enum Type] enum.
</constant>
<constant name="NODE_ID_INVALID" value="-1">
diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml
index 28d13a7d32..6327ab534f 100644
--- a/doc/classes/VisualShaderNode.xml
+++ b/doc/classes/VisualShaderNode.xml
@@ -6,7 +6,7 @@
<description>
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/shading/visual_shaders.html</link>
+ <link title="VisualShaders">https://docs.godotengine.org/en/latest/tutorials/shading/visual_shaders.html</link>
</tutorials>
<methods>
<method name="get_default_input_values" qualifiers="const">
diff --git a/doc/classes/VisualShaderNodeBooleanUniform.xml b/doc/classes/VisualShaderNodeBooleanUniform.xml
index 8313a8256e..7d72f13f9d 100644
--- a/doc/classes/VisualShaderNodeBooleanUniform.xml
+++ b/doc/classes/VisualShaderNodeBooleanUniform.xml
@@ -10,6 +10,14 @@
</tutorials>
<methods>
</methods>
+ <members>
+ <member name="default_value" type="bool" setter="set_default_value" getter="get_default_value" default="false">
+ A default value to be assigned within the shader.
+ </member>
+ <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false">
+ Enables usage of the [member default_value].
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeColorUniform.xml b/doc/classes/VisualShaderNodeColorUniform.xml
index 6972ccefd9..90ef381b76 100644
--- a/doc/classes/VisualShaderNodeColorUniform.xml
+++ b/doc/classes/VisualShaderNodeColorUniform.xml
@@ -10,6 +10,14 @@
</tutorials>
<methods>
</methods>
+ <members>
+ <member name="default_value" type="Color" setter="set_default_value" getter="get_default_value" default="Color( 1, 1, 1, 1 )">
+ A default value to be assigned within the shader.
+ </member>
+ <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false">
+ Enables usage of the [member default_value].
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeCurveTexture.xml b/doc/classes/VisualShaderNodeCurveTexture.xml
new file mode 100644
index 0000000000..26b7b07df2
--- /dev/null
+++ b/doc/classes/VisualShaderNodeCurveTexture.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeCurveTexture" inherits="VisualShaderNodeResizableBase" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="texture" type="CurveTexture" setter="set_texture" getter="get_texture">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml
index 5bd8ec38ed..59b501660a 100644
--- a/doc/classes/VisualShaderNodeCustom.xml
+++ b/doc/classes/VisualShaderNodeCustom.xml
@@ -5,15 +5,15 @@
</brief_description>
<description>
By inheriting this class you can create a custom [VisualShader] script addon which will be automatically added to the Visual Shader Editor. The [VisualShaderNode]'s behavior is defined by overriding the provided virtual methods.
- In order for the node to be registered as an editor addon, you must use the [code]tool[/code] keyword and provide a [code]class_name[/code] for your custom script. For example:
+ In order for the node to be registered as an editor addon, you must use the [code]@tool[/code] annotation and provide a [code]class_name[/code] for your custom script. For example:
[codeblock]
- tool
+ @tool
extends VisualShaderNodeCustom
class_name VisualShaderNodeNoise
[/codeblock]
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/plugins/editor/visual_shader_plugins.html</link>
+ <link title="Visual Shader plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/visual_shader_plugins.html</link>
</tutorials>
<methods>
<method name="_get_category" qualifiers="virtual">
diff --git a/doc/classes/VisualShaderNodeFloatUniform.xml b/doc/classes/VisualShaderNodeFloatUniform.xml
index 33ece8ac1b..705d5e8796 100644
--- a/doc/classes/VisualShaderNodeFloatUniform.xml
+++ b/doc/classes/VisualShaderNodeFloatUniform.xml
@@ -11,6 +11,12 @@
<methods>
</methods>
<members>
+ <member name="default_value" type="float" setter="set_default_value" getter="get_default_value" default="0.0">
+ A default value to be assigned within the shader.
+ </member>
+ <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false">
+ Enables usage of the [member default_value].
+ </member>
<member name="hint" type="int" setter="set_hint" getter="get_hint" enum="VisualShaderNodeFloatUniform.Hint" default="0">
A hint applied to the uniform, which controls the values it can take when set through the inspector.
</member>
diff --git a/doc/classes/VisualShaderNodeGroupBase.xml b/doc/classes/VisualShaderNodeGroupBase.xml
index 13018d52f3..afa14c776e 100644
--- a/doc/classes/VisualShaderNodeGroupBase.xml
+++ b/doc/classes/VisualShaderNodeGroupBase.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="VisualShaderNodeGroupBase" inherits="VisualShaderNode" version="4.0">
+<class name="VisualShaderNodeGroupBase" inherits="VisualShaderNodeResizableBase" version="4.0">
<brief_description>
Base class for a family of nodes with variable amount of input and output ports within the visual shader graph.
</brief_description>
@@ -199,11 +199,6 @@
</description>
</method>
</methods>
- <members>
- <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 0, 0 )">
- The size of the node in the visual shader graph.
- </member>
- </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeInput.xml b/doc/classes/VisualShaderNodeInput.xml
index ed629508d0..8e819b011c 100644
--- a/doc/classes/VisualShaderNodeInput.xml
+++ b/doc/classes/VisualShaderNodeInput.xml
@@ -4,8 +4,10 @@
Represents the input shader parameter within the visual shader graph.
</brief_description>
<description>
+ Gives access to input variables (built-ins) available for the shader. See the shading reference for the list of available built-ins for each shader type (check [code]Tutorials[/code] section for link).
</description>
<tutorials>
+ <link title="Shading reference index">https://docs.godotengine.org/en/stable/tutorials/shading/shading_reference/index.html</link>
</tutorials>
<methods>
<method name="get_input_real_name" qualifiers="const">
@@ -18,7 +20,7 @@
</methods>
<members>
<member name="input_name" type="String" setter="set_input_name" getter="get_input_name" default="&quot;[None]&quot;">
- One of the several input constants in lower-case style like: "vertex"([/code]VERTEX[code]) or "point_size"([code]POINT_SIZE[/code]).
+ One of the several input constants in lower-case style like: "vertex"([code]VERTEX[/code]) or "point_size"([code]POINT_SIZE[/code]).
</member>
</members>
<signals>
diff --git a/doc/classes/VisualShaderNodeIntUniform.xml b/doc/classes/VisualShaderNodeIntUniform.xml
index 8c7c288177..e39eba865b 100644
--- a/doc/classes/VisualShaderNodeIntUniform.xml
+++ b/doc/classes/VisualShaderNodeIntUniform.xml
@@ -11,6 +11,12 @@
<methods>
</methods>
<members>
+ <member name="default_value" type="int" setter="set_default_value" getter="get_default_value" default="0">
+ A default value to be assigned within the shader.
+ </member>
+ <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false">
+ Enables usage of the [member default_value].
+ </member>
<member name="hint" type="int" setter="set_hint" getter="get_hint" enum="VisualShaderNodeIntUniform.Hint" default="0">
A hint applied to the uniform, which controls the values it can take when set through the inspector.
</member>
diff --git a/doc/classes/VisualShaderNodeIs.xml b/doc/classes/VisualShaderNodeIs.xml
index 184c9e099f..b767a9638e 100644
--- a/doc/classes/VisualShaderNodeIs.xml
+++ b/doc/classes/VisualShaderNodeIs.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeIs" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ A boolean comparison operator to be used within the visual shader graph.
</brief_description>
<description>
+ Returns the boolean result of the comparison between [code]INF[/code] or [code]NaN[/code] and a scalar parameter.
</description>
<tutorials>
</tutorials>
@@ -10,12 +12,15 @@
</methods>
<members>
<member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeIs.Function" default="0">
+ The comparison function. See [enum Function] for options.
</member>
</members>
<constants>
<constant name="FUNC_IS_INF" value="0" enum="Function">
+ Comparison with [code]INF[/code] (Infinity).
</constant>
<constant name="FUNC_IS_NAN" value="1" enum="Function">
+ Comparison with [code]NaN[/code] (Not a Number; denotes invalid numeric results, e.g. division by zero).
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeMultiplyAdd.xml b/doc/classes/VisualShaderNodeMultiplyAdd.xml
new file mode 100644
index 0000000000..daa9e02753
--- /dev/null
+++ b/doc/classes/VisualShaderNodeMultiplyAdd.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeMultiplyAdd" inherits="VisualShaderNode" version="4.0">
+ <brief_description>
+ Performs a fused multiply-add operation within the visual shader graph.
+ </brief_description>
+ <description>
+ Uses three operands to compute [code](a * b + c)[/code] expression.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="op_type" type="int" setter="set_op_type" getter="get_op_type" enum="VisualShaderNodeMultiplyAdd.OpType" default="0">
+ A type of operands and returned value.
+ </member>
+ </members>
+ <constants>
+ <constant name="OP_TYPE_SCALAR" value="0" enum="OpType">
+ A scalar type.
+ </constant>
+ <constant name="OP_TYPE_VECTOR" value="1" enum="OpType">
+ A vector type.
+ </constant>
+ <constant name="OP_TYPE_MAX" value="2" enum="OpType">
+ Represents the size of the [enum OpType] enum.
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeOuterProduct.xml b/doc/classes/VisualShaderNodeOuterProduct.xml
index b8d4fd687f..ba6822bfce 100644
--- a/doc/classes/VisualShaderNodeOuterProduct.xml
+++ b/doc/classes/VisualShaderNodeOuterProduct.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeOuterProduct" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Calculates an outer product of two vectors within the visual shader graph.
</brief_description>
<description>
+ [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].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeOutput.xml b/doc/classes/VisualShaderNodeOutput.xml
index c63e307bad..83da6f29f9 100644
--- a/doc/classes/VisualShaderNodeOutput.xml
+++ b/doc/classes/VisualShaderNodeOutput.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeOutput" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Represents the output shader parameters within the visual shader graph.
</brief_description>
<description>
+ This visual shader node is present in all shader graphs in form of "Output" block with multiple output value ports.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeResizableBase.xml b/doc/classes/VisualShaderNodeResizableBase.xml
new file mode 100644
index 0000000000..9f827a96cc
--- /dev/null
+++ b/doc/classes/VisualShaderNodeResizableBase.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeResizableBase" inherits="VisualShaderNode" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 0, 0 )">
+ The size of the node in the visual shader graph.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeSample3D.xml b/doc/classes/VisualShaderNodeSample3D.xml
new file mode 100644
index 0000000000..cf6933ab55
--- /dev/null
+++ b/doc/classes/VisualShaderNodeSample3D.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeSample3D" inherits="VisualShaderNode" version="4.0">
+ <brief_description>
+ A base node for nodes which samples 3D textures in the visual shader graph.
+ </brief_description>
+ <description>
+ A virtual class, use the descendants instead.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeSample3D.Source" default="0">
+ An input source type.
+ </member>
+ </members>
+ <constants>
+ <constant name="SOURCE_TEXTURE" value="0" enum="Source">
+ Creates internal uniform and provides a way to assign it within node.
+ </constant>
+ <constant name="SOURCE_PORT" value="1" enum="Source">
+ Use the uniform texture from sampler port.
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeScalarClamp.xml b/doc/classes/VisualShaderNodeScalarClamp.xml
index fd963dcb5d..7432e8dfca 100644
--- a/doc/classes/VisualShaderNodeScalarClamp.xml
+++ b/doc/classes/VisualShaderNodeScalarClamp.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeScalarClamp" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Clamps a scalar value within the visual shader graph.
</brief_description>
<description>
+ Constrains a value to lie between [code]min[/code] and [code]max[/code] values.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml b/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml
index fa9aa07761..33777c1e49 100644
--- a/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml
+++ b/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeScalarDerivativeFunc" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Calculates a scalar derivative within the visual shader graph.
</brief_description>
<description>
+ This node is only available in [code]Fragment[/code] and [code]Light[/code] visual shaders.
</description>
<tutorials>
</tutorials>
@@ -10,14 +12,18 @@
</methods>
<members>
<member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeScalarDerivativeFunc.Function" default="0">
+ The derivative type. See [enum Function] for options.
</member>
</members>
<constants>
<constant name="FUNC_SUM" value="0" enum="Function">
+ Sum of absolute derivative in [code]x[/code] and [code]y[/code].
</constant>
<constant name="FUNC_X" value="1" enum="Function">
+ Derivative in [code]x[/code] using local differencing.
</constant>
<constant name="FUNC_Y" value="2" enum="Function">
+ Derivative in [code]y[/code] using local differencing.
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeScalarInterp.xml b/doc/classes/VisualShaderNodeScalarInterp.xml
index a25ab750cc..393ea70e1a 100644
--- a/doc/classes/VisualShaderNodeScalarInterp.xml
+++ b/doc/classes/VisualShaderNodeScalarInterp.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeScalarInterp" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Linearly interpolates between two scalars within the visual shader graph.
</brief_description>
<description>
+ Translates to [code]mix(a, b, weight)[/code] in the shader language.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeScalarSmoothStep.xml b/doc/classes/VisualShaderNodeScalarSmoothStep.xml
index 1ac16e451f..e619cc8571 100644
--- a/doc/classes/VisualShaderNodeScalarSmoothStep.xml
+++ b/doc/classes/VisualShaderNodeScalarSmoothStep.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeScalarSmoothStep" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Calculates a scalar SmoothStep function within the visual shader graph.
</brief_description>
<description>
+ Translates to [code]smoothstep(edge0, edge1, x)[/code] in the shader language.
+ 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.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeScalarSwitch.xml b/doc/classes/VisualShaderNodeScalarSwitch.xml
index 789c8972bb..2ad5202745 100644
--- a/doc/classes/VisualShaderNodeScalarSwitch.xml
+++ b/doc/classes/VisualShaderNodeScalarSwitch.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeScalarSwitch" inherits="VisualShaderNodeSwitch" version="4.0">
<brief_description>
+ A boolean/scalar function for use within the visual shader graph.
</brief_description>
<description>
+ Returns an associated scalar if the provided boolean value is [code]true[/code] or [code]false[/code].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeSwitch.xml b/doc/classes/VisualShaderNodeSwitch.xml
index 5bbb9168a0..9f8a12c0fd 100644
--- a/doc/classes/VisualShaderNodeSwitch.xml
+++ b/doc/classes/VisualShaderNodeSwitch.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeSwitch" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ A boolean/vector function for use within the visual shader graph.
</brief_description>
<description>
+ Returns an associated vector if the provided boolean value is [code]true[/code] or [code]false[/code].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeTexture.xml b/doc/classes/VisualShaderNodeTexture.xml
index a28a7f5c65..0c83ffffe4 100644
--- a/doc/classes/VisualShaderNodeTexture.xml
+++ b/doc/classes/VisualShaderNodeTexture.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeTexture" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Performs a 2D texture lookup within the visual shader graph.
</brief_description>
<description>
+ Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from.
</description>
<tutorials>
</tutorials>
@@ -10,30 +12,42 @@
</methods>
<members>
<member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeTexture.Source" default="0">
+ Determines the source for the lookup. See [enum Source] for options.
</member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
+ The source texture, if needed for the selected [member source].
</member>
<member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeTexture.TextureType" default="0">
+ Specifies the type of the texture if [member source] is set to [constant SOURCE_TEXTURE]. See [enum TextureType] for options.
</member>
</members>
<constants>
<constant name="SOURCE_TEXTURE" value="0" enum="Source">
+ Use the texture given as an argument for this function.
</constant>
<constant name="SOURCE_SCREEN" value="1" enum="Source">
+ Use the current viewport's texture as the source.
</constant>
<constant name="SOURCE_2D_TEXTURE" value="2" enum="Source">
+ Use the texture from this shader's texture built-in (e.g. a texture of a [Sprite2D]).
</constant>
<constant name="SOURCE_2D_NORMAL" value="3" enum="Source">
+ Use the texture from this shader's normal map built-in.
</constant>
<constant name="SOURCE_DEPTH" value="4" enum="Source">
+ Use the depth texture available for this shader.
</constant>
<constant name="SOURCE_PORT" value="5" enum="Source">
+ Use the texture provided in the input port for this function.
</constant>
<constant name="TYPE_DATA" value="0" enum="TextureType">
+ No hints are added to the uniform declaration.
</constant>
<constant name="TYPE_COLOR" value="1" enum="TextureType">
+ Adds [code]hint_albedo[/code] as hint to the uniform declaration for proper sRGB to linear conversion.
</constant>
<constant name="TYPE_NORMALMAP" value="2" enum="TextureType">
+ Adds [code]hint_normal[/code] as hint to the uniform declaration, which internally converts the texture for proper usage as normal map.
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeTexture2DArray.xml b/doc/classes/VisualShaderNodeTexture2DArray.xml
new file mode 100644
index 0000000000..3c6d328ed0
--- /dev/null
+++ b/doc/classes/VisualShaderNodeTexture2DArray.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeTexture2DArray" inherits="VisualShaderNodeSample3D" version="4.0">
+ <brief_description>
+ A 2D texture uniform array to be used within the visual shader graph.
+ </brief_description>
+ <description>
+ Translated to [code]uniform sampler2DArray[/code] in the shader language.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="texture_array" type="Texture2DArray" setter="set_texture_array" getter="get_texture_array">
+ A source texture array. Used if [member VisualShaderNodeSample3D.source] is set to [constant VisualShaderNodeSample3D.SOURCE_TEXTURE].
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeTexture2DArrayUniform.xml b/doc/classes/VisualShaderNodeTexture2DArrayUniform.xml
new file mode 100644
index 0000000000..976fcf26c8
--- /dev/null
+++ b/doc/classes/VisualShaderNodeTexture2DArrayUniform.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeTexture2DArrayUniform" inherits="VisualShaderNodeTextureUniform" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeTexture3D.xml b/doc/classes/VisualShaderNodeTexture3D.xml
new file mode 100644
index 0000000000..17929e823e
--- /dev/null
+++ b/doc/classes/VisualShaderNodeTexture3D.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeTexture3D" inherits="VisualShaderNodeSample3D" version="4.0">
+ <brief_description>
+ Performs a 3D texture lookup within the visual shader graph.
+ </brief_description>
+ <description>
+ Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="texture" type="Texture3D" setter="set_texture" getter="get_texture">
+ A source texture. Used if [member VisualShaderNodeSample3D.source] is set to [constant VisualShaderNodeSample3D.SOURCE_TEXTURE].
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeTexture3DUniform.xml b/doc/classes/VisualShaderNodeTexture3DUniform.xml
new file mode 100644
index 0000000000..d9e9acf117
--- /dev/null
+++ b/doc/classes/VisualShaderNodeTexture3DUniform.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeTexture3DUniform" inherits="VisualShaderNodeTextureUniform" version="4.0">
+ <brief_description>
+ Provides a 3D texture uniform within the visual shader graph.
+ </brief_description>
+ <description>
+ Translated to [code]uniform sampler3D[/code] in the shader language.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeTextureUniform.xml b/doc/classes/VisualShaderNodeTextureUniform.xml
index 4e2c39a297..107f08ba28 100644
--- a/doc/classes/VisualShaderNodeTextureUniform.xml
+++ b/doc/classes/VisualShaderNodeTextureUniform.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeTextureUniform" inherits="VisualShaderNodeUniform" version="4.0">
<brief_description>
+ Performs a uniform texture lookup within the visual shader graph.
</brief_description>
<description>
+ Performs a lookup operation on the texture provided as a uniform for the shader.
</description>
<tutorials>
</tutorials>
@@ -10,22 +12,30 @@
</methods>
<members>
<member name="color_default" type="int" setter="set_color_default" getter="get_color_default" enum="VisualShaderNodeTextureUniform.ColorDefault" default="0">
+ Sets the default color if no texture is assigned to the uniform.
</member>
<member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeTextureUniform.TextureType" default="0">
+ Defines the type of data provided by the source texture. See [enum TextureType] for options.
</member>
</members>
<constants>
<constant name="TYPE_DATA" value="0" enum="TextureType">
+ No hints are added to the uniform declaration.
</constant>
<constant name="TYPE_COLOR" value="1" enum="TextureType">
+ Adds [code]hint_albedo[/code] as hint to the uniform declaration for proper sRGB to linear conversion.
</constant>
<constant name="TYPE_NORMALMAP" value="2" enum="TextureType">
+ Adds [code]hint_normal[/code] as hint to the uniform declaration, which internally converts the texture for proper usage as normal map.
</constant>
<constant name="TYPE_ANISO" value="3" enum="TextureType">
+ Adds [code]hint_aniso[/code] as hint to the uniform declaration to use for a flowmap.
</constant>
<constant name="COLOR_DEFAULT_WHITE" value="0" enum="ColorDefault">
+ Defaults to white color.
</constant>
<constant name="COLOR_DEFAULT_BLACK" value="1" enum="ColorDefault">
+ Defaults to black color.
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeTextureUniformTriplanar.xml b/doc/classes/VisualShaderNodeTextureUniformTriplanar.xml
index 3d69575444..28504cc7ac 100644
--- a/doc/classes/VisualShaderNodeTextureUniformTriplanar.xml
+++ b/doc/classes/VisualShaderNodeTextureUniformTriplanar.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeTextureUniformTriplanar" inherits="VisualShaderNodeTextureUniform" version="4.0">
<brief_description>
+ Performs a uniform texture lookup with triplanar within the visual shader graph.
</brief_description>
<description>
+ Performs a lookup operation on the texture provided as a uniform for the shader, with support for triplanar mapping.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeTransformCompose.xml b/doc/classes/VisualShaderNodeTransformCompose.xml
index 6d9cab7ab0..41762b0099 100644
--- a/doc/classes/VisualShaderNodeTransformCompose.xml
+++ b/doc/classes/VisualShaderNodeTransformCompose.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeTransformCompose" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Composes a [Transform] from four [Vector3]s within the visual shader graph.
</brief_description>
<description>
+ 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].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeTransformConstant.xml b/doc/classes/VisualShaderNodeTransformConstant.xml
index 15422e1728..e5004e5bb6 100644
--- a/doc/classes/VisualShaderNodeTransformConstant.xml
+++ b/doc/classes/VisualShaderNodeTransformConstant.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeTransformConstant" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ A [Transform] constant for use within the visual shader graph.
</brief_description>
<description>
+ A constant [Transform], which can be used as an input node.
</description>
<tutorials>
</tutorials>
@@ -10,6 +12,7 @@
</methods>
<members>
<member name="constant" type="Transform" setter="set_constant" getter="get_constant" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
+ A [Transform] constant which represents the state of this node.
</member>
</members>
<constants>
diff --git a/doc/classes/VisualShaderNodeTransformDecompose.xml b/doc/classes/VisualShaderNodeTransformDecompose.xml
index 4d3c464781..c8d893db00 100644
--- a/doc/classes/VisualShaderNodeTransformDecompose.xml
+++ b/doc/classes/VisualShaderNodeTransformDecompose.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeTransformDecompose" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Decomposes a [Transform] into four [Vector3]s within the visual shader graph.
</brief_description>
<description>
+ Takes a 4x4 transform matrix and decomposes it into four [code]vec3[/code] values, one from each row of the matrix.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeTransformFunc.xml b/doc/classes/VisualShaderNodeTransformFunc.xml
index d2b6fcef2b..d0b5c5129d 100644
--- a/doc/classes/VisualShaderNodeTransformFunc.xml
+++ b/doc/classes/VisualShaderNodeTransformFunc.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeTransformFunc" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Computes a [Transform] function within the visual shader graph.
</brief_description>
<description>
+ Computes an inverse or transpose function on the provided [Transform].
</description>
<tutorials>
</tutorials>
@@ -10,12 +12,15 @@
</methods>
<members>
<member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeTransformFunc.Function" default="0">
+ The function to be computed. See [enum Function] for options.
</member>
</members>
<constants>
<constant name="FUNC_INVERSE" value="0" enum="Function">
+ Perform the inverse operation on the [Transform] matrix.
</constant>
<constant name="FUNC_TRANSPOSE" value="1" enum="Function">
+ Perform the transpose operation on the [Transform] matrix.
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeTransformMult.xml b/doc/classes/VisualShaderNodeTransformMult.xml
index 5893d1413b..02b6e0cd1c 100644
--- a/doc/classes/VisualShaderNodeTransformMult.xml
+++ b/doc/classes/VisualShaderNodeTransformMult.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeTransformMult" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Multiplies [Transform] by [Transform] within the visual shader graph.
</brief_description>
<description>
+ A multiplication operation on two transforms (4x4 matrices), with support for different multiplication operators.
</description>
<tutorials>
</tutorials>
@@ -10,16 +12,21 @@
</methods>
<members>
<member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeTransformMult.Operator" default="0">
+ The multiplication type to be performed on the transforms. See [enum Operator] for options.
</member>
</members>
<constants>
<constant name="OP_AxB" value="0" enum="Operator">
+ Multiplies transform [code]a[/code] by the transform [code]b[/code].
</constant>
<constant name="OP_BxA" value="1" enum="Operator">
+ Multiplies transform [code]b[/code] by the transform [code]a[/code].
</constant>
<constant name="OP_AxB_COMP" value="2" enum="Operator">
+ Performs a component-wise multiplication of transform [code]a[/code] by the transform [code]b[/code].
</constant>
<constant name="OP_BxA_COMP" value="3" enum="Operator">
+ Performs a component-wise multiplication of transform [code]b[/code] by the transform [code]a[/code].
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeTransformUniform.xml b/doc/classes/VisualShaderNodeTransformUniform.xml
index 7605ef96d5..ff6246618d 100644
--- a/doc/classes/VisualShaderNodeTransformUniform.xml
+++ b/doc/classes/VisualShaderNodeTransformUniform.xml
@@ -1,13 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeTransformUniform" inherits="VisualShaderNodeUniform" version="4.0">
<brief_description>
+ A [Transform] uniform for use within the visual shader graph.
</brief_description>
<description>
+ Translated to [code]uniform mat4[/code] in the shader language.
</description>
<tutorials>
</tutorials>
<methods>
</methods>
+ <members>
+ <member name="default_value" type="Transform" setter="set_default_value" getter="get_default_value" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
+ A default value to be assigned within the shader.
+ </member>
+ <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false">
+ Enables usage of the [member default_value].
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeTransformVecMult.xml b/doc/classes/VisualShaderNodeTransformVecMult.xml
index d53c3c5ae5..3d5f87f727 100644
--- a/doc/classes/VisualShaderNodeTransformVecMult.xml
+++ b/doc/classes/VisualShaderNodeTransformVecMult.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeTransformVecMult" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Multiplies a [Transform] and a [Vector3] within the visual shader graph.
</brief_description>
<description>
+ A multiplication operation on a transform (4x4 matrix) and a vector, with support for different multiplication operators.
</description>
<tutorials>
</tutorials>
@@ -10,16 +12,21 @@
</methods>
<members>
<member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeTransformVecMult.Operator" default="0">
+ The multiplication type to be performed. See [enum Operator] for options.
</member>
</members>
<constants>
<constant name="OP_AxB" value="0" enum="Operator">
+ Multiplies transform [code]a[/code] by the vector [code]b[/code].
</constant>
<constant name="OP_BxA" value="1" enum="Operator">
+ Multiplies vector [code]b[/code] by the transform [code]a[/code].
</constant>
<constant name="OP_3x3_AxB" value="2" enum="Operator">
+ Multiplies transform [code]a[/code] by the vector [code]b[/code], skipping the last row and column of the transform.
</constant>
<constant name="OP_3x3_BxA" value="3" enum="Operator">
+ Multiplies vector [code]b[/code] by the transform [code]a[/code], skipping the last row and column of the transform.
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeUniform.xml b/doc/classes/VisualShaderNodeUniform.xml
index c4362f6f2a..83261344bd 100644
--- a/doc/classes/VisualShaderNodeUniform.xml
+++ b/doc/classes/VisualShaderNodeUniform.xml
@@ -1,17 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeUniform" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ A base type for the uniforms within the visual shader graph.
</brief_description>
<description>
+ 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.
</description>
<tutorials>
</tutorials>
<methods>
</methods>
<members>
+ <member name="qualifier" type="int" setter="set_qualifier" getter="get_qualifier" enum="VisualShaderNodeUniform.Qualifier" default="0">
+ </member>
<member name="uniform_name" type="String" setter="set_uniform_name" getter="get_uniform_name" default="&quot;&quot;">
+ Name of the uniform, by which it can be accessed through the [ShaderMaterial] properties.
</member>
</members>
<constants>
+ <constant name="QUAL_NONE" value="0" enum="Qualifier">
+ </constant>
+ <constant name="QUAL_GLOBAL" value="1" enum="Qualifier">
+ </constant>
+ <constant name="QUAL_INSTANCE" value="2" enum="Qualifier">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeUniformRef.xml b/doc/classes/VisualShaderNodeUniformRef.xml
new file mode 100644
index 0000000000..db02e398ab
--- /dev/null
+++ b/doc/classes/VisualShaderNodeUniformRef.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeUniformRef" inherits="VisualShaderNode" version="4.0">
+ <brief_description>
+ A reference to an existing [VisualShaderNodeUniform].
+ </brief_description>
+ <description>
+ Creating a reference to a [VisualShaderNodeUniform] allows you to reuse this uniform in different shaders or shader stages easily.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="uniform_name" type="String" setter="set_uniform_name" getter="get_uniform_name" default="&quot;[None]&quot;">
+ The name of the uniform which this reference points to.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeVec3Constant.xml b/doc/classes/VisualShaderNodeVec3Constant.xml
index 8532c5476f..4dfc9dc081 100644
--- a/doc/classes/VisualShaderNodeVec3Constant.xml
+++ b/doc/classes/VisualShaderNodeVec3Constant.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVec3Constant" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ A [Vector3] constant to be used within the visual shader graph.
</brief_description>
<description>
+ A constant [Vector3], which can be used as an input node.
</description>
<tutorials>
</tutorials>
@@ -10,6 +12,7 @@
</methods>
<members>
<member name="constant" type="Vector3" setter="set_constant" getter="get_constant" default="Vector3( 0, 0, 0 )">
+ A [Vector3] constant which represents the state of this node.
</member>
</members>
<constants>
diff --git a/doc/classes/VisualShaderNodeVec3Uniform.xml b/doc/classes/VisualShaderNodeVec3Uniform.xml
index f2b4c4778b..cd1500f5a1 100644
--- a/doc/classes/VisualShaderNodeVec3Uniform.xml
+++ b/doc/classes/VisualShaderNodeVec3Uniform.xml
@@ -1,13 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVec3Uniform" inherits="VisualShaderNodeUniform" version="4.0">
<brief_description>
+ A [Vector3] uniform to be used within the visual shader graph.
</brief_description>
<description>
+ Translated to [code]uniform vec3[/code] in the shader language.
</description>
<tutorials>
</tutorials>
<methods>
</methods>
+ <members>
+ <member name="default_value" type="Vector3" setter="set_default_value" getter="get_default_value" default="Vector3( 0, 0, 0 )">
+ A default value to be assigned within the shader.
+ </member>
+ <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false">
+ Enables usage of the [member default_value].
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeVectorClamp.xml b/doc/classes/VisualShaderNodeVectorClamp.xml
index 85c093f84c..567fed8a41 100644
--- a/doc/classes/VisualShaderNodeVectorClamp.xml
+++ b/doc/classes/VisualShaderNodeVectorClamp.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorClamp" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Clamps a vector value within the visual shader graph.
</brief_description>
<description>
+ 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.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorCompose.xml b/doc/classes/VisualShaderNodeVectorCompose.xml
index e5e4924a9e..c9ff3cd38e 100644
--- a/doc/classes/VisualShaderNodeVectorCompose.xml
+++ b/doc/classes/VisualShaderNodeVectorCompose.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorCompose" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Composes a [Vector3] from three scalars within the visual shader graph.
</brief_description>
<description>
+ Creates a [code]vec3[/code] using three scalar values that can be provided from separate inputs.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorDecompose.xml b/doc/classes/VisualShaderNodeVectorDecompose.xml
index 5378f38b6d..95af323c9b 100644
--- a/doc/classes/VisualShaderNodeVectorDecompose.xml
+++ b/doc/classes/VisualShaderNodeVectorDecompose.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorDecompose" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Decomposes a [Vector3] into three scalars within the visual shader graph.
</brief_description>
<description>
+ Takes a [code]vec3[/code] and decomposes it into three scalar values that can be used as separate inputs.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorDerivativeFunc.xml b/doc/classes/VisualShaderNodeVectorDerivativeFunc.xml
index d62512d68b..859c47bc33 100644
--- a/doc/classes/VisualShaderNodeVectorDerivativeFunc.xml
+++ b/doc/classes/VisualShaderNodeVectorDerivativeFunc.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorDerivativeFunc" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Calculates a vector derivative within the visual shader graph.
</brief_description>
<description>
+ This node is only available in [code]Fragment[/code] and [code]Light[/code] visual shaders.
</description>
<tutorials>
</tutorials>
@@ -10,14 +12,18 @@
</methods>
<members>
<member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeVectorDerivativeFunc.Function" default="0">
+ A derivative type. See [enum Function] for options.
</member>
</members>
<constants>
<constant name="FUNC_SUM" value="0" enum="Function">
+ Sum of absolute derivative in [code]x[/code] and [code]y[/code].
</constant>
<constant name="FUNC_X" value="1" enum="Function">
+ Derivative in [code]x[/code] using local differencing.
</constant>
<constant name="FUNC_Y" value="2" enum="Function">
+ Derivative in [code]y[/code] using local differencing.
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeVectorDistance.xml b/doc/classes/VisualShaderNodeVectorDistance.xml
index 2e681156a5..2da04b122e 100644
--- a/doc/classes/VisualShaderNodeVectorDistance.xml
+++ b/doc/classes/VisualShaderNodeVectorDistance.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorDistance" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Returns the distance between two points. To be used within the visual shader graph.
</brief_description>
<description>
+ Calculates distance from point represented by vector [code]p0[/code] to vector [code]p1[/code].
+ Translated to [code]distance(p0, p1)[/code] in the shader language.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorFunc.xml b/doc/classes/VisualShaderNodeVectorFunc.xml
index 0b3f317b8b..cbda3dfb46 100644
--- a/doc/classes/VisualShaderNodeVectorFunc.xml
+++ b/doc/classes/VisualShaderNodeVectorFunc.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorFunc" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ A vector function to be used within the visual shader graph.
</brief_description>
<description>
+ A visual shader node able to perform different functions using vectors.
</description>
<tutorials>
</tutorials>
@@ -10,78 +12,114 @@
</methods>
<members>
<member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeVectorFunc.Function" default="0">
+ The function to be performed. See [enum Function] for options.
</member>
</members>
<constants>
<constant name="FUNC_NORMALIZE" value="0" enum="Function">
+ Normalizes the vector so that it has a length of [code]1[/code] but points in the same direction.
</constant>
<constant name="FUNC_SATURATE" value="1" enum="Function">
+ Clamps the value between [code]0.0[/code] and [code]1.0[/code].
</constant>
<constant name="FUNC_NEGATE" value="2" enum="Function">
+ Returns the opposite value of the parameter.
</constant>
<constant name="FUNC_RECIPROCAL" value="3" enum="Function">
+ Returns [code]1/vector[/code].
</constant>
<constant name="FUNC_RGB2HSV" value="4" enum="Function">
+ Converts RGB vector to HSV equivalent.
</constant>
<constant name="FUNC_HSV2RGB" value="5" enum="Function">
+ Converts HSV vector to RGB equivalent.
</constant>
<constant name="FUNC_ABS" value="6" enum="Function">
+ Returns the absolute value of the parameter.
</constant>
<constant name="FUNC_ACOS" value="7" enum="Function">
+ Returns the arc-cosine of the parameter.
</constant>
<constant name="FUNC_ACOSH" value="8" enum="Function">
+ Returns the inverse hyperbolic cosine of the parameter.
</constant>
<constant name="FUNC_ASIN" value="9" enum="Function">
+ Returns the arc-sine of the parameter.
</constant>
<constant name="FUNC_ASINH" value="10" enum="Function">
+ Returns the inverse hyperbolic sine of the parameter.
</constant>
<constant name="FUNC_ATAN" value="11" enum="Function">
+ Returns the arc-tangent of the parameter.
</constant>
<constant name="FUNC_ATANH" value="12" enum="Function">
+ Returns the inverse hyperbolic tangent of the parameter.
</constant>
<constant name="FUNC_CEIL" value="13" enum="Function">
+ Finds the nearest integer that is greater than or equal to the parameter.
</constant>
<constant name="FUNC_COS" value="14" enum="Function">
+ Returns the cosine of the parameter.
</constant>
<constant name="FUNC_COSH" value="15" enum="Function">
+ Returns the hyperbolic cosine of the parameter.
</constant>
<constant name="FUNC_DEGREES" value="16" enum="Function">
+ Converts a quantity in radians to degrees.
</constant>
<constant name="FUNC_EXP" value="17" enum="Function">
+ Base-e Exponential.
</constant>
<constant name="FUNC_EXP2" value="18" enum="Function">
+ Base-2 Exponential.
</constant>
<constant name="FUNC_FLOOR" value="19" enum="Function">
+ Finds the nearest integer less than or equal to the parameter.
</constant>
<constant name="FUNC_FRAC" value="20" enum="Function">
+ Computes the fractional part of the argument.
</constant>
<constant name="FUNC_INVERSE_SQRT" value="21" enum="Function">
+ Returns the inverse of the square root of the parameter.
</constant>
<constant name="FUNC_LOG" value="22" enum="Function">
+ Natural logarithm.
</constant>
<constant name="FUNC_LOG2" value="23" enum="Function">
+ Base-2 logarithm.
</constant>
<constant name="FUNC_RADIANS" value="24" enum="Function">
+ Converts a quantity in degrees to radians.
</constant>
<constant name="FUNC_ROUND" value="25" enum="Function">
+ Finds the nearest integer to the parameter.
</constant>
<constant name="FUNC_ROUNDEVEN" value="26" enum="Function">
+ Finds the nearest even integer to the parameter.
</constant>
<constant name="FUNC_SIGN" value="27" enum="Function">
+ Extracts the sign of the parameter, i.e. returns [code]-1[/code] if the parameter is negative, [code]1[/code] if it's positive and [code]0[/code] otherwise.
</constant>
<constant name="FUNC_SIN" value="28" enum="Function">
+ Returns the sine of the parameter.
</constant>
<constant name="FUNC_SINH" value="29" enum="Function">
+ Returns the hyperbolic sine of the parameter.
</constant>
<constant name="FUNC_SQRT" value="30" enum="Function">
+ Returns the square root of the parameter.
</constant>
<constant name="FUNC_TAN" value="31" enum="Function">
+ Returns the tangent of the parameter.
</constant>
<constant name="FUNC_TANH" value="32" enum="Function">
+ Returns the hyperbolic tangent of the parameter.
</constant>
<constant name="FUNC_TRUNC" value="33" enum="Function">
+ Returns a value equal to the nearest integer to the parameter whose absolute value is not larger than the absolute value of the parameter.
</constant>
<constant name="FUNC_ONEMINUS" value="34" enum="Function">
+ Returns [code]1.0 - vector[/code].
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeVectorInterp.xml b/doc/classes/VisualShaderNodeVectorInterp.xml
index 4d6d3ac577..b63d34b742 100644
--- a/doc/classes/VisualShaderNodeVectorInterp.xml
+++ b/doc/classes/VisualShaderNodeVectorInterp.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorInterp" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Linearly interpolates between two vectors within the visual shader graph.
</brief_description>
<description>
+ Translates to [code]mix(a, b, weight)[/code] in the shader language, where [code]weight[/code] is a [Vector3] with weights for each component.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorLen.xml b/doc/classes/VisualShaderNodeVectorLen.xml
index ade575310c..77261d3190 100644
--- a/doc/classes/VisualShaderNodeVectorLen.xml
+++ b/doc/classes/VisualShaderNodeVectorLen.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorLen" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Returns the length of a [Vector3] within the visual shader graph.
</brief_description>
<description>
+ Translated to [code]length(p0)[/code] in the shader language.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorOp.xml b/doc/classes/VisualShaderNodeVectorOp.xml
index 8c391d09a2..d56c012f8f 100644
--- a/doc/classes/VisualShaderNodeVectorOp.xml
+++ b/doc/classes/VisualShaderNodeVectorOp.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorOp" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ A vector operator to be used within the visual shader graph.
</brief_description>
<description>
+ A visual shader node for use of vector operators. Operates on vector [code]a[/code] and vector [code]b[/code].
</description>
<tutorials>
</tutorials>
@@ -10,32 +12,45 @@
</methods>
<members>
<member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeVectorOp.Operator" default="0">
+ The operator to be used. See [enum Operator] for options.
</member>
</members>
<constants>
<constant name="OP_ADD" value="0" enum="Operator">
+ Adds two vectors.
</constant>
<constant name="OP_SUB" value="1" enum="Operator">
+ Subtracts a vector from a vector.
</constant>
<constant name="OP_MUL" value="2" enum="Operator">
+ Multiplies two vectors.
</constant>
<constant name="OP_DIV" value="3" enum="Operator">
+ Divides vector by vector.
</constant>
<constant name="OP_MOD" value="4" enum="Operator">
+ Returns the remainder of the two vectors.
</constant>
<constant name="OP_POW" value="5" enum="Operator">
+ Returns the value of the first parameter raised to the power of the second, for each component of the vectors.
</constant>
<constant name="OP_MAX" value="6" enum="Operator">
+ Returns the greater of two values, for each component of the vectors.
</constant>
<constant name="OP_MIN" value="7" enum="Operator">
+ Returns the lesser of two values, for each component of the vectors.
</constant>
<constant name="OP_CROSS" value="8" enum="Operator">
+ Calculates the cross product of two vectors.
</constant>
<constant name="OP_ATAN2" value="9" enum="Operator">
+ Returns the arc-tangent of the parameters.
</constant>
<constant name="OP_REFLECT" value="10" enum="Operator">
+ Returns the vector that points in the direction of reflection. [code]a[/code] is incident vector and [code]b[/code] is the normal vector.
</constant>
<constant name="OP_STEP" value="11" enum="Operator">
+ Vector step operator. Returns [code]0.0[/code] if [code]a[/code] is smaller than [code]b[/code] and [code]1.0[/code] otherwise.
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeVectorRefract.xml b/doc/classes/VisualShaderNodeVectorRefract.xml
index c5962e7e10..178c35f49a 100644
--- a/doc/classes/VisualShaderNodeVectorRefract.xml
+++ b/doc/classes/VisualShaderNodeVectorRefract.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorRefract" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Returns the [Vector3] that points in the direction of refraction. For use within the visual shader graph.
</brief_description>
<description>
+ 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.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorScalarMix.xml b/doc/classes/VisualShaderNodeVectorScalarMix.xml
index c425bfe45e..791a9e6be1 100644
--- a/doc/classes/VisualShaderNodeVectorScalarMix.xml
+++ b/doc/classes/VisualShaderNodeVectorScalarMix.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorScalarMix" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Linearly interpolates between two vectors using a scalar. For use within the visual shader graph.
</brief_description>
<description>
+ 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.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorScalarSmoothStep.xml b/doc/classes/VisualShaderNodeVectorScalarSmoothStep.xml
index 2f341d71e0..580abaf5fe 100644
--- a/doc/classes/VisualShaderNodeVectorScalarSmoothStep.xml
+++ b/doc/classes/VisualShaderNodeVectorScalarSmoothStep.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorScalarSmoothStep" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Calculates a vector SmoothStep function using scalar within the visual shader graph.
</brief_description>
<description>
+ Translates to [code]smoothstep(edge0, edge1, x)[/code] in the shader language, where [code]x[/code] is a scalar.
+ 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.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorScalarStep.xml b/doc/classes/VisualShaderNodeVectorScalarStep.xml
index 11da106001..d61414f3a8 100644
--- a/doc/classes/VisualShaderNodeVectorScalarStep.xml
+++ b/doc/classes/VisualShaderNodeVectorScalarStep.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorScalarStep" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Calculates a vector Step function within the visual shader graph.
</brief_description>
<description>
+ Translates to [code]step(edge, x)[/code] in the shader language.
+ Returns [code]0.0[/code] if [code]x[/code] is smaller than [code]edge[/code] and [code]1.0[/code] otherwise.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorSmoothStep.xml b/doc/classes/VisualShaderNodeVectorSmoothStep.xml
index 54e9f1bd7d..1b77a3c535 100644
--- a/doc/classes/VisualShaderNodeVectorSmoothStep.xml
+++ b/doc/classes/VisualShaderNodeVectorSmoothStep.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorSmoothStep" inherits="VisualShaderNode" version="4.0">
<brief_description>
+ Calculates a vector SmoothStep function within the visual shader graph.
</brief_description>
<description>
+ Translates to [code]smoothstep(edge0, edge1, x)[/code] in the shader language, where [code]x[/code] is a vector.
+ 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.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index e1a0f1f22a..a0711b4214 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -362,6 +362,8 @@
<constant name="MODE_MAXIMIZED" value="2" enum="Mode">
</constant>
<constant name="MODE_FULLSCREEN" value="3" enum="Mode">
+ Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
+ Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
</constant>
<constant name="FLAG_RESIZE_DISABLED" value="0" enum="Flags">
</constant>
@@ -377,9 +379,9 @@
</constant>
<constant name="CONTENT_SCALE_MODE_DISABLED" value="0" enum="ContentScaleMode">
</constant>
- <constant name="CONTENT_SCALE_MODE_OBJECTS" value="1" enum="ContentScaleMode">
+ <constant name="CONTENT_SCALE_MODE_CANVAS_ITEMS" value="1" enum="ContentScaleMode">
</constant>
- <constant name="CONTENT_SCALE_MODE_PIXELS" value="2" enum="ContentScaleMode">
+ <constant name="CONTENT_SCALE_MODE_VIEWPORT" value="2" enum="ContentScaleMode">
</constant>
<constant name="CONTENT_SCALE_ASPECT_IGNORE" value="0" enum="ContentScaleAspect">
</constant>
diff --git a/doc/classes/World2D.xml b/doc/classes/World2D.xml
index 2d8382b7e3..25033cdb09 100644
--- a/doc/classes/World2D.xml
+++ b/doc/classes/World2D.xml
@@ -7,7 +7,7 @@
Class that has everything pertaining to a 2D world. A physics space, a visual scenario and a sound space. 2D nodes register their resources into the current 2D world.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
+ <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
</tutorials>
<methods>
</methods>
@@ -16,7 +16,7 @@
The [RID] of this world's canvas resource. Used by the [RenderingServer] for 2D drawing.
</member>
<member name="direct_space_state" type="PhysicsDirectSpaceState2D" setter="" getter="get_direct_space_state">
- The state of this world's physics space. This allows arbitrary querying for collision.
+ Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to [code]_physics_process(delta)[/code] in the main thread.
</member>
<member name="space" type="RID" setter="" getter="get_space">
The [RID] of this world's physics space resource. Used by the [PhysicsServer2D] for 2D physics, treating it as both a space and an area.
diff --git a/doc/classes/World3D.xml b/doc/classes/World3D.xml
index 4224a2a2c3..fe92077432 100644
--- a/doc/classes/World3D.xml
+++ b/doc/classes/World3D.xml
@@ -7,7 +7,7 @@
Class that has everything pertaining to a world. A physics space, a visual scenario and a sound space. Node3D nodes register their resources into the current world.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
+ <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
</tutorials>
<methods>
</methods>
@@ -15,7 +15,7 @@
<member name="camera_effects" type="CameraEffects" setter="set_camera_effects" getter="get_camera_effects">
</member>
<member name="direct_space_state" type="PhysicsDirectSpaceState3D" setter="" getter="get_direct_space_state">
- The World3D's physics direct space state, used for making various queries. Might be used only during [code]_physics_process[/code].
+ Direct access to the world's physics 3D space state. Used for querying current and potential collisions.
</member>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
The World3D's [Environment].
diff --git a/doc/classes/WorldEnvironment.xml b/doc/classes/WorldEnvironment.xml
index 92b75621c2..c1cf639ec0 100644
--- a/doc/classes/WorldEnvironment.xml
+++ b/doc/classes/WorldEnvironment.xml
@@ -9,7 +9,10 @@
The [WorldEnvironment] allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link>
+ <link title="Environment and post-processing">https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link>
+ <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
+ <link title="2D HDR Demo">https://godotengine.org/asset-library/asset/110</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/XRCamera3D.xml b/doc/classes/XRCamera3D.xml
index 4d86e24daa..b2682f7a90 100644
--- a/doc/classes/XRCamera3D.xml
+++ b/doc/classes/XRCamera3D.xml
@@ -8,7 +8,7 @@
The position and orientation of this node is automatically updated by the XR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the XR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the XRCamera3D can lag a few milliseconds behind what is used for rendering as a result.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
+ <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/XRController3D.xml b/doc/classes/XRController3D.xml
index e4a06a80db..c0f64d9e27 100644
--- a/doc/classes/XRController3D.xml
+++ b/doc/classes/XRController3D.xml
@@ -9,7 +9,7 @@
The position of the controller node is automatically updated by the [XRServer]. This makes this node ideal to add child nodes to visualize the controller.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
+ <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
</tutorials>
<methods>
<method name="get_controller_name" qualifiers="const">
@@ -62,7 +62,7 @@
<argument index="0" name="button" type="int">
</argument>
<description>
- Returns [code]true[/code] if the button at index [code]button[/code] is pressed. See [enum JoystickList], in particular the [code]JOY_VR_*[/code] constants.
+ Returns [code]true[/code] if the button at index [code]button[/code] is pressed. See [enum JoyButtonList].
</description>
</method>
</methods>
diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml
index 1985010223..034cb51be3 100644
--- a/doc/classes/XRInterface.xml
+++ b/doc/classes/XRInterface.xml
@@ -8,7 +8,7 @@
Interfaces should be written in such a way that simply enabling them will give us a working setup. You can query the available interfaces through [XRServer].
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
+ <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
</tutorials>
<methods>
<method name="get_camera_feed_id">
diff --git a/doc/classes/XROrigin3D.xml b/doc/classes/XROrigin3D.xml
index 57cf673d30..3e075e99b9 100644
--- a/doc/classes/XROrigin3D.xml
+++ b/doc/classes/XROrigin3D.xml
@@ -10,7 +10,7 @@
For example, if your character is driving a car, the XROrigin3D node should be a child node of this car. Or, if you're implementing a teleport system to move your character, you should change the position of this node.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
+ <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/XRPositionalTracker.xml b/doc/classes/XRPositionalTracker.xml
index 2f7cc21703..0b57c9478f 100644
--- a/doc/classes/XRPositionalTracker.xml
+++ b/doc/classes/XRPositionalTracker.xml
@@ -9,7 +9,7 @@
The [XRController3D] and [XRAnchor3D] both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDNative-based interfaces can interact with them.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
+ <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
</tutorials>
<methods>
<method name="get_hand" qualifiers="const">
diff --git a/doc/classes/XRServer.xml b/doc/classes/XRServer.xml
index 5e6002aee3..75a05bef17 100644
--- a/doc/classes/XRServer.xml
+++ b/doc/classes/XRServer.xml
@@ -7,7 +7,7 @@
The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing.
</description>
<tutorials>
- <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
+ <link title="VR tutorial index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
</tutorials>
<methods>
<method name="center_on_hmd">
diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml
index 4482a280b2..03e8bee7d5 100644
--- a/doc/classes/bool.xml
+++ b/doc/classes/bool.xml
@@ -4,67 +4,157 @@
Boolean built-in type.
</brief_description>
<description>
- Boolean is a built-in type. It can represent any data type that is either a true or false value. You can think of it as an switch with on or off (1 or 0) setting. It's often used as part of programming logic in condition statements like [code]if[/code] statements.
- [b]Note:[/b] In a code below [code]if can_shoot[/code] is equivalent of [code]if can_shoot == true[/code]. It is good practice to follow the natural spoken language structure when possible. Use [code]if can_shoot[/code] rather than [code]if can_shoot == true[/code] and use [code]if not can_shoot[/code] rather than [code]if can_shoot == false[/code].
- [codeblock]
- var can_shoot = true
+ Boolean is a built-in type. There are two boolean values: [code]true[/code] and [code]false[/code]. You can think of it as an switch with on or off (1 or 0) setting. Booleans are used in programming for logic in condition statements, like [code]if[/code] statements.
+ Booleans can be directly used in [code]if[/code] statements. The code below demonstrates this on the [code]if can_shoot:[/code] line. You don't need to use [code]== true[/code], you only need [code]if can_shoot:[/code]. Similarly, use [code]if not can_shoot:[/code] rather than [code]== false[/code].
+ [codeblocks]
+ [gdscript]
+ var _can_shoot = true
func shoot():
- if can_shoot:
- # Perform shooting actions here.
- [/codeblock]
+ if _can_shoot:
+ pass # Perform shooting actions here.
+ [/gdscript]
+ [csharp]
+ private bool _canShoot = true;
+
+ public void Shoot()
+ {
+ if (_canShoot)
+ {
+ // Perform shooting actions here.
+ }
+ }
+ [/csharp]
+ [/codeblocks]
The following code will only create a bullet if both conditions are met: action "shoot" is pressed and if [code]can_shoot[/code] is [code]true[/code].
[b]Note:[/b] [code]Input.is_action_pressed("shoot")[/code] is also a boolean that is [code]true[/code] when "shoot" is pressed and [code]false[/code] when "shoot" isn't pressed.
- [codeblock]
- var can_shoot = true
+ [codeblocks]
+ [gdscript]
+ var _can_shoot = true
func shoot():
- if can_shoot and Input.is_action_pressed("shoot"):
+ if _can_shoot and Input.is_action_pressed("shoot"):
create_bullet()
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ private bool _canShoot = true;
+
+ public void Shoot()
+ {
+ if (_canShoot &amp;&amp; Input.IsActionPressed("shoot"))
+ {
+ CreateBullet();
+ }
+ }
+ [/csharp]
+ [/codeblocks]
The following code will set [code]can_shoot[/code] to [code]false[/code] and start a timer. This will prevent player from shooting until the timer runs out. Next [code]can_shoot[/code] will be set to [code]true[/code] again allowing player to shoot once again.
- [codeblock]
- var can_shoot = true
- onready var cool_down = $CoolDownTimer
+ [gdscript]
+ var _can_shoot = true
+ onready var _cool_down = $CoolDownTimer
func shoot():
- if can_shoot and Input.is_action_pressed("shoot"):
+ if _can_shoot and Input.is_action_pressed("shoot"):
create_bullet()
- can_shoot = false
- cool_down.start()
+ _can_shoot = false
+ _cool_down.start()
func _on_CoolDownTimer_timeout():
- can_shoot = true
- [/codeblock]
+ _can_shoot = true
+ [/gdscript]
+ [csharp]
+ private bool _canShoot = true;
+ private Timer _coolDown;
+
+ public override void _Ready()
+ {
+ _coolDown = GetNode&lt;Timer&gt;("CoolDownTimer");
+ }
+
+ public void Shoot()
+ {
+ if (_canShoot &amp;&amp; Input.IsActionPressed("shoot"))
+ {
+ CreateBullet();
+ _canShoot = false;
+ _coolDown.Start();
+ }
+ }
+
+ public void OnCoolDownTimerTimeout()
+ {
+ _canShoot = true;
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
<methods>
- <method name="bool">
+ <method name="bool" qualifiers="constructor">
<return type="bool">
</return>
- <argument index="0" name="from" type="int">
+ <description>
+ Constructs a default-initialized [bool] set to [code]false[/code].
+ </description>
+ </method>
+ <method name="bool" qualifiers="constructor">
+ <return type="bool">
+ </return>
+ <argument index="0" name="from" type="bool">
</argument>
<description>
- Cast an [int] value to a boolean value, this method will return [code]true[/code] if called with an integer value different to 0 and [code]false[/code] in other case.
+ Constructs a [bool] as a copy of the given [bool].
</description>
</method>
- <method name="bool">
+ <method name="bool" qualifiers="constructor">
<return type="bool">
</return>
<argument index="0" name="from" type="float">
</argument>
<description>
- Cast a [float] value to a boolean value, this method will return [code]true[/code] if called with a floating-point value different to 0 and [code]false[/code] in other case.
+ Cast a [float] value to a boolean value, this method will return [code]false[/code] if [code]0.0[/code] is passed in, and [code]true[/code] for all other floats.
+ </description>
+ </method>
+ <method name="bool" qualifiers="constructor">
+ <return type="bool">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <description>
+ Cast an [int] value to a boolean value, this method will return [code]false[/code] if [code]0[/code] is passed in, and [code]true[/code] for all other ints.
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="bool">
+ </argument>
+ <description>
</description>
</method>
- <method name="bool">
+ <method name="operator &gt;" qualifiers="operator">
<return type="bool">
</return>
- <argument index="0" name="from" type="String">
+ <argument index="0" name="right" type="bool">
</argument>
<description>
- Cast a [String] value to a boolean value, this method will return [code]true[/code] if called with a non-empty string and [code]false[/code] in other case. Examples: [code]bool("False")[/code] returns [code]true[/code], [code]bool("")[/code] returns [code]false[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/float.xml b/doc/classes/float.xml
index 16a696f959..85fe31eec8 100644
--- a/doc/classes/float.xml
+++ b/doc/classes/float.xml
@@ -9,7 +9,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="float">
+ <method name="float" qualifiers="constructor">
+ <return type="float">
+ </return>
+ <description>
+ Constructs a default-initialized [float] set to [code]0.0[/code].
+ </description>
+ </method>
+ <method name="float" qualifiers="constructor">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <description>
+ Constructs a [float] as a copy of the given [float].
+ </description>
+ </method>
+ <method name="float" qualifiers="constructor">
<return type="float">
</return>
<argument index="0" name="from" type="bool">
@@ -18,22 +34,233 @@
Cast a [bool] value to a floating-point value, [code]float(true)[/code] will be equal to 1.0 and [code]float(false)[/code] will be equal to 0.0.
</description>
</method>
- <method name="float">
+ <method name="float" qualifiers="constructor">
<return type="float">
</return>
<argument index="0" name="from" type="int">
</argument>
<description>
- Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to 1.0.
+ Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to [code]1.0[/code].
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
</description>
</method>
- <method name="float">
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
<return type="float">
</return>
- <argument index="0" name="from" type="String">
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="Quat">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
</argument>
<description>
- Cast a [String] value to a floating-point value. This method accepts float value strings like [code]"1.23"[/code] and exponential notation strings for its parameter so calling [code]float("1e3")[/code] will return 1000.0 and calling [code]float("1e-3")[/code] will return 0.001. Calling this method with an invalid float string will return 0. This method stops parsing at the first invalid character and will return the parsed result so far, so calling [code]float("1a3")[/code] will return 1 while calling [code]float("1e3a2")[/code] will return 1000.0.
</description>
</method>
</methods>
diff --git a/doc/classes/int.xml b/doc/classes/int.xml
index 2c9f0ad371..5ac9f8405a 100644
--- a/doc/classes/int.xml
+++ b/doc/classes/int.xml
@@ -23,7 +23,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="int">
+ <method name="int" qualifiers="constructor">
+ <return type="int">
+ </return>
+ <description>
+ Constructs a default-initialized [int] set to [code]0[/code].
+ </description>
+ </method>
+ <method name="int" qualifiers="constructor">
+ <return type="int">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <description>
+ Constructs an [int] as a copy of the given [int].
+ </description>
+ </method>
+ <method name="int" qualifiers="constructor">
<return type="int">
</return>
<argument index="0" name="from" type="bool">
@@ -32,7 +48,7 @@
Cast a [bool] value to an integer value, [code]int(true)[/code] will be equals to 1 and [code]int(false)[/code] will be equals to 0.
</description>
</method>
- <method name="int">
+ <method name="int" qualifiers="constructor">
<return type="int">
</return>
<argument index="0" name="from" type="float">
@@ -41,13 +57,278 @@
Cast a float value to an integer value, this method simply removes the number fractions, so for example [code]int(2.7)[/code] will be equals to 2, [code]int(.1)[/code] will be equals to 0 and [code]int(-2.7)[/code] will be equals to -2.
</description>
</method>
- <method name="int">
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &amp;" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="Quat">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;&lt;" qualifiers="operator">
<return type="int">
</return>
- <argument index="0" name="from" type="String">
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
</argument>
<description>
- Cast a [String] value to an integer value, this method is an integer parser from a string, so calling this method with an invalid integer string will return 0, a valid string will be something like [code]'1.7'[/code]. This method will ignore all non-number characters, so calling [code]int('1e3')[/code] will return 13.
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;&gt;" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ^" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator |" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ~" qualifiers="operator">
+ <return type="int">
+ </return>
+ <description>
</description>
</method>
</methods>