From f6f6c1bf19b056c2fd289f5dda2dbf098a8cbe5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 5 Oct 2021 16:09:21 +0200 Subject: [PATCH] classref: Sync with latest 4.0-dev --- classes/class_@c#.rst | 13 - classes/class_@gdscript.rst | 1457 +--- classes/class_@globalscope.rst | 2298 +++++- classes/class_@nativescript.rst | 13 - classes/class_@visualscript.rst | 18 - classes/class_aabb.rst | 274 +- classes/class_acceptdialog.rst | 88 +- classes/class_aescontext.rst | 178 + classes/class_animatablebody2d.rst | 54 + classes/class_animatablebody3d.rst | 63 + ...dsprite.rst => class_animatedsprite2d.rst} | 163 +- classes/class_animatedsprite3d.rst | 33 +- classes/class_animatedtexture.rst | 86 +- classes/class_animation.rst | 351 +- classes/class_animationnode.rst | 208 +- classes/class_animationnodeadd2.rst | 8 +- classes/class_animationnodeadd3.rst | 10 +- classes/class_animationnodeanimation.rst | 16 +- classes/class_animationnodeblend2.rst | 12 +- classes/class_animationnodeblend3.rst | 8 +- classes/class_animationnodeblendspace1d.rst | 20 +- classes/class_animationnodeblendspace2d.rst | 86 +- classes/class_animationnodeblendtree.rst | 62 +- classes/class_animationnodeoneshot.rst | 14 +- classes/class_animationnodeoutput.rst | 12 +- classes/class_animationnodestatemachine.rst | 72 +- ...lass_animationnodestatemachineplayback.rst | 76 +- ...ss_animationnodestatemachinetransition.rst | 27 +- classes/class_animationnodetimescale.rst | 10 +- classes/class_animationnodetimeseek.rst | 35 +- classes/class_animationnodetransition.rst | 20 +- classes/class_animationplayer.rst | 136 +- classes/class_animationrootnode.rst | 8 +- classes/class_animationtrackeditplugin.rst | 8 +- classes/class_animationtree.rst | 83 +- classes/class_area.rst | 542 -- classes/class_area2d.rst | 256 +- classes/class_area3d.rst | 569 ++ classes/class_array.rst | 659 +- classes/class_arraymesh.rst | 317 +- classes/class_arvrcamera.rst | 27 - classes/class_arvrcontroller.rst | 180 - classes/class_arvrinterface.rst | 254 - classes/class_arvrinterfacegdnative.rst | 20 - classes/class_arvrpositionaltracker.rst | 188 - classes/class_arvrserver.rst | 283 - classes/class_aspectratiocontainer.rst | 147 + classes/class_astar.rst | 251 +- classes/class_astar2d.rst | 228 +- classes/class_atlastexture.rst | 60 +- classes/class_audiobuslayout.rst | 8 +- classes/class_audioeffect.rst | 15 +- classes/class_audioeffectamplify.rst | 8 +- classes/class_audioeffectbandlimitfilter.rst | 8 +- classes/class_audioeffectbandpassfilter.rst | 8 +- classes/class_audioeffectcapture.rst | 130 + classes/class_audioeffectchorus.rst | 32 +- classes/class_audioeffectcompressor.rst | 12 +- classes/class_audioeffectdelay.rst | 8 +- classes/class_audioeffectdistortion.rst | 17 +- classes/class_audioeffecteq.rst | 16 +- classes/class_audioeffecteq10.rst | 8 +- classes/class_audioeffecteq21.rst | 8 +- classes/class_audioeffecteq6.rst | 8 +- classes/class_audioeffectfilter.rst | 15 +- classes/class_audioeffecthighpassfilter.rst | 8 +- classes/class_audioeffecthighshelffilter.rst | 13 +- classes/class_audioeffectinstance.rst | 8 +- classes/class_audioeffectlimiter.rst | 8 +- classes/class_audioeffectlowpassfilter.rst | 8 +- classes/class_audioeffectlowshelffilter.rst | 13 +- classes/class_audioeffectnotchfilter.rst | 8 +- classes/class_audioeffectpanner.rst | 8 +- classes/class_audioeffectphaser.rst | 8 +- classes/class_audioeffectpitchshift.rst | 46 +- classes/class_audioeffectrecord.rst | 23 +- classes/class_audioeffectreverb.rst | 13 +- classes/class_audioeffectspectrumanalyzer.rst | 58 +- ...ss_audioeffectspectrumanalyzerinstance.rst | 16 +- classes/class_audioeffectstereoenhance.rst | 8 +- classes/class_audiolistener2d.rst | 66 + classes/class_audiolistener3d.rst | 74 + classes/class_audioserver.rst | 114 +- classes/class_audiostream.rst | 66 +- classes/class_audiostreamgenerator.rst | 29 +- .../class_audiostreamgeneratorplayback.rst | 39 +- classes/class_audiostreammicrophone.rst | 8 +- classes/class_audiostreammp3.rst | 86 + classes/class_audiostreamoggvorbis.rst | 57 +- classes/class_audiostreamplayback.rst | 75 +- .../class_audiostreamplaybackoggvorbis.rst | 21 + .../class_audiostreamplaybackresampled.rst | 10 +- classes/class_audiostreamplayer.rst | 42 +- classes/class_audiostreamplayer2d.rst | 36 +- classes/class_audiostreamplayer3d.rst | 88 +- classes/class_audiostreamrandompitch.rst | 8 +- classes/class_audiostreamsample.rst | 72 +- classes/class_backbuffercopy.rst | 34 +- classes/class_basebutton.rst | 164 +- classes/class_basematerial3d.rst | 1200 ++-- classes/class_basis.rst | 338 +- classes/class_bitmap.rst | 36 +- classes/class_bitmapfont.rst | 194 - classes/class_bone2d.rst | 146 +- classes/class_boneattachment.rst | 44 - classes/class_boneattachment3d.rst | 166 + classes/class_bool.rst | 188 +- classes/class_boxcontainer.rst | 14 +- classes/class_boxmesh.rst | 108 + classes/class_boxshape.rst | 44 - classes/class_boxshape3d.rst | 59 + .../class_bulletphysicsdirectbodystate.rst | 15 - classes/class_bulletphysicsserver.rst | 15 - classes/class_button.rst | 447 +- classes/class_buttongroup.rst | 25 +- classes/class_callable.rst | 203 +- classes/class_callbacktweener.rst | 49 + classes/class_camera.rst | 493 -- classes/class_camera2d.rst | 407 +- classes/class_camera3d.rst | 545 ++ classes/class_cameraeffects.rst | 75 +- classes/class_camerafeed.rst | 139 +- classes/class_cameraserver.rst | 20 +- classes/class_cameratexture.rst | 8 +- classes/class_canvasgroup.rst | 75 + classes/class_canvasitem.rst | 465 +- classes/class_canvasitemmaterial.rst | 14 +- classes/class_canvaslayer.rst | 110 +- classes/class_canvasmodulate.rst | 26 +- classes/class_canvastexture.rst | 133 + classes/class_capsulemesh.rst | 30 +- classes/class_capsuleshape.rst | 62 - classes/class_capsuleshape2d.rst | 12 +- classes/class_capsuleshape3d.rst | 73 + classes/class_centercontainer.rst | 6 + classes/class_characterbody2d.rst | 569 ++ classes/class_characterbody3d.rst | 548 ++ classes/class_charfxtransform.rst | 218 +- classes/class_checkbox.rst | 335 +- classes/class_checkbutton.rst | 343 +- classes/class_circleshape2d.rst | 8 +- classes/class_classdb.rst | 174 +- classes/class_clippedcamera.rst | 221 - classes/class_codeedit.rst | 1656 +++++ classes/class_codehighlighter.rst | 314 + classes/class_collisionobject.rst | 265 - classes/class_collisionobject2d.rst | 261 +- classes/class_collisionobject3d.rst | 392 + classes/class_collisionpolygon.rst | 82 - classes/class_collisionpolygon2d.rst | 42 +- classes/class_collisionpolygon3d.rst | 106 + classes/class_collisionshape.rst | 91 - classes/class_collisionshape2d.rst | 14 +- classes/class_collisionshape3d.rst | 103 + classes/class_color.rst | 1232 ++-- classes/class_colorpicker.rst | 267 +- classes/class_colorpickerbutton.rst | 250 +- classes/class_colorrect.rst | 44 +- classes/class_concavepolygonshape.rst | 48 - classes/class_concavepolygonshape2d.rst | 30 +- classes/class_concavepolygonshape3d.rst | 83 + ...stjoint.rst => class_conetwistjoint3d.rst} | 94 +- classes/class_configfile.rst | 191 +- classes/class_confirmationdialog.rst | 45 +- classes/class_container.rst | 14 +- classes/class_control.rst | 1712 +++-- classes/class_convexpolygonshape.rst | 44 - classes/class_convexpolygonshape2d.rst | 30 +- classes/class_convexpolygonshape3d.rst | 55 + classes/class_cpuparticles.rst | 1381 ---- classes/class_cpuparticles2d.rst | 1056 ++- classes/class_cpuparticles3d.rst | 1513 ++++ classes/class_crypto.rst | 149 +- classes/class_cryptokey.rst | 60 +- classes/class_csgbox.rst | 96 - classes/class_csgbox3d.rst | 66 + classes/class_csgcombiner.rst | 20 - classes/class_csgcombiner3d.rst | 26 + ...sgcylinder.rst => class_csgcylinder3d.rst} | 56 +- classes/class_csgmesh.rst | 58 - classes/class_csgmesh3d.rst | 66 + classes/class_csgpolygon.rst | 279 - classes/class_csgpolygon3d.rst | 351 + classes/class_csgprimitive.rst | 46 - classes/class_csgprimitive3d.rst | 52 + classes/class_csgshape.rst | 225 - classes/class_csgshape3d.rst | 231 + ...ss_csgsphere.rst => class_csgsphere3d.rst} | 48 +- ...lass_csgtorus.rst => class_csgtorus3d.rst} | 54 +- classes/class_csharpscript.rst | 30 +- classes/class_cubemap.rst | 17 +- classes/class_cubemaparray.rst | 8 +- classes/class_cubemesh.rst | 100 - classes/class_curve.rst | 40 +- classes/class_curve2d.rst | 118 +- classes/class_curve3d.rst | 154 +- classes/class_curvetexture.rst | 49 +- classes/class_curvexyztexture.rst | 85 + classes/class_cylindermesh.rst | 18 +- classes/class_cylindershape.rst | 62 - classes/class_cylindershape3d.rst | 77 + classes/class_dampedspringjoint2d.rst | 6 + classes/class_decal.rst | 393 + classes/class_dictionary.rst | 408 +- classes/class_directionallight.rst | 244 - classes/class_directionallight2d.rst | 61 + classes/class_directionallight3d.rst | 220 + classes/class_directory.rst | 73 +- classes/class_displayserver.rst | 1341 ++++ classes/class_dtlsserver.rst | 111 +- classes/class_dynamicfont.rst | 278 - classes/class_dynamicfontdata.rst | 99 - classes/class_editorcommandpalette.rst | 92 + classes/class_editordebuggerplugin.rst | 141 + classes/class_editorexportplugin.rst | 113 +- classes/class_editorfeatureprofile.rst | 71 +- classes/class_editorfiledialog.rst | 96 +- classes/class_editorfilesystem.rst | 26 +- classes/class_editorfilesystemdirectory.rst | 92 +- classes/class_editorimportplugin.rst | 248 +- classes/class_editorinspector.rst | 50 +- classes/class_editorinspectorplugin.rst | 141 +- classes/class_editorinterface.rst | 292 +- classes/class_editornode3dgizmo.rst | 280 + classes/class_editornode3dgizmoplugin.rst | 265 + classes/class_editorpaths.rst | 67 + classes/class_editorplugin.rst | 925 ++- classes/class_editorproperty.rst | 76 +- .../class_editorresourceconversionplugin.rst | 30 +- classes/class_editorresourcepicker.rst | 171 + classes/class_editorresourcepreview.rst | 16 +- .../class_editorresourcepreviewgenerator.rst | 56 +- classes/class_editorsceneimporter.rst | 74 +- classes/class_editorsceneimporterassimp.rst | 43 - classes/class_editorsceneimporterfbx.rst | 49 + classes/class_editorsceneimportergltf.rst | 21 + classes/class_editorscenepostimport.rst | 92 +- classes/class_editorscript.rst | 35 +- classes/class_editorscriptpicker.rst | 50 + classes/class_editorselection.rst | 14 +- classes/class_editorsettings.rst | 188 +- classes/class_editorspatialgizmo.rst | 194 - classes/class_editorspatialgizmoplugin.rst | 199 - classes/class_editorspinslider.rst | 47 +- classes/class_editorsyntaxhighlighter.rst | 54 + .../class_editortranslationparserplugin.rst | 167 + classes/class_editorvcsinterface.rst | 8 +- classes/class_encodedobjectasid.rst | 12 +- classes/class_enetconnection.rst | 294 + classes/class_enetmultiplayerpeer.rst | 151 + classes/class_enetpacketpeer.rst | 313 + classes/class_engine.rst | 295 +- classes/class_enginedebugger.rst | 150 + classes/class_environment.rst | 1390 ++-- classes/class_expression.rst | 77 +- classes/class_file.rst | 314 +- classes/class_filedialog.rst | 261 +- classes/class_filesystemdock.rst | 38 +- classes/class_float.rst | 325 +- classes/class_font.rst | 411 +- classes/class_fontdata.rst | 851 +++ classes/class_funcref.rst | 78 - classes/class_gdnative.rst | 8 +- classes/class_gdnativelibrary.rst | 28 +- classes/class_gdscript.rst | 24 +- classes/class_gdscriptfunctionstate.rst | 59 - classes/class_gdscriptnativeclass.rst | 29 - ...joint.rst => class_generic6dofjoint3d.rst} | 716 +- classes/class_geometry.rst | 463 -- classes/class_geometry2d.rst | 351 + classes/class_geometry3d.rst | 152 + classes/class_geometryinstance.rst | 283 - classes/class_geometryinstance3d.rst | 329 + classes/class_giprobe.rst | 138 - classes/class_gltfaccessor.rst | 251 + classes/class_gltfanimation.rst | 43 + classes/class_gltfbufferview.rst | 107 + classes/class_gltfcamera.rst | 91 + classes/class_gltfdocument.rst | 69 + classes/class_gltfdocumentextension.rst | 109 + ...tfdocumentextensionconvertimportermesh.rst | 21 + classes/class_gltflight.rst | 139 + classes/class_gltfmesh.rst | 57 + classes/class_gltfnode.rst | 235 + classes/class_gltfskeleton.rst | 121 + classes/class_gltfskin.rst | 191 + classes/class_gltfspecgloss.rst | 103 + classes/class_gltfstate.rst | 425 ++ classes/class_gltftexture.rst | 43 + classes/class_godotsharp.rst | 33 +- classes/class_gpuparticles2d.rst | 434 ++ classes/class_gpuparticles3d.rst | 617 ++ classes/class_gpuparticlesattractor3d.rst | 93 + classes/class_gpuparticlesattractorbox.rst | 43 + classes/class_gpuparticlesattractorsphere.rst | 43 + ...class_gpuparticlesattractorvectorfield.rst | 57 + classes/class_gpuparticlescollision3d.rst | 45 + classes/class_gpuparticlescollisionbox.rst | 43 + ...class_gpuparticlescollisionheightfield.rst | 156 + classes/class_gpuparticlescollisionsdf.rst | 124 + classes/class_gpuparticlescollisionsphere.rst | 43 + classes/class_gradient.rst | 78 +- classes/class_gradienttexture.rst | 36 +- classes/class_graphedit.rst | 545 +- classes/class_graphnode.rst | 493 +- classes/class_gridcontainer.rst | 54 +- classes/class_gridmap.rst | 224 +- classes/class_groovejoint2d.rst | 6 + classes/class_hashingcontext.rst | 46 +- classes/class_hboxcontainer.rst | 27 +- classes/class_heightmapshape.rst | 80 - classes/class_heightmapshape3d.rst | 86 + ..._hingejoint.rst => class_hingejoint3d.rst} | 160 +- classes/class_hmaccontext.rst | 114 + classes/class_hscrollbar.rst | 137 +- classes/class_hseparator.rst | 37 +- classes/class_hslider.rst | 91 +- classes/class_hsplitcontainer.rst | 63 +- classes/class_httpclient.rst | 98 +- classes/class_httprequest.rst | 210 +- classes/class_image.rst | 339 +- classes/class_imagetexture.rst | 79 +- classes/class_imagetexture3d.rst | 43 + classes/class_imagetexturelayered.rst | 45 + classes/class_immediategeometry.rst | 128 - classes/class_immediatemesh.rst | 132 + classes/class_importermesh.rst | 282 + classes/class_importermeshinstance3d.rst | 71 + classes/class_input.rst | 340 +- classes/class_inputdefault.rst | 20 - classes/class_inputevent.rst | 104 +- classes/class_inputeventaction.rst | 18 +- classes/class_inputeventfromwindow.rst | 45 + classes/class_inputeventgesture.rst | 16 +- classes/class_inputeventjoypadbutton.rst | 26 +- classes/class_inputeventjoypadmotion.rst | 22 +- classes/class_inputeventkey.rst | 58 +- classes/class_inputeventmagnifygesture.rst | 8 +- classes/class_inputeventmidi.rst | 44 +- classes/class_inputeventmouse.rst | 28 +- classes/class_inputeventmousebutton.rst | 48 +- classes/class_inputeventmousemotion.rst | 62 +- classes/class_inputeventpangesture.rst | 28 +- classes/class_inputeventscreendrag.rst | 44 +- classes/class_inputeventscreentouch.rst | 24 +- classes/class_inputeventshortcut.rst | 41 + classes/class_inputeventwithmodifiers.rst | 152 +- classes/class_inputmap.rst | 90 +- classes/class_instanceplaceholder.rst | 16 +- classes/class_int.rst | 463 +- classes/class_interpolatedcamera.rst | 98 - classes/class_intervaltweener.rst | 28 + classes/class_ip.rst | 48 +- classes/class_ip_unix.rst | 20 - classes/class_itemlist.rst | 621 +- classes/class_javaclass.rst | 8 +- classes/class_javaclasswrapper.rst | 6 + classes/class_javascript.rst | 62 +- classes/class_javascriptobject.rst | 56 + classes/class_jnisingleton.rst | 31 + classes/class_joint2d.rst | 8 +- .../{class_joint.rst => class_joint3d.rst} | 51 +- classes/class_json.rst | 119 +- classes/class_jsonparseresult.rst | 106 - classes/class_jsonrpc.rst | 79 +- classes/class_kinematicbody.rst | 263 - classes/class_kinematicbody2d.rst | 217 - classes/class_kinematiccollision.rst | 196 - classes/class_kinematiccollision2d.rst | 198 +- classes/class_kinematiccollision3d.rst | 164 + classes/class_label.rst | 452 +- classes/class_largetexture.rst | 108 - classes/class_light.rst | 390 - classes/class_light2d.rst | 254 +- classes/class_light3d.rst | 512 ++ classes/class_lightmapgi.rst | 332 + classes/class_lightmapgidata.rst | 95 + classes/class_lightmapper.rst | 23 + classes/class_lightmapperrd.rst | 21 + classes/class_lightmapprobe.rst | 21 + classes/class_lightoccluder2d.rst | 64 +- classes/class_line2d.rst | 107 +- classes/class_lineedit.rst | 850 ++- classes/class_lineshape2d.rst | 62 - classes/class_linkbutton.rst | 265 +- classes/class_listener.rst | 70 - classes/class_mainloop.rst | 269 +- classes/class_margincontainer.rst | 100 +- classes/class_marshalls.rst | 6 + classes/class_material.rst | 37 +- classes/class_menubutton.rst | 237 +- classes/class_mesh.rst | 323 +- classes/class_meshdatatool.rst | 144 +- classes/class_meshinstance.rst | 144 - classes/class_meshinstance2d.rst | 10 +- classes/class_meshinstance3d.rst | 185 + classes/class_meshlibrary.rst | 133 +- classes/class_meshtexture.rst | 24 +- classes/class_methodtweener.rst | 64 + classes/class_mobilevrinterface.rst | 14 +- classes/class_monogchandle.rst | 15 - classes/class_multimesh.rst | 108 +- classes/class_multimeshinstance.rst | 53 - classes/class_multimeshinstance2d.rst | 10 +- classes/class_multimeshinstance3d.rst | 59 + classes/class_multiplayerapi.rst | 247 +- classes/class_multiplayerpeer.rst | 240 + classes/class_multiplayerpeerextension.rst | 155 + classes/class_multiplayerpeergdnative.rst | 15 - classes/class_multiplayerreplicator.rst | 225 + classes/class_mutex.rst | 16 +- classes/class_nativeextension.rst | 90 + classes/class_nativeextensionmanager.rst | 102 + classes/class_nativescript.rst | 42 +- classes/class_navigation.rst | 140 - classes/class_navigation2d.rst | 102 - classes/class_navigation2dserver.rst | 296 - classes/class_navigationagent2d.rst | 58 +- ...nagent.rst => class_navigationagent3d.rst} | 200 +- classes/class_navigationmesh.rst | 292 +- classes/class_navigationmeshgenerator.rst | 6 + classes/class_navigationobstacle.rst | 46 - classes/class_navigationobstacle2d.rst | 34 +- classes/class_navigationobstacle3d.rst | 26 + classes/class_navigationpolygon.rst | 62 +- classes/class_navigationregion.rst | 93 - classes/class_navigationregion2d.rst | 37 + classes/class_navigationregion3d.rst | 119 + classes/class_navigationserver2d.rst | 376 + ...erver.rst => class_navigationserver3d.rst} | 374 +- classes/class_networkedmultiplayerenet.rst | 308 - classes/class_networkedmultiplayerpeer.rst | 216 - classes/class_ninepatchrect.rst | 100 +- classes/class_node.rst | 898 ++- classes/class_node2d.rst | 200 +- classes/class_node3d.rst | 583 ++ classes/class_node3dgizmo.rst | 23 + classes/class_nodepath.rst | 205 +- classes/class_noisetexture.rst | 79 +- classes/class_object.rst | 618 +- classes/class_occluder3d.rst | 59 + classes/class_occluderinstance3d.rst | 83 + classes/class_occluderpolygon2d.rst | 36 +- classes/class_oggpacketsequence.rst | 102 + classes/class_oggpacketsequenceplayback.rst | 21 + classes/class_omnilight.rst | 100 - classes/class_omnilight3d.rst | 106 + classes/class_opensimplexnoise.rst | 64 +- classes/class_optimizedtranslation.rst | 42 + classes/class_optionbutton.rst | 333 +- classes/class_ormmaterial3d.rst | 8 +- classes/class_os.rst | 1377 +--- classes/class_packedbytearray.rst | 544 +- classes/class_packedcolorarray.rst | 210 +- classes/class_packeddatacontainer.rst | 24 +- classes/class_packeddatacontainerref.rst | 18 +- classes/class_packedfloat32array.rst | 214 +- classes/class_packedfloat64array.rst | 214 +- classes/class_packedint32array.rst | 214 +- classes/class_packedint64array.rst | 214 +- classes/class_packedscene.rst | 137 +- classes/class_packedstringarray.rst | 213 +- classes/class_packedvector2array.rst | 221 +- classes/class_packedvector3array.rst | 218 +- classes/class_packetpeer.rst | 20 +- classes/class_packetpeerdtls.rst | 16 +- classes/class_packetpeerextension.rst | 59 + classes/class_packetpeergdnative.rst | 15 - classes/class_packetpeerstream.rst | 10 +- classes/class_packetpeerudp.rst | 125 +- classes/class_panel.rst | 75 +- classes/class_panelcontainer.rst | 32 +- classes/class_panoramaskymaterial.rst | 10 +- classes/class_parallaxbackground.rst | 46 +- classes/class_parallaxlayer.rst | 26 +- classes/class_particles.rst | 437 -- classes/class_particles2d.rst | 356 - classes/class_particlesmaterial.rst | 1292 ++-- classes/class_path.rst | 53 - classes/class_path2d.rst | 14 +- classes/class_path3d.rst | 59 + classes/class_pathfollow.rst | 185 - classes/class_pathfollow2d.rst | 28 +- classes/class_pathfollow3d.rst | 191 + classes/class_pckpacker.rst | 40 +- classes/class_performance.rst | 209 +- classes/class_phashtranslation.rst | 36 - classes/class_physicalbone.rst | 226 - classes/class_physicalbone2d.rst | 154 + classes/class_physicalbone3d.rst | 302 + classes/class_physicalskymaterial.rst | 106 +- classes/class_physics2ddirectbodystatesw.rst | 20 - classes/class_physics2dserversw.rst | 20 - .../class_physics2dshapequeryparameters.rst | 184 - classes/class_physics2dshapequeryresult.rst | 76 - classes/class_physics2dtestmotionresult.rst | 143 - classes/class_physicsbody.rst | 149 - classes/class_physicsbody2d.rst | 121 +- classes/class_physicsbody3d.rst | 239 + classes/class_physicsdirectbodystate.rst | 402 -- ...rst => class_physicsdirectbodystate2d.rst} | 232 +- classes/class_physicsdirectbodystate3d.rst | 425 ++ ...st => class_physicsdirectspacestate2d.rst} | 124 +- ...st => class_physicsdirectspacestate3d.rst} | 66 +- classes/class_physicsmaterial.rst | 14 +- classes/class_physicsserver.rst | 1773 ----- ...2dserver.rst => class_physicsserver2d.rst} | 1066 +-- classes/class_physicsserver3d.rst | 1889 +++++ classes/class_physicsshapequeryparameters.rst | 166 - .../class_physicsshapequeryparameters2d.rst | 223 + .../class_physicsshapequeryparameters3d.rst | 205 + classes/class_physicsshapequeryresult.rst | 76 - .../class_physicstestmotionparameters2d.rst | 142 + .../class_physicstestmotionparameters3d.rst | 160 + classes/class_physicstestmotionresult2d.rst | 162 + classes/class_physicstestmotionresult3d.rst | 172 + classes/class_pinjoint2d.rst | 10 +- ...lass_pinjoint.rst => class_pinjoint3d.rst} | 70 +- classes/class_plane.rst | 228 +- classes/class_planemesh.rst | 56 +- classes/class_pluginscript.rst | 16 +- classes/class_pointlight2d.rst | 97 + classes/class_pointmesh.rst | 8 +- classes/class_polygon2d.rst | 244 +- classes/class_polygonpathfinder.rst | 28 +- classes/class_popup.rst | 135 +- classes/class_popupdialog.rst | 27 - classes/class_popupmenu.rst | 743 +- classes/class_popuppanel.rst | 25 +- classes/class_position2d.rst | 6 + classes/class_position3d.rst | 10 +- classes/class_primitivemesh.rst | 69 +- classes/class_prismmesh.rst | 44 +- classes/class_proceduralskymaterial.rst | 128 +- classes/class_progressbar.rst | 129 +- classes/class_projectsettings.rst | 6324 ++++++++++++----- classes/class_propertytweener.rst | 109 + classes/class_proximitygroup.rst | 110 - classes/class_proximitygroup3d.rst | 116 + classes/class_proxytexture.rst | 8 +- classes/class_quadmesh.rst | 53 +- classes/class_quat.rst | 276 - classes/class_quaternion.rst | 406 ++ classes/class_randomnumbergenerator.rst | 88 +- classes/class_range.rst | 8 +- classes/class_raycast.rst | 293 - classes/class_raycast2d.rst | 152 +- classes/class_raycast3d.rst | 335 + classes/class_rayshape.rst | 62 - classes/class_rayshape2d.rst | 62 - classes/class_rdattachmentformat.rst | 75 + classes/class_rdframebufferpass.rst | 131 + classes/class_rdpipelinecolorblendstate.rst | 91 + ...ss_rdpipelinecolorblendstateattachment.rst | 217 + classes/class_rdpipelinedepthstencilstate.rst | 363 + classes/class_rdpipelinemultisamplestate.rst | 123 + .../class_rdpipelinerasterizationstate.rst | 203 + ...class_rdpipelinespecializationconstant.rst | 57 + classes/class_rdsamplerstate.rst | 267 + classes/class_rdshaderfile.rst | 73 + classes/class_rdshadersource.rst | 145 + classes/class_rdshaderspirv.rst | 225 + classes/class_rdtextureformat.rst | 193 + classes/class_rdtextureview.rst | 107 + classes/class_rduniform.rst | 89 + classes/class_rdvertexattribute.rst | 107 + classes/class_rect2.rst | 242 +- classes/class_rect2i.rst | 262 +- classes/class_rectangleshape2d.rst | 41 +- classes/class_refcounted.rst | 81 + classes/class_reference.rst | 68 - classes/class_referencerect.rst | 38 +- classes/class_reflectionprobe.rst | 210 +- classes/class_regex.rst | 82 +- classes/class_regexmatch.rst | 52 +- classes/class_remotetransform2d.rst | 6 + ...nsform.rst => class_remotetransform3d.rst} | 64 +- classes/class_renderingdevice.rst | 2760 +++++++ classes/class_renderingserver.rst | 6071 ++++++++++++++++ classes/class_resource.rst | 88 +- classes/class_resourceformatloader.rst | 99 +- classes/class_resourceformatloadercrypto.rst | 15 - classes/class_resourceformatsaver.rst | 38 +- classes/class_resourceformatsavercrypto.rst | 15 - classes/class_resourceimporter.rst | 33 +- classes/class_resourceloader.rst | 57 +- classes/class_resourcepreloader.rst | 18 +- classes/class_resourcesaver.rst | 8 +- classes/class_resourceuid.rst | 98 + classes/class_ribbontrailmesh.rst | 136 + classes/class_richtexteffect.rst | 32 +- classes/class_richtextlabel.rst | 971 ++- classes/class_rid.rst | 92 +- classes/class_rigidbody.rst | 609 -- classes/class_rigidbody2d.rst | 548 -- classes/class_rigiddynamicbody2d.rst | 653 ++ classes/class_rigiddynamicbody3d.rst | 619 ++ classes/class_rootmotionview.rst | 30 +- classes/class_scenestate.rst | 138 +- classes/class_scenetree.rst | 452 +- classes/class_scenetreetimer.rst | 24 +- classes/class_script.rst | 42 +- classes/class_scriptcreatedialog.rst | 48 +- classes/class_scripteditor.rst | 83 +- classes/class_scripteditorbase.rst | 107 + classes/class_scrollbar.rst | 20 +- classes/class_scrollcontainer.rst | 107 +- classes/class_segmentshape2d.rst | 46 +- classes/class_semaphore.rst | 10 +- classes/class_separationrayshape2d.rst | 70 + classes/class_separationrayshape3d.rst | 70 + classes/class_separator.rst | 6 + classes/class_shader.rst | 24 +- classes/class_shaderglobalsoverride.rst | 21 + classes/class_shadermaterial.rst | 18 +- classes/class_shape.rst | 51 - classes/class_shape2d.rst | 20 +- classes/class_shape3d.rst | 75 + classes/class_shortcut.rst | 76 +- classes/class_signal.rst | 124 +- classes/class_skeleton.rst | 311 - classes/class_skeleton2d.rst | 82 +- classes/class_skeleton3d.rst | 579 ++ classes/class_skeletonik.rst | 219 - classes/class_skeletonik3d.rst | 230 + classes/class_skeletonmodification2d.rst | 170 + classes/class_skeletonmodification2dccdik.rst | 240 + .../class_skeletonmodification2dfabrik.rst | 164 + .../class_skeletonmodification2djiggle.rst | 368 + .../class_skeletonmodification2dlookat.rst | 194 + ...ss_skeletonmodification2dphysicalbones.rst | 112 + ...lass_skeletonmodification2dstackholder.rst | 54 + .../class_skeletonmodification2dtwoboneik.rst | 192 + classes/class_skeletonmodification3d.rst | 140 + classes/class_skeletonmodification3dccdik.rst | 258 + .../class_skeletonmodification3dfabrik.rst | 294 + .../class_skeletonmodification3djiggle.rst | 388 + .../class_skeletonmodification3dlookat.rst | 154 + ...lass_skeletonmodification3dstackholder.rst | 54 + .../class_skeletonmodification3dtwoboneik.rst | 324 + classes/class_skeletonmodificationstack2d.rst | 188 + classes/class_skeletonmodificationstack3d.rst | 186 + classes/class_skin.rst | 62 +- classes/class_skinreference.rst | 22 +- classes/class_sky.rst | 20 +- classes/class_slider.rst | 34 +- ...liderjoint.rst => class_sliderjoint3d.rst} | 224 +- classes/class_softbody.rst | 331 - classes/class_softdynamicbody3d.rst | 362 + classes/class_spatial.rst | 547 -- classes/class_spatialgizmo.rst | 17 - classes/class_spatialvelocitytracker.rst | 67 - classes/class_spheremesh.rst | 8 +- classes/class_sphereshape.rst | 44 - classes/class_sphereshape3d.rst | 55 + classes/class_spinbox.rst | 76 +- classes/class_splitcontainer.rst | 6 + classes/class_spotlight.rst | 103 - classes/class_spotlight3d.rst | 113 + classes/class_springarm.rst | 156 - classes/class_springarm3d.rst | 162 + classes/class_sprite.rst | 360 - classes/class_sprite2d.rst | 324 + classes/class_sprite3d.rst | 80 +- classes/class_spritebase3d.rst | 124 +- classes/class_spriteframes.rst | 40 +- classes/class_standardmaterial3d.rst | 8 +- classes/class_staticbody.rst | 82 - classes/class_staticbody2d.rst | 40 +- classes/class_staticbody3d.rst | 105 + classes/class_streamcubemap.rst | 21 + classes/class_streamcubemaparray.rst | 21 + classes/class_streampeer.rst | 44 +- classes/class_streampeerbuffer.rst | 40 +- classes/class_streampeerextension.rst | 67 + classes/class_streampeergdnative.rst | 15 - classes/class_streampeerssl.rst | 14 +- classes/class_streampeertcp.rst | 52 +- ...mtexture.rst => class_streamtexture2d.rst} | 32 +- classes/class_streamtexture2darray.rst | 21 + classes/class_streamtexture3d.rst | 57 + classes/class_streamtexturelayered.rst | 59 + classes/class_string.rst | 1261 ++-- classes/class_stringname.rst | 72 +- classes/class_stylebox.rst | 72 +- classes/class_styleboxempty.rst | 8 +- classes/class_styleboxflat.rst | 190 +- classes/class_styleboxline.rst | 44 +- classes/class_styleboxtexture.rst | 143 +- classes/class_subviewport.rst | 183 + classes/class_subviewportcontainer.rst | 74 + classes/class_surfacetool.rst | 411 +- classes/class_syntaxhighlighter.rst | 131 + classes/class_tabcontainer.rst | 355 +- classes/class_tabs.rst | 475 +- classes/class_tcp_server.rst | 82 - classes/class_tcpserver.rst | 100 + classes/class_textedit.rst | 2336 ++++-- classes/class_textfile.rst | 15 - classes/class_textline.rst | 391 + classes/class_textparagraph.rst | 569 ++ classes/class_textserver.rst | 1359 +++- classes/class_textserveradvanced.rst | 21 + classes/class_textserverextension.rst | 1586 +++++ classes/class_textserverfallback.rst | 21 + classes/class_textservermanager.rst | 96 +- classes/class_texture.rst | 10 +- classes/class_texture2d.rst | 84 +- classes/class_texture2darray.rst | 8 +- classes/class_texture3d.rst | 77 + classes/class_texturebutton.rst | 49 + classes/class_texturelayered.rst | 85 +- classes/class_textureprogress.rst | 361 - classes/class_textureprogressbar.rst | 385 + classes/class_texturerect.rst | 37 +- classes/class_theme.rst | 685 +- classes/class_thread.rst | 48 +- classes/class_tiledata.rst | 438 ++ classes/class_tilemap.rst | 722 +- classes/class_tileset.rst | 999 +-- classes/class_tilesetatlassource.rst | 390 + .../class_tilesetscenescollectionsource.rst | 146 + classes/class_tilesetsource.rst | 106 + classes/class_time.rst | 357 + classes/class_timer.rst | 69 +- classes/class_toolbutton.rst | 59 - classes/class_touchscreenbutton.rst | 28 +- classes/class_transform.rst | 242 - classes/class_transform2d.rst | 351 +- classes/class_transform3d.rst | 298 + classes/class_translation.rst | 88 +- classes/class_translationserver.rst | 128 +- classes/class_tree.rst | 1034 ++- classes/class_treeitem.rst | 604 +- classes/class_trianglemesh.rst | 8 +- classes/class_tubetrailmesh.rst | 121 + classes/class_tween.rst | 534 +- classes/class_tweener.rst | 37 + classes/class_udpserver.rst | 161 +- classes/class_undoredo.rst | 111 +- classes/class_upnp.rst | 100 +- classes/class_upnpdevice.rst | 34 +- classes/class_variant.rst | 44 +- classes/class_vboxcontainer.rst | 32 +- classes/class_vector2.rst | 522 +- classes/class_vector2i.rst | 286 +- classes/class_vector3.rst | 526 +- classes/class_vector3i.rst | 312 +- classes/class_vehiclebody.rst | 90 - classes/class_vehiclebody3d.rst | 101 + ...iclewheel.rst => class_vehiclewheel3d.rst} | 149 +- classes/class_velocitytracker3d.rst | 73 + classes/class_videoplayer.rst | 46 +- classes/class_videostream.rst | 8 +- classes/class_videostreamgdnative.rst | 10 +- classes/class_videostreamtheora.rst | 14 +- classes/class_videostreamwebm.rst | 14 +- classes/class_viewport.rst | 972 ++- classes/class_viewportcontainer.rst | 66 - classes/class_viewporttexture.rst | 29 +- classes/class_visibilityenabler.rst | 109 - classes/class_visibilityenabler2d.rst | 197 - classes/class_visibilitynotifier.rst | 97 - classes/class_visibilitynotifier2d.rst | 97 - classes/class_visibleonscreenenabler2d.rst | 78 + classes/class_visibleonscreenenabler3d.rst | 89 + classes/class_visibleonscreennotifier2d.rst | 94 + classes/class_visibleonscreennotifier3d.rst | 91 + classes/class_visualinstance.rst | 126 - classes/class_visualinstance3d.rst | 132 + classes/class_visualscript.rst | 154 +- .../class_visualscriptbasictypeconstant.rst | 8 +- classes/class_visualscriptbuiltinfunc.rst | 98 +- classes/class_visualscriptclassconstant.rst | 16 +- classes/class_visualscriptcomment.rst | 36 +- classes/class_visualscriptcomposearray.rst | 8 +- classes/class_visualscriptcondition.rst | 8 +- classes/class_visualscriptconstant.rst | 8 +- classes/class_visualscriptconstructor.rst | 16 +- classes/class_visualscriptcustomnode.rst | 140 +- classes/class_visualscriptcustomnodes.rst | 61 + classes/class_visualscriptdeconstruct.rst | 8 +- classes/class_visualscripteditor.rst | 50 - classes/class_visualscriptemitsignal.rst | 12 +- classes/class_visualscriptenginesingleton.rst | 8 +- classes/class_visualscriptexpression.rst | 13 +- classes/class_visualscriptfunction.rst | 13 +- classes/class_visualscriptfunctioncall.rst | 61 +- classes/class_visualscriptfunctionstate.rst | 27 +- classes/class_visualscriptglobalconstant.rst | 15 +- classes/class_visualscriptindexget.rst | 13 +- classes/class_visualscriptindexset.rst | 13 +- classes/class_visualscriptinputaction.rst | 29 +- classes/class_visualscriptiterator.rst | 8 +- classes/class_visualscriptlists.rst | 26 +- classes/class_visualscriptlocalvar.rst | 12 +- classes/class_visualscriptlocalvarset.rst | 12 +- classes/class_visualscriptmathconstant.rst | 8 +- classes/class_visualscriptnode.rst | 16 +- classes/class_visualscriptoperator.rst | 14 +- classes/class_visualscriptpreload.rst | 8 +- classes/class_visualscriptpropertyget.rst | 45 +- classes/class_visualscriptpropertyset.rst | 67 +- classes/class_visualscriptresourcepath.rst | 8 +- classes/class_visualscriptreturn.rst | 8 +- classes/class_visualscriptscenenode.rst | 8 +- classes/class_visualscriptscenetree.rst | 13 +- classes/class_visualscriptselect.rst | 8 +- classes/class_visualscriptself.rst | 8 +- classes/class_visualscriptsequence.rst | 8 +- classes/class_visualscriptsubcall.rst | 25 +- classes/class_visualscriptswitch.rst | 8 +- classes/class_visualscripttypecast.rst | 21 +- classes/class_visualscriptvariableget.rst | 12 +- classes/class_visualscriptvariableset.rst | 12 +- classes/class_visualscriptwhile.rst | 8 +- classes/class_visualscriptyield.rst | 23 +- classes/class_visualscriptyieldsignal.rst | 35 +- classes/class_visualserver.rst | 4050 ----------- classes/class_visualshader.rst | 162 +- classes/class_visualshadernode.rst | 45 +- classes/class_visualshadernodebillboard.rst | 95 + .../class_visualshadernodebooleanconstant.rst | 8 +- .../class_visualshadernodebooleanuniform.rst | 50 +- classes/class_visualshadernodeclamp.rst | 73 + .../class_visualshadernodecolorconstant.rst | 28 +- classes/class_visualshadernodecolorfunc.rst | 12 +- classes/class_visualshadernodecolorop.rst | 12 +- .../class_visualshadernodecoloruniform.rst | 50 +- classes/class_visualshadernodecomment.rst | 68 + classes/class_visualshadernodecompare.rst | 20 +- classes/class_visualshadernodeconstant.rst | 23 + classes/class_visualshadernodecubemap.rst | 20 +- .../class_visualshadernodecubemapuniform.rst | 8 +- .../class_visualshadernodecurvetexture.rst | 48 + .../class_visualshadernodecurvexyztexture.rst | 48 + classes/class_visualshadernodecustom.rst | 94 +- classes/class_visualshadernodedeterminant.rst | 12 +- classes/class_visualshadernodedotproduct.rst | 8 +- classes/class_visualshadernodeexpression.rst | 10 +- classes/class_visualshadernodefaceforward.rst | 10 +- .../class_visualshadernodefloatconstant.rst | 8 +- classes/class_visualshadernodefloatfunc.rst | 12 +- classes/class_visualshadernodefloatop.rst | 12 +- .../class_visualshadernodefloatuniform.rst | 66 +- classes/class_visualshadernodefresnel.rst | 8 +- ...class_visualshadernodeglobalexpression.rst | 8 +- classes/class_visualshadernodegroupbase.rst | 72 +- classes/class_visualshadernodeif.rst | 10 +- classes/class_visualshadernodeinput.rst | 30 +- classes/class_visualshadernodeintconstant.rst | 8 +- classes/class_visualshadernodeintfunc.rst | 22 +- classes/class_visualshadernodeintop.rst | 12 +- classes/class_visualshadernodeintuniform.rst | 66 +- classes/class_visualshadernodeis.rst | 23 +- classes/class_visualshadernodemix.rst | 73 + classes/class_visualshadernodemultiplyadd.rst | 69 + .../class_visualshadernodeouterproduct.rst | 13 +- classes/class_visualshadernodeoutput.rst | 15 +- ...ss_visualshadernodeparticleaccelerator.rst | 66 + ...ass_visualshadernodeparticleboxemitter.rst | 21 + ...s_visualshadernodeparticleconevelocity.rst | 21 + .../class_visualshadernodeparticleemit.rst | 70 + .../class_visualshadernodeparticleemitter.rst | 23 + ...lshadernodeparticlemultiplybyaxisangle.rst | 43 + .../class_visualshadernodeparticleoutput.rst | 21 + ...ass_visualshadernodeparticlerandomness.rst | 62 + ...ss_visualshadernodeparticleringemitter.rst | 21 + ..._visualshadernodeparticlesphereemitter.rst | 21 + .../class_visualshadernoderesizablebase.rst | 52 + classes/class_visualshadernodesample3d.rst | 71 + classes/class_visualshadernodescalarclamp.rst | 15 - ...s_visualshadernodescalarderivativefunc.rst | 25 +- .../class_visualshadernodescalarinterp.rst | 15 - ...class_visualshadernodescalarsmoothstep.rst | 15 - .../class_visualshadernodescalarswitch.rst | 15 - .../class_visualshadernodescreenuvtosdf.rst | 26 + classes/class_visualshadernodesdfraymarch.rst | 26 + .../class_visualshadernodesdftoscreenuv.rst | 26 + classes/class_visualshadernodesmoothstep.rst | 75 + classes/class_visualshadernodestep.rst | 75 + classes/class_visualshadernodeswitch.rst | 68 +- classes/class_visualshadernodetexture.rst | 47 +- .../class_visualshadernodetexture2darray.rst | 48 + ..._visualshadernodetexture2darrayuniform.rst | 21 + classes/class_visualshadernodetexture3d.rst | 48 + ...class_visualshadernodetexture3duniform.rst | 26 + classes/class_visualshadernodetexturesdf.rst | 26 + ...class_visualshadernodetexturesdfnormal.rst | 26 + .../class_visualshadernodetextureuniform.rst | 41 +- ...isualshadernodetextureuniformtriplanar.rst | 13 +- ...class_visualshadernodetransformcompose.rst | 13 +- ...lass_visualshadernodetransformconstant.rst | 25 +- ...ass_visualshadernodetransformdecompose.rst | 13 +- .../class_visualshadernodetransformfunc.rst | 23 +- .../class_visualshadernodetransformmult.rst | 60 - classes/class_visualshadernodetransformop.rst | 97 + ...class_visualshadernodetransformuniform.rst | 55 +- ...class_visualshadernodetransformvecmult.rst | 27 +- classes/class_visualshadernodeuniform.rst | 60 +- classes/class_visualshadernodeuniformref.rst | 50 + classes/class_visualshadernodeuvfunc.rst | 64 + .../class_visualshadernodevec3constant.rst | 35 +- classes/class_visualshadernodevec3uniform.rst | 55 +- classes/class_visualshadernodevectorclamp.rst | 15 - .../class_visualshadernodevectorcompose.rst | 13 +- .../class_visualshadernodevectordecompose.rst | 13 +- ...s_visualshadernodevectorderivativefunc.rst | 25 +- .../class_visualshadernodevectordistance.rst | 15 +- classes/class_visualshadernodevectorfunc.rst | 89 +- .../class_visualshadernodevectorinterp.rst | 15 - classes/class_visualshadernodevectorlen.rst | 13 +- classes/class_visualshadernodevectorop.rst | 43 +- .../class_visualshadernodevectorrefract.rst | 13 +- .../class_visualshadernodevectorscalarmix.rst | 15 - ...visualshadernodevectorscalarsmoothstep.rst | 15 - ...class_visualshadernodevectorscalarstep.rst | 15 - ...class_visualshadernodevectorsmoothstep.rst | 15 - classes/class_voxelgi.rst | 148 + ..._giprobedata.rst => class_voxelgidata.rst} | 169 +- classes/class_vscrollbar.rst | 147 +- classes/class_vseparator.rst | 37 +- classes/class_vslider.rst | 101 +- classes/class_vsplitcontainer.rst | 63 +- classes/class_weakref.rst | 18 +- classes/class_webrtcdatachannel.rst | 84 +- classes/class_webrtcdatachannelextension.rst | 171 + classes/class_webrtcdatachannelgdnative.rst | 15 - classes/class_webrtcmultiplayer.rst | 115 - classes/class_webrtcmultiplayerpeer.rst | 116 + classes/class_webrtcpeerconnection.rst | 32 +- .../class_webrtcpeerconnectionextension.rst | 107 + .../class_webrtcpeerconnectiongdnative.rst | 15 - classes/class_websocketclient.rst | 42 +- classes/class_websocketmultiplayerpeer.rst | 23 +- classes/class_websocketpeer.rst | 38 +- classes/class_websocketserver.rst | 96 +- classes/class_webxrinterface.rst | 432 ++ classes/class_window.rst | 1111 +++ classes/class_windowdialog.rst | 103 - classes/class_world.rst | 119 - classes/class_world2d.rst | 32 +- classes/class_world3d.rst | 139 + classes/class_worldboundaryshape2d.rst | 68 + classes/class_worldboundaryshape3d.rst | 50 + classes/class_worldenvironment.rst | 14 +- classes/class_worldmarginshape.rst | 44 - classes/class_x509certificate.rst | 8 +- classes/class_xmlparser.rst | 102 +- ...ss_arvranchor.rst => class_xranchor3d.rst} | 66 +- classes/class_xrcamera3d.rst | 33 + classes/class_xrcontroller3d.rst | 186 + classes/class_xrinterface.rst | 252 + classes/class_xrinterfaceextension.rst | 186 + ...ss_arvrorigin.rst => class_xrorigin3d.rst} | 24 +- classes/class_xrpositionaltracker.rst | 194 + classes/class_xrserver.rst | 329 + classes/class_ysort.rst | 46 - 958 files changed, 113054 insertions(+), 52009 deletions(-) delete mode 100644 classes/class_@c#.rst delete mode 100644 classes/class_@nativescript.rst delete mode 100644 classes/class_@visualscript.rst create mode 100644 classes/class_aescontext.rst create mode 100644 classes/class_animatablebody2d.rst create mode 100644 classes/class_animatablebody3d.rst rename classes/{class_animatedsprite.rst => class_animatedsprite2d.rst} (54%) delete mode 100644 classes/class_area.rst create mode 100644 classes/class_area3d.rst delete mode 100644 classes/class_arvrcamera.rst delete mode 100644 classes/class_arvrcontroller.rst delete mode 100644 classes/class_arvrinterface.rst delete mode 100644 classes/class_arvrinterfacegdnative.rst delete mode 100644 classes/class_arvrpositionaltracker.rst delete mode 100644 classes/class_arvrserver.rst create mode 100644 classes/class_aspectratiocontainer.rst create mode 100644 classes/class_audioeffectcapture.rst create mode 100644 classes/class_audiolistener2d.rst create mode 100644 classes/class_audiolistener3d.rst create mode 100644 classes/class_audiostreammp3.rst create mode 100644 classes/class_audiostreamplaybackoggvorbis.rst delete mode 100644 classes/class_bitmapfont.rst delete mode 100644 classes/class_boneattachment.rst create mode 100644 classes/class_boneattachment3d.rst create mode 100644 classes/class_boxmesh.rst delete mode 100644 classes/class_boxshape.rst create mode 100644 classes/class_boxshape3d.rst delete mode 100644 classes/class_bulletphysicsdirectbodystate.rst delete mode 100644 classes/class_bulletphysicsserver.rst create mode 100644 classes/class_callbacktweener.rst delete mode 100644 classes/class_camera.rst create mode 100644 classes/class_camera3d.rst create mode 100644 classes/class_canvasgroup.rst create mode 100644 classes/class_canvastexture.rst delete mode 100644 classes/class_capsuleshape.rst create mode 100644 classes/class_capsuleshape3d.rst create mode 100644 classes/class_characterbody2d.rst create mode 100644 classes/class_characterbody3d.rst delete mode 100644 classes/class_clippedcamera.rst create mode 100644 classes/class_codeedit.rst create mode 100644 classes/class_codehighlighter.rst delete mode 100644 classes/class_collisionobject.rst create mode 100644 classes/class_collisionobject3d.rst delete mode 100644 classes/class_collisionpolygon.rst create mode 100644 classes/class_collisionpolygon3d.rst delete mode 100644 classes/class_collisionshape.rst create mode 100644 classes/class_collisionshape3d.rst delete mode 100644 classes/class_concavepolygonshape.rst create mode 100644 classes/class_concavepolygonshape3d.rst rename classes/{class_conetwistjoint.rst => class_conetwistjoint3d.rst} (57%) delete mode 100644 classes/class_convexpolygonshape.rst create mode 100644 classes/class_convexpolygonshape3d.rst delete mode 100644 classes/class_cpuparticles.rst create mode 100644 classes/class_cpuparticles3d.rst delete mode 100644 classes/class_csgbox.rst create mode 100644 classes/class_csgbox3d.rst delete mode 100644 classes/class_csgcombiner.rst create mode 100644 classes/class_csgcombiner3d.rst rename classes/{class_csgcylinder.rst => class_csgcylinder3d.rst} (61%) delete mode 100644 classes/class_csgmesh.rst create mode 100644 classes/class_csgmesh3d.rst delete mode 100644 classes/class_csgpolygon.rst create mode 100644 classes/class_csgpolygon3d.rst delete mode 100644 classes/class_csgprimitive.rst create mode 100644 classes/class_csgprimitive3d.rst delete mode 100644 classes/class_csgshape.rst create mode 100644 classes/class_csgshape3d.rst rename classes/{class_csgsphere.rst => class_csgsphere3d.rst} (58%) rename classes/{class_csgtorus.rst => class_csgtorus3d.rst} (61%) delete mode 100644 classes/class_cubemesh.rst create mode 100644 classes/class_curvexyztexture.rst delete mode 100644 classes/class_cylindershape.rst create mode 100644 classes/class_cylindershape3d.rst create mode 100644 classes/class_decal.rst delete mode 100644 classes/class_directionallight.rst create mode 100644 classes/class_directionallight2d.rst create mode 100644 classes/class_directionallight3d.rst create mode 100644 classes/class_displayserver.rst delete mode 100644 classes/class_dynamicfont.rst delete mode 100644 classes/class_dynamicfontdata.rst create mode 100644 classes/class_editorcommandpalette.rst create mode 100644 classes/class_editordebuggerplugin.rst create mode 100644 classes/class_editornode3dgizmo.rst create mode 100644 classes/class_editornode3dgizmoplugin.rst create mode 100644 classes/class_editorpaths.rst create mode 100644 classes/class_editorresourcepicker.rst delete mode 100644 classes/class_editorsceneimporterassimp.rst create mode 100644 classes/class_editorsceneimporterfbx.rst create mode 100644 classes/class_editorsceneimportergltf.rst create mode 100644 classes/class_editorscriptpicker.rst delete mode 100644 classes/class_editorspatialgizmo.rst delete mode 100644 classes/class_editorspatialgizmoplugin.rst create mode 100644 classes/class_editorsyntaxhighlighter.rst create mode 100644 classes/class_editortranslationparserplugin.rst create mode 100644 classes/class_enetconnection.rst create mode 100644 classes/class_enetmultiplayerpeer.rst create mode 100644 classes/class_enetpacketpeer.rst create mode 100644 classes/class_enginedebugger.rst create mode 100644 classes/class_fontdata.rst delete mode 100644 classes/class_funcref.rst delete mode 100644 classes/class_gdscriptfunctionstate.rst delete mode 100644 classes/class_gdscriptnativeclass.rst rename classes/{class_generic6dofjoint.rst => class_generic6dofjoint3d.rst} (69%) delete mode 100644 classes/class_geometry.rst create mode 100644 classes/class_geometry2d.rst create mode 100644 classes/class_geometry3d.rst delete mode 100644 classes/class_geometryinstance.rst create mode 100644 classes/class_geometryinstance3d.rst delete mode 100644 classes/class_giprobe.rst create mode 100644 classes/class_gltfaccessor.rst create mode 100644 classes/class_gltfanimation.rst create mode 100644 classes/class_gltfbufferview.rst create mode 100644 classes/class_gltfcamera.rst create mode 100644 classes/class_gltfdocument.rst create mode 100644 classes/class_gltfdocumentextension.rst create mode 100644 classes/class_gltfdocumentextensionconvertimportermesh.rst create mode 100644 classes/class_gltflight.rst create mode 100644 classes/class_gltfmesh.rst create mode 100644 classes/class_gltfnode.rst create mode 100644 classes/class_gltfskeleton.rst create mode 100644 classes/class_gltfskin.rst create mode 100644 classes/class_gltfspecgloss.rst create mode 100644 classes/class_gltfstate.rst create mode 100644 classes/class_gltftexture.rst create mode 100644 classes/class_gpuparticles2d.rst create mode 100644 classes/class_gpuparticles3d.rst create mode 100644 classes/class_gpuparticlesattractor3d.rst create mode 100644 classes/class_gpuparticlesattractorbox.rst create mode 100644 classes/class_gpuparticlesattractorsphere.rst create mode 100644 classes/class_gpuparticlesattractorvectorfield.rst create mode 100644 classes/class_gpuparticlescollision3d.rst create mode 100644 classes/class_gpuparticlescollisionbox.rst create mode 100644 classes/class_gpuparticlescollisionheightfield.rst create mode 100644 classes/class_gpuparticlescollisionsdf.rst create mode 100644 classes/class_gpuparticlescollisionsphere.rst delete mode 100644 classes/class_heightmapshape.rst create mode 100644 classes/class_heightmapshape3d.rst rename classes/{class_hingejoint.rst => class_hingejoint3d.rst} (53%) create mode 100644 classes/class_hmaccontext.rst create mode 100644 classes/class_imagetexture3d.rst create mode 100644 classes/class_imagetexturelayered.rst delete mode 100644 classes/class_immediategeometry.rst create mode 100644 classes/class_immediatemesh.rst create mode 100644 classes/class_importermesh.rst create mode 100644 classes/class_importermeshinstance3d.rst delete mode 100644 classes/class_inputdefault.rst create mode 100644 classes/class_inputeventfromwindow.rst create mode 100644 classes/class_inputeventshortcut.rst delete mode 100644 classes/class_interpolatedcamera.rst create mode 100644 classes/class_intervaltweener.rst delete mode 100644 classes/class_ip_unix.rst create mode 100644 classes/class_javascriptobject.rst create mode 100644 classes/class_jnisingleton.rst rename classes/{class_joint.rst => class_joint3d.rst} (55%) delete mode 100644 classes/class_jsonparseresult.rst delete mode 100644 classes/class_kinematicbody.rst delete mode 100644 classes/class_kinematicbody2d.rst delete mode 100644 classes/class_kinematiccollision.rst create mode 100644 classes/class_kinematiccollision3d.rst delete mode 100644 classes/class_largetexture.rst delete mode 100644 classes/class_light.rst create mode 100644 classes/class_light3d.rst create mode 100644 classes/class_lightmapgi.rst create mode 100644 classes/class_lightmapgidata.rst create mode 100644 classes/class_lightmapper.rst create mode 100644 classes/class_lightmapperrd.rst create mode 100644 classes/class_lightmapprobe.rst delete mode 100644 classes/class_lineshape2d.rst delete mode 100644 classes/class_listener.rst delete mode 100644 classes/class_meshinstance.rst create mode 100644 classes/class_meshinstance3d.rst create mode 100644 classes/class_methodtweener.rst delete mode 100644 classes/class_monogchandle.rst delete mode 100644 classes/class_multimeshinstance.rst create mode 100644 classes/class_multimeshinstance3d.rst create mode 100644 classes/class_multiplayerpeer.rst create mode 100644 classes/class_multiplayerpeerextension.rst delete mode 100644 classes/class_multiplayerpeergdnative.rst create mode 100644 classes/class_multiplayerreplicator.rst create mode 100644 classes/class_nativeextension.rst create mode 100644 classes/class_nativeextensionmanager.rst delete mode 100644 classes/class_navigation.rst delete mode 100644 classes/class_navigation2d.rst delete mode 100644 classes/class_navigation2dserver.rst rename classes/{class_navigationagent.rst => class_navigationagent3d.rst} (59%) delete mode 100644 classes/class_navigationobstacle.rst create mode 100644 classes/class_navigationobstacle3d.rst delete mode 100644 classes/class_navigationregion.rst create mode 100644 classes/class_navigationregion3d.rst create mode 100644 classes/class_navigationserver2d.rst rename classes/{class_navigationserver.rst => class_navigationserver3d.rst} (54%) delete mode 100644 classes/class_networkedmultiplayerenet.rst delete mode 100644 classes/class_networkedmultiplayerpeer.rst create mode 100644 classes/class_node3d.rst create mode 100644 classes/class_node3dgizmo.rst create mode 100644 classes/class_occluder3d.rst create mode 100644 classes/class_occluderinstance3d.rst create mode 100644 classes/class_oggpacketsequence.rst create mode 100644 classes/class_oggpacketsequenceplayback.rst delete mode 100644 classes/class_omnilight.rst create mode 100644 classes/class_omnilight3d.rst create mode 100644 classes/class_optimizedtranslation.rst create mode 100644 classes/class_packetpeerextension.rst delete mode 100644 classes/class_packetpeergdnative.rst delete mode 100644 classes/class_particles.rst delete mode 100644 classes/class_particles2d.rst delete mode 100644 classes/class_path.rst create mode 100644 classes/class_path3d.rst delete mode 100644 classes/class_pathfollow.rst create mode 100644 classes/class_pathfollow3d.rst delete mode 100644 classes/class_phashtranslation.rst delete mode 100644 classes/class_physicalbone.rst create mode 100644 classes/class_physicalbone2d.rst create mode 100644 classes/class_physicalbone3d.rst delete mode 100644 classes/class_physics2ddirectbodystatesw.rst delete mode 100644 classes/class_physics2dserversw.rst delete mode 100644 classes/class_physics2dshapequeryparameters.rst delete mode 100644 classes/class_physics2dshapequeryresult.rst delete mode 100644 classes/class_physics2dtestmotionresult.rst delete mode 100644 classes/class_physicsbody.rst create mode 100644 classes/class_physicsbody3d.rst delete mode 100644 classes/class_physicsdirectbodystate.rst rename classes/{class_physics2ddirectbodystate.rst => class_physicsdirectbodystate2d.rst} (56%) create mode 100644 classes/class_physicsdirectbodystate3d.rst rename classes/{class_physics2ddirectspacestate.rst => class_physicsdirectspacestate2d.rst} (57%) rename classes/{class_physicsdirectspacestate.rst => class_physicsdirectspacestate3d.rst} (52%) delete mode 100644 classes/class_physicsserver.rst rename classes/{class_physics2dserver.rst => class_physicsserver2d.rst} (58%) create mode 100644 classes/class_physicsserver3d.rst delete mode 100644 classes/class_physicsshapequeryparameters.rst create mode 100644 classes/class_physicsshapequeryparameters2d.rst create mode 100644 classes/class_physicsshapequeryparameters3d.rst delete mode 100644 classes/class_physicsshapequeryresult.rst create mode 100644 classes/class_physicstestmotionparameters2d.rst create mode 100644 classes/class_physicstestmotionparameters3d.rst create mode 100644 classes/class_physicstestmotionresult2d.rst create mode 100644 classes/class_physicstestmotionresult3d.rst rename classes/{class_pinjoint.rst => class_pinjoint3d.rst} (51%) create mode 100644 classes/class_pointlight2d.rst delete mode 100644 classes/class_popupdialog.rst create mode 100644 classes/class_propertytweener.rst delete mode 100644 classes/class_proximitygroup.rst create mode 100644 classes/class_proximitygroup3d.rst delete mode 100644 classes/class_quat.rst create mode 100644 classes/class_quaternion.rst delete mode 100644 classes/class_raycast.rst create mode 100644 classes/class_raycast3d.rst delete mode 100644 classes/class_rayshape.rst delete mode 100644 classes/class_rayshape2d.rst create mode 100644 classes/class_rdattachmentformat.rst create mode 100644 classes/class_rdframebufferpass.rst create mode 100644 classes/class_rdpipelinecolorblendstate.rst create mode 100644 classes/class_rdpipelinecolorblendstateattachment.rst create mode 100644 classes/class_rdpipelinedepthstencilstate.rst create mode 100644 classes/class_rdpipelinemultisamplestate.rst create mode 100644 classes/class_rdpipelinerasterizationstate.rst create mode 100644 classes/class_rdpipelinespecializationconstant.rst create mode 100644 classes/class_rdsamplerstate.rst create mode 100644 classes/class_rdshaderfile.rst create mode 100644 classes/class_rdshadersource.rst create mode 100644 classes/class_rdshaderspirv.rst create mode 100644 classes/class_rdtextureformat.rst create mode 100644 classes/class_rdtextureview.rst create mode 100644 classes/class_rduniform.rst create mode 100644 classes/class_rdvertexattribute.rst create mode 100644 classes/class_refcounted.rst delete mode 100644 classes/class_reference.rst rename classes/{class_remotetransform.rst => class_remotetransform3d.rst} (54%) create mode 100644 classes/class_renderingserver.rst delete mode 100644 classes/class_resourceformatloadercrypto.rst delete mode 100644 classes/class_resourceformatsavercrypto.rst create mode 100644 classes/class_resourceuid.rst create mode 100644 classes/class_ribbontrailmesh.rst delete mode 100644 classes/class_rigidbody.rst delete mode 100644 classes/class_rigidbody2d.rst create mode 100644 classes/class_rigiddynamicbody2d.rst create mode 100644 classes/class_rigiddynamicbody3d.rst create mode 100644 classes/class_scripteditorbase.rst create mode 100644 classes/class_separationrayshape2d.rst create mode 100644 classes/class_separationrayshape3d.rst create mode 100644 classes/class_shaderglobalsoverride.rst delete mode 100644 classes/class_shape.rst create mode 100644 classes/class_shape3d.rst delete mode 100644 classes/class_skeleton.rst create mode 100644 classes/class_skeleton3d.rst delete mode 100644 classes/class_skeletonik.rst create mode 100644 classes/class_skeletonik3d.rst create mode 100644 classes/class_skeletonmodification2d.rst create mode 100644 classes/class_skeletonmodification2dccdik.rst create mode 100644 classes/class_skeletonmodification2dfabrik.rst create mode 100644 classes/class_skeletonmodification2djiggle.rst create mode 100644 classes/class_skeletonmodification2dlookat.rst create mode 100644 classes/class_skeletonmodification2dphysicalbones.rst create mode 100644 classes/class_skeletonmodification2dstackholder.rst create mode 100644 classes/class_skeletonmodification2dtwoboneik.rst create mode 100644 classes/class_skeletonmodification3d.rst create mode 100644 classes/class_skeletonmodification3dccdik.rst create mode 100644 classes/class_skeletonmodification3dfabrik.rst create mode 100644 classes/class_skeletonmodification3djiggle.rst create mode 100644 classes/class_skeletonmodification3dlookat.rst create mode 100644 classes/class_skeletonmodification3dstackholder.rst create mode 100644 classes/class_skeletonmodification3dtwoboneik.rst create mode 100644 classes/class_skeletonmodificationstack2d.rst create mode 100644 classes/class_skeletonmodificationstack3d.rst rename classes/{class_sliderjoint.rst => class_sliderjoint3d.rst} (64%) delete mode 100644 classes/class_softbody.rst create mode 100644 classes/class_softdynamicbody3d.rst delete mode 100644 classes/class_spatial.rst delete mode 100644 classes/class_spatialgizmo.rst delete mode 100644 classes/class_spatialvelocitytracker.rst delete mode 100644 classes/class_sphereshape.rst create mode 100644 classes/class_sphereshape3d.rst delete mode 100644 classes/class_spotlight.rst create mode 100644 classes/class_spotlight3d.rst delete mode 100644 classes/class_springarm.rst create mode 100644 classes/class_springarm3d.rst delete mode 100644 classes/class_sprite.rst create mode 100644 classes/class_sprite2d.rst delete mode 100644 classes/class_staticbody.rst create mode 100644 classes/class_staticbody3d.rst create mode 100644 classes/class_streamcubemap.rst create mode 100644 classes/class_streamcubemaparray.rst create mode 100644 classes/class_streampeerextension.rst delete mode 100644 classes/class_streampeergdnative.rst rename classes/{class_streamtexture.rst => class_streamtexture2d.rst} (55%) create mode 100644 classes/class_streamtexture2darray.rst create mode 100644 classes/class_streamtexture3d.rst create mode 100644 classes/class_streamtexturelayered.rst create mode 100644 classes/class_subviewport.rst create mode 100644 classes/class_subviewportcontainer.rst create mode 100644 classes/class_syntaxhighlighter.rst delete mode 100644 classes/class_tcp_server.rst create mode 100644 classes/class_tcpserver.rst delete mode 100644 classes/class_textfile.rst create mode 100644 classes/class_textline.rst create mode 100644 classes/class_textparagraph.rst create mode 100644 classes/class_textserveradvanced.rst create mode 100644 classes/class_textserverextension.rst create mode 100644 classes/class_textserverfallback.rst create mode 100644 classes/class_texture3d.rst delete mode 100644 classes/class_textureprogress.rst create mode 100644 classes/class_textureprogressbar.rst create mode 100644 classes/class_tiledata.rst create mode 100644 classes/class_tilesetatlassource.rst create mode 100644 classes/class_tilesetscenescollectionsource.rst create mode 100644 classes/class_tilesetsource.rst create mode 100644 classes/class_time.rst delete mode 100644 classes/class_toolbutton.rst delete mode 100644 classes/class_transform.rst create mode 100644 classes/class_transform3d.rst create mode 100644 classes/class_tubetrailmesh.rst create mode 100644 classes/class_tweener.rst delete mode 100644 classes/class_vehiclebody.rst create mode 100644 classes/class_vehiclebody3d.rst rename classes/{class_vehiclewheel.rst => class_vehiclewheel3d.rst} (63%) create mode 100644 classes/class_velocitytracker3d.rst delete mode 100644 classes/class_viewportcontainer.rst delete mode 100644 classes/class_visibilityenabler.rst delete mode 100644 classes/class_visibilityenabler2d.rst delete mode 100644 classes/class_visibilitynotifier.rst delete mode 100644 classes/class_visibilitynotifier2d.rst create mode 100644 classes/class_visibleonscreenenabler2d.rst create mode 100644 classes/class_visibleonscreenenabler3d.rst create mode 100644 classes/class_visibleonscreennotifier2d.rst create mode 100644 classes/class_visibleonscreennotifier3d.rst delete mode 100644 classes/class_visualinstance.rst create mode 100644 classes/class_visualinstance3d.rst create mode 100644 classes/class_visualscriptcustomnodes.rst delete mode 100644 classes/class_visualscripteditor.rst delete mode 100644 classes/class_visualserver.rst create mode 100644 classes/class_visualshadernodebillboard.rst create mode 100644 classes/class_visualshadernodeclamp.rst create mode 100644 classes/class_visualshadernodecomment.rst create mode 100644 classes/class_visualshadernodeconstant.rst create mode 100644 classes/class_visualshadernodecurvetexture.rst create mode 100644 classes/class_visualshadernodecurvexyztexture.rst create mode 100644 classes/class_visualshadernodemix.rst create mode 100644 classes/class_visualshadernodemultiplyadd.rst create mode 100644 classes/class_visualshadernodeparticleaccelerator.rst create mode 100644 classes/class_visualshadernodeparticleboxemitter.rst create mode 100644 classes/class_visualshadernodeparticleconevelocity.rst create mode 100644 classes/class_visualshadernodeparticleemit.rst create mode 100644 classes/class_visualshadernodeparticleemitter.rst create mode 100644 classes/class_visualshadernodeparticlemultiplybyaxisangle.rst create mode 100644 classes/class_visualshadernodeparticleoutput.rst create mode 100644 classes/class_visualshadernodeparticlerandomness.rst create mode 100644 classes/class_visualshadernodeparticleringemitter.rst create mode 100644 classes/class_visualshadernodeparticlesphereemitter.rst create mode 100644 classes/class_visualshadernoderesizablebase.rst create mode 100644 classes/class_visualshadernodesample3d.rst delete mode 100644 classes/class_visualshadernodescalarclamp.rst delete mode 100644 classes/class_visualshadernodescalarinterp.rst delete mode 100644 classes/class_visualshadernodescalarsmoothstep.rst delete mode 100644 classes/class_visualshadernodescalarswitch.rst create mode 100644 classes/class_visualshadernodescreenuvtosdf.rst create mode 100644 classes/class_visualshadernodesdfraymarch.rst create mode 100644 classes/class_visualshadernodesdftoscreenuv.rst create mode 100644 classes/class_visualshadernodesmoothstep.rst create mode 100644 classes/class_visualshadernodestep.rst create mode 100644 classes/class_visualshadernodetexture2darray.rst create mode 100644 classes/class_visualshadernodetexture2darrayuniform.rst create mode 100644 classes/class_visualshadernodetexture3d.rst create mode 100644 classes/class_visualshadernodetexture3duniform.rst create mode 100644 classes/class_visualshadernodetexturesdf.rst create mode 100644 classes/class_visualshadernodetexturesdfnormal.rst delete mode 100644 classes/class_visualshadernodetransformmult.rst create mode 100644 classes/class_visualshadernodetransformop.rst create mode 100644 classes/class_visualshadernodeuniformref.rst create mode 100644 classes/class_visualshadernodeuvfunc.rst delete mode 100644 classes/class_visualshadernodevectorclamp.rst delete mode 100644 classes/class_visualshadernodevectorinterp.rst delete mode 100644 classes/class_visualshadernodevectorscalarmix.rst delete mode 100644 classes/class_visualshadernodevectorscalarsmoothstep.rst delete mode 100644 classes/class_visualshadernodevectorscalarstep.rst delete mode 100644 classes/class_visualshadernodevectorsmoothstep.rst create mode 100644 classes/class_voxelgi.rst rename classes/{class_giprobedata.rst => class_voxelgidata.rst} (59%) create mode 100644 classes/class_webrtcdatachannelextension.rst delete mode 100644 classes/class_webrtcdatachannelgdnative.rst delete mode 100644 classes/class_webrtcmultiplayer.rst create mode 100644 classes/class_webrtcmultiplayerpeer.rst create mode 100644 classes/class_webrtcpeerconnectionextension.rst delete mode 100644 classes/class_webrtcpeerconnectiongdnative.rst create mode 100644 classes/class_webxrinterface.rst create mode 100644 classes/class_window.rst delete mode 100644 classes/class_windowdialog.rst delete mode 100644 classes/class_world.rst create mode 100644 classes/class_world3d.rst create mode 100644 classes/class_worldboundaryshape2d.rst create mode 100644 classes/class_worldboundaryshape3d.rst delete mode 100644 classes/class_worldmarginshape.rst rename classes/{class_arvranchor.rst => class_xranchor3d.rst} (51%) create mode 100644 classes/class_xrcamera3d.rst create mode 100644 classes/class_xrcontroller3d.rst create mode 100644 classes/class_xrinterface.rst create mode 100644 classes/class_xrinterfaceextension.rst rename classes/{class_arvrorigin.rst => class_xrorigin3d.rst} (58%) create mode 100644 classes/class_xrpositionaltracker.rst create mode 100644 classes/class_xrserver.rst delete mode 100644 classes/class_ysort.rst diff --git a/classes/class_@c#.rst b/classes/class_@c#.rst deleted file mode 100644 index 99fd1a760..000000000 --- a/classes/class_@c#.rst +++ /dev/null @@ -1,13 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the @C#.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_@C#: - -@C# -=== - - - diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index e16782b4a..cc159bb9f 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -16,194 +16,45 @@ Description List of core built-in GDScript functions. Math functions and other utilities. Everything else is provided by objects. (Keywords: builtin, built in, global functions.) +Tutorials +--------- + +- :doc:`../tutorials/math/random_number_generation` + Methods ------- -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`Color8` **(** :ref:`int` r8, :ref:`int` g8, :ref:`int` b8, :ref:`int` a8=255 **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`ColorN` **(** :ref:`String` name, :ref:`float` alpha=1.0 **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`abs` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`acos` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`asin` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`assert` **(** :ref:`bool` condition **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`atan` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`atan2` **(** :ref:`float` y, :ref:`float` x **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`bytes2var` **(** :ref:`PackedByteArray` bytes, :ref:`bool` allow_objects=false **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`cartesian2polar` **(** :ref:`float` x, :ref:`float` y **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`ceil` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`char` **(** :ref:`int` code **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`clamp` **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`convert` **(** :ref:`Variant` what, :ref:`int` type **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`cos` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`cosh` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`db2linear` **(** :ref:`float` db **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`dectime` **(** :ref:`float` value, :ref:`float` amount, :ref:`float` step **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`deg2rad` **(** :ref:`float` deg **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Object` | :ref:`dict2inst` **(** :ref:`Dictionary` dict **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`ease` **(** :ref:`float` s, :ref:`float` curve **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`exp` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`floor` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`fmod` **(** :ref:`float` a, :ref:`float` b **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`fposmod` **(** :ref:`float` a, :ref:`float` b **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`FuncRef` | :ref:`funcref` **(** :ref:`Object` instance, :ref:`String` funcname **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`get_stack` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`hash` **(** :ref:`Variant` var **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`inst2dict` **(** :ref:`Object` inst **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Object` | :ref:`instance_from_id` **(** :ref:`int` instance_id **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`inverse_lerp` **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`float` a, :ref:`float` b **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_inf` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_instance_valid` **(** :ref:`Object` instance **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_nan` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_zero_approx` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`len` **(** :ref:`Variant` var **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`lerp` **(** :ref:`Variant` from, :ref:`Variant` to, :ref:`float` weight **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`lerp_angle` **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`linear2db` **(** :ref:`float` nrg **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Resource` | :ref:`load` **(** :ref:`String` path **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`log` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`max` **(** :ref:`float` a, :ref:`float` b **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`min` **(** :ref:`float` a, :ref:`float` b **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`move_toward` **(** :ref:`float` from, :ref:`float` to, :ref:`float` delta **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`nearest_po2` **(** :ref:`int` value **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`ord` **(** :ref:`String` char **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`parse_json` **(** :ref:`String` json **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`polar2cartesian` **(** :ref:`float` r, :ref:`float` th **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`posmod` **(** :ref:`int` a, :ref:`int` b **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`pow` **(** :ref:`float` base, :ref:`float` exp **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Resource` | :ref:`preload` **(** :ref:`String` path **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`print` **(** ... **)** vararg | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`print_debug` **(** ... **)** vararg | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`print_stack` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`printerr` **(** ... **)** vararg | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`printraw` **(** ... **)** vararg | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`prints` **(** ... **)** vararg | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`printt` **(** ... **)** vararg | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`push_error` **(** :ref:`String` message **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`push_warning` **(** :ref:`String` message **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`rad2deg` **(** :ref:`float` rad **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`rand_range` **(** :ref:`float` from, :ref:`float` to **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`rand_seed` **(** :ref:`int` seed **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`randf` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`randi` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`randomize` **(** **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`range` **(** ... **)** vararg | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`range_lerp` **(** :ref:`float` value, :ref:`float` istart, :ref:`float` istop, :ref:`float` ostart, :ref:`float` ostop **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`round` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`seed` **(** :ref:`int` seed **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`sign` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`sin` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`sinh` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`smoothstep` **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`sqrt` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`step_decimals` **(** :ref:`float` step **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`stepify` **(** :ref:`float` s, :ref:`float` step **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`str` **(** ... **)** vararg | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`str2var` **(** :ref:`String` string **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`tan` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`tanh` **(** :ref:`float` s **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`to_json` **(** :ref:`Variant` var **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`type_exists` **(** :ref:`String` type **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`typeof` **(** :ref:`Variant` what **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`validate_json` **(** :ref:`String` json **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedByteArray` | :ref:`var2bytes` **(** :ref:`Variant` var, :ref:`bool` full_objects=false **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`var2str` **(** :ref:`Variant` var **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`WeakRef` | :ref:`weakref` **(** :ref:`Object` obj **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`wrapf` **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`wrapi` **(** :ref:`int` value, :ref:`int` min, :ref:`int` max **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`GDScriptFunctionState` | :ref:`yield` **(** :ref:`Object` object=null, :ref:`String` signal="" **)** | -+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`Color8` **(** :ref:`int` r8, :ref:`int` g8, :ref:`int` b8, :ref:`int` a8=255 **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`assert` **(** :ref:`bool` condition, :ref:`String` message="" **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`char` **(** :ref:`int` char **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`convert` **(** :ref:`Variant` what, :ref:`int` type **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`dict2inst` **(** :ref:`Dictionary` dictionary **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_stack` **(** **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`inst2dict` **(** :ref:`Object` instance **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`len` **(** :ref:`Variant` var **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`load` **(** :ref:`String` path **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`preload` **(** :ref:`String` path **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_debug` **(** ... **)** |vararg| | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_stack` **(** **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`range` **(** ... **)** |vararg| | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`str` **(** ... **)** |vararg| | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`type_exists` **(** :ref:`StringName` type **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Constants --------- @@ -216,15 +67,17 @@ Constants .. _class_@GDScript_constant_NAN: -- **PI** = **3.141593** --- Constant that represents how many times the diameter of a circle fits around its perimeter. +- **PI** = **3.14159265358979** --- Constant that represents how many times the diameter of a circle fits around its perimeter. This is equivalent to ``TAU / 2``, or 180 degrees in rotations. -- **TAU** = **6.283185** --- The circle constant, the circumference of the unit circle. +- **TAU** = **6.28318530717959** --- The circle constant, the circumference of the unit circle in radians. This is equivalent to ``PI * 2``, or 360 degrees in rotations. -- **INF** = **inf** --- A positive infinity. (For negative infinity, use -INF). +- **INF** = **inf** --- Positive floating-point infinity. This is the result of floating-point division when the divisor is ``0.0``. For negative infinity, use ``-INF``. Dividing by ``-0.0`` will result in negative infinity if the numerator is positive, so dividing by ``0.0`` is not the same as dividing by ``-0.0`` (despite ``0.0 == -0.0`` returning ``true``). -- **NAN** = **nan** --- Macro constant that expands to an expression of type float that represents a NaN. +**Note:** Numeric infinity is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer number by ``0`` will not result in :ref:`INF` and will result in a run-time error instead. -The NaN values are used to identify undefined or non-representable values for floating-point elements, such as the square root of negative numbers or the result of 0/0. +- **NAN** = **nan** --- "Not a Number", an invalid floating-point value. :ref:`NAN` has special properties, including that it is not equal to itself (``NAN == NAN`` returns ``false``). It is output by some invalid operations, such as dividing floating-point ``0.0`` by ``0.0``. + +**Note:** "Not a Number" is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer ``0`` by ``0`` will not result in :ref:`NAN` and will result in a run-time error instead. Method Descriptions ------------------- @@ -249,135 +102,30 @@ Returns a color constructed from integer red, green, blue, and alpha channels. E ---- -.. _class_@GDScript_method_ColorN: - -- :ref:`Color` **ColorN** **(** :ref:`String` name, :ref:`float` alpha=1.0 **)** - -Returns a color according to the standardized ``name`` with ``alpha`` ranging from 0 to 1. - -:: - - red = ColorN("red", 1) - -Supported color names are the same as the constants defined in :ref:`Color`. - ----- - -.. _class_@GDScript_method_abs: - -- :ref:`float` **abs** **(** :ref:`float` s **)** - -Returns the absolute value of parameter ``s`` (i.e. unsigned value, works for integer and float). - -:: - - # a is 1 - a = abs(-1) - ----- - -.. _class_@GDScript_method_acos: - -- :ref:`float` **acos** **(** :ref:`float` s **)** - -Returns the arc cosine of ``s`` in radians. Use to get the angle of cosine ``s``. - -:: - - # c is 0.523599 or 30 degrees if converted with rad2deg(s) - c = acos(0.866025) - ----- - -.. _class_@GDScript_method_asin: - -- :ref:`float` **asin** **(** :ref:`float` s **)** - -Returns the arc sine of ``s`` in radians. Use to get the angle of sine ``s``. - -:: - - # s is 0.523599 or 30 degrees if converted with rad2deg(s) - s = asin(0.5) - ----- - .. _class_@GDScript_method_assert: -- void **assert** **(** :ref:`bool` condition **)** +- void **assert** **(** :ref:`bool` condition, :ref:`String` message="" **)** -Asserts that the ``condition`` is ``true`` . If the ``condition`` is ``false``, an error is generated and the program is halted until you resume it. Only executes in debug builds, or when running the game from the editor. Use it for debugging purposes, to make sure a statement is ``true`` during development. +Asserts that the ``condition`` is ``true``. If the ``condition`` is ``false``, an error is generated. When running from the editor, the running project will also be paused until you resume it. This can be used as a stronger form of :ref:`@GlobalScope.push_error` for reporting errors to project developers or add-on users. + +**Note:** For performance reasons, the code inside :ref:`assert` is only executed in debug builds or when running the project from the editor. Don't include code that has side effects in an :ref:`assert` call. Otherwise, the project will behave differently when exported in release mode. + +The optional ``message`` argument, if given, is shown in addition to the generic "Assertion failed" message. You can use this to provide additional details about why the assertion failed. :: - # Imagine we always want speed to be between 0 and 20 - speed = -10 + # Imagine we always want speed to be between 0 and 20. + var speed = -10 assert(speed < 20) # True, the program will continue assert(speed >= 0) # False, the program will stop - assert(speed >= 0 && speed < 20) # You can also combine the two conditional statements in one check - ----- - -.. _class_@GDScript_method_atan: - -- :ref:`float` **atan** **(** :ref:`float` s **)** - -Returns the arc tangent of ``s`` in radians. Use it to get the angle from an angle's tangent in trigonometry: ``atan(tan(angle)) == angle``. - -The method cannot know in which quadrant the angle should fall. See :ref:`atan2` if you always want an exact angle. - -:: - - a = atan(0.5) # a is 0.463648 - ----- - -.. _class_@GDScript_method_atan2: - -- :ref:`float` **atan2** **(** :ref:`float` y, :ref:`float` x **)** - -Returns the arc tangent of ``y/x`` in radians. Use to get the angle of tangent ``y/x``. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant. - -:: - - a = atan2(0, -1) # a is 3.141593 - ----- - -.. _class_@GDScript_method_bytes2var: - -- :ref:`Variant` **bytes2var** **(** :ref:`PackedByteArray` bytes, :ref:`bool` allow_objects=false **)** - -Decodes a byte array back to a value. When ``allow_objects`` is ``true`` decoding objects is allowed. - -**WARNING:** 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). - ----- - -.. _class_@GDScript_method_cartesian2polar: - -- :ref:`Vector2` **cartesian2polar** **(** :ref:`float` x, :ref:`float` y **)** - -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). - ----- - -.. _class_@GDScript_method_ceil: - -- :ref:`float` **ceil** **(** :ref:`float` s **)** - -Rounds ``s`` upward, returning the smallest integral value that is not less than ``s``. - -:: - - i = ceil(1.45) # i is 2 - i = ceil(1.001) # i is 2 + assert(speed >= 0 and speed < 20) # You can also combine the two conditional statements in one check + assert(speed < 20, "speed = %f, but the speed limit is 20" % speed) # Show a message with clarifying details ---- .. _class_@GDScript_method_char: -- :ref:`String` **char** **(** :ref:`int` code **)** +- :ref:`String` **char** **(** :ref:`int` char **)** Returns a character as a String of the given Unicode code point (which is compatible with ASCII code). @@ -387,26 +135,6 @@ Returns a character as a String of the given Unicode code point (which is compat a = char(65 + 32) # a is "a" a = char(8364) # a is "€" -This is the inverse of :ref:`ord`. - ----- - -.. _class_@GDScript_method_clamp: - -- :ref:`float` **clamp** **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** - -Clamps ``value`` and returns a value not less than ``min`` and not more than ``max``. - -:: - - speed = 1000 - # a is 20 - a = clamp(speed, 1, 20) - - speed = -10 - # a is 1 - a = clamp(speed, 1, 20) - ---- .. _class_@GDScript_method_convert: @@ -426,175 +154,11 @@ Converts from a type to another in the best way possible. The ``type`` parameter ---- -.. _class_@GDScript_method_cos: - -- :ref:`float` **cos** **(** :ref:`float` s **)** - -Returns the cosine of angle ``s`` in radians. - -:: - - # Prints 1 then -1 - print(cos(PI * 2)) - print(cos(PI)) - ----- - -.. _class_@GDScript_method_cosh: - -- :ref:`float` **cosh** **(** :ref:`float` s **)** - -Returns the hyperbolic cosine of ``s`` in radians. - -:: - - # Prints 1.543081 - print(cosh(1)) - ----- - -.. _class_@GDScript_method_db2linear: - -- :ref:`float` **db2linear** **(** :ref:`float` db **)** - -Converts from decibels to linear energy (audio). - ----- - -.. _class_@GDScript_method_dectime: - -- :ref:`float` **dectime** **(** :ref:`float` value, :ref:`float` amount, :ref:`float` step **)** - -Returns the result of ``value`` decreased by ``step`` \* ``amount``. - -:: - - # a = 59 - a = dectime(60, 10, 0.1)) - ----- - -.. _class_@GDScript_method_deg2rad: - -- :ref:`float` **deg2rad** **(** :ref:`float` deg **)** - -Returns degrees converted to radians. - -:: - - # r is 3.141593 - r = deg2rad(180) - ----- - .. _class_@GDScript_method_dict2inst: -- :ref:`Object` **dict2inst** **(** :ref:`Dictionary` dict **)** +- :ref:`Object` **dict2inst** **(** :ref:`Dictionary` dictionary **)** -Converts a previously converted instance to a dictionary, back into an instance. Useful for deserializing. - ----- - -.. _class_@GDScript_method_ease: - -- :ref:`float` **ease** **(** :ref:`float` s, :ref:`float` curve **)** - -Easing function, based on exponent. 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in. - ----- - -.. _class_@GDScript_method_exp: - -- :ref:`float` **exp** **(** :ref:`float` s **)** - -The natural exponential function. It raises the mathematical constant **e** to the power of ``s`` and returns it. - -**e** has an approximate value of 2.71828. - -For exponents to other bases use the method :ref:`pow`. - -:: - - a = exp(2) # Approximately 7.39 - ----- - -.. _class_@GDScript_method_floor: - -- :ref:`float` **floor** **(** :ref:`float` s **)** - -Rounds ``s`` to the closest smaller integer and returns it. - -:: - - # a is 2.0 - a = floor(2.99) - # a is -3.0 - a = floor(-2.99) - -**Note:** This method returns a float. If you need an integer, you can use ``int(s)`` directly. - ----- - -.. _class_@GDScript_method_fmod: - -- :ref:`float` **fmod** **(** :ref:`float` a, :ref:`float` b **)** - -Returns the floating-point remainder of ``a/b``, keeping the sign of ``a``. - -:: - - # Remainder is 1.5 - var remainder = fmod(7, 5.5) - -For the integer remainder operation, use the % operator. - ----- - -.. _class_@GDScript_method_fposmod: - -- :ref:`float` **fposmod** **(** :ref:`float` a, :ref:`float` b **)** - -Returns the floating-point modulus of ``a/b`` that wraps equally in positive and negative. - -:: - - var i = -6 - while i < 5: - prints(i, fposmod(i, 3)) - i += 1 - -Produces: - -:: - - -6 0 - -5 1 - -4 2 - -3 0 - -2 1 - -1 2 - 0 0 - 1 1 - 2 2 - 3 0 - 4 1 - ----- - -.. _class_@GDScript_method_funcref: - -- :ref:`FuncRef` **funcref** **(** :ref:`Object` instance, :ref:`String` funcname **)** - -Returns a reference to the specified function ``funcname`` in the ``instance`` node. As functions aren't first-class objects in GDscript, use ``funcref`` to store a :ref:`FuncRef` in a variable and call it later. - -:: - - func foo(): - return("bar") - - a = funcref(self, "foo") - print(a.call_func()) # Prints bar +Converts a dictionary (previously created with :ref:`inst2dict`) back to an instance. Useful for deserializing. ---- @@ -623,21 +187,9 @@ would print ---- -.. _class_@GDScript_method_hash: - -- :ref:`int` **hash** **(** :ref:`Variant` var **)** - -Returns the integer hash of the variable passed. - -:: - - print(hash("a")) # Prints 177670 - ----- - .. _class_@GDScript_method_inst2dict: -- :ref:`Dictionary` **inst2dict** **(** :ref:`Object` inst **)** +- :ref:`Dictionary` **inst2dict** **(** :ref:`Object` instance **)** Returns the passed instance converted to a dictionary (useful for serializing). @@ -658,78 +210,6 @@ Prints out: ---- -.. _class_@GDScript_method_instance_from_id: - -- :ref:`Object` **instance_from_id** **(** :ref:`int` instance_id **)** - -Returns the Object that corresponds to ``instance_id``. All Objects have a unique instance ID. - -:: - - var foo = "bar" - func _ready(): - var id = get_instance_id() - var inst = instance_from_id(id) - print(inst.foo) # Prints bar - ----- - -.. _class_@GDScript_method_inverse_lerp: - -- :ref:`float` **inverse_lerp** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** - -Returns a normalized value considering the given range. This is the opposite of :ref:`lerp`. - -:: - - 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. - ----- - -.. _class_@GDScript_method_is_equal_approx: - -- :ref:`bool` **is_equal_approx** **(** :ref:`float` a, :ref:`float` b **)** - -Returns ``true`` if ``a`` and ``b`` are approximately equal to each other. - ----- - -.. _class_@GDScript_method_is_inf: - -- :ref:`bool` **is_inf** **(** :ref:`float` s **)** - -Returns whether ``s`` is an infinity value (either positive infinity or negative infinity). - ----- - -.. _class_@GDScript_method_is_instance_valid: - -- :ref:`bool` **is_instance_valid** **(** :ref:`Object` instance **)** - -Returns whether ``instance`` is a valid object (e.g. has not been deleted from memory). - ----- - -.. _class_@GDScript_method_is_nan: - -- :ref:`bool` **is_nan** **(** :ref:`float` s **)** - -Returns whether ``s`` is a NaN (Not-A-Number) value. - ----- - -.. _class_@GDScript_method_is_zero_approx: - -- :ref:`bool` **is_zero_approx** **(** :ref:`float` s **)** - -Returns ``true`` if ``s`` is zero or almost zero. - ----- - .. _class_@GDScript_method_len: - :ref:`int` **len** **(** :ref:`Variant` var **)** @@ -745,227 +225,22 @@ Returns length of Variant ``var``. Length is the character count of String, elem ---- -.. _class_@GDScript_method_lerp: - -- :ref:`Variant` **lerp** **(** :ref:`Variant` from, :ref:`Variant` to, :ref:`float` weight **)** - -Linearly interpolates between two values by a normalized value. This is the opposite of :ref:`inverse_lerp`. - -If the ``from`` and ``to`` arguments are of type :ref:`int` or :ref:`float`, the return value is a :ref:`float`. - -If both are of the same vector type (:ref:`Vector2`, :ref:`Vector3` or :ref:`Color`), the return value will be of the same type (``lerp`` then calls the vector type's ``linear_interpolate`` method). - -:: - - lerp(0, 4, 0.75) # Returns 3.0 - lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Returns Vector2(2, 3.5) - ----- - -.. _class_@GDScript_method_lerp_angle: - -- :ref:`float` **lerp_angle** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** - -Linearly interpolates between two angles (in radians) by a normalized value. - -Similar to :ref:`lerp`, but interpolates correctly when the angles wrap around :ref:`TAU`. - -:: - - 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 - ----- - -.. _class_@GDScript_method_linear2db: - -- :ref:`float` **linear2db** **(** :ref:`float` nrg **)** - -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: - -:: - - # "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)) - ----- - .. _class_@GDScript_method_load: - :ref:`Resource` **load** **(** :ref:`String` path **)** -Loads a resource from the filesystem located at ``path``. +Loads a resource from the filesystem located at ``path``. The resource is loaded on the method call (unless it's referenced already elsewhere, e.g. in another script or in the scene), which might cause slight delay, especially when loading scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use :ref:`preload`. -**Note:** Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing **Copy Path**. +**Note:** Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. :: - # Load a scene called main located in the root of the project directory. - var main = load("res://main.tscn") + # Load a scene called main located in the root of the project directory and cache it in a variable. + var main = load("res://main.tscn") # main will contain a PackedScene resource. **Important:** The path must be absolute, a local path will just return ``null``. ----- - -.. _class_@GDScript_method_log: - -- :ref:`float` **log** **(** :ref:`float` s **)** - -Natural logarithm. The amount of time needed to reach a certain level of continuous growth. - -**Note:** This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. - -:: - - log(10) # Returns 2.302585 - ----- - -.. _class_@GDScript_method_max: - -- :ref:`float` **max** **(** :ref:`float` a, :ref:`float` b **)** - -Returns the maximum of two values. - -:: - - max(1, 2) # Returns 2 - max(-3.99, -4) # Returns -3.99 - ----- - -.. _class_@GDScript_method_min: - -- :ref:`float` **min** **(** :ref:`float` a, :ref:`float` b **)** - -Returns the minimum of two values. - -:: - - min(1, 2) # Returns 1 - min(-3.99, -4) # Returns -4 - ----- - -.. _class_@GDScript_method_move_toward: - -- :ref:`float` **move_toward** **(** :ref:`float` from, :ref:`float` to, :ref:`float` delta **)** - -Moves ``from`` toward ``to`` by the ``delta`` value. - -Use a negative ``delta`` value to move away. - -:: - - move_toward(10, 5, 4) # Returns 6 - ----- - -.. _class_@GDScript_method_nearest_po2: - -- :ref:`int` **nearest_po2** **(** :ref:`int` value **)** - -Returns the nearest larger power of 2 for integer ``value``. - -:: - - nearest_po2(3) # Returns 4 - nearest_po2(4) # Returns 4 - nearest_po2(5) # Returns 8 - ----- - -.. _class_@GDScript_method_ord: - -- :ref:`int` **ord** **(** :ref:`String` char **)** - -Returns an integer representing the Unicode code point of the given Unicode character ``char``. - -:: - - a = ord("A") # a is 65 - a = ord("a") # a is 97 - a = ord("€") # a is 8364 - -This is the inverse of :ref:`char`. - ----- - -.. _class_@GDScript_method_parse_json: - -- :ref:`Variant` **parse_json** **(** :ref:`String` json **)** - -Parse JSON text to a Variant (use :ref:`typeof` to check if it is what you expect). - -Be aware that 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 :ref:`float` types. - -Note that 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: - -:: - - p = parse_json('["a", "b", "c"]') - if typeof(p) == TYPE_ARRAY: - print(p[0]) # Prints a - else: - print("unexpected results") - ----- - -.. _class_@GDScript_method_polar2cartesian: - -- :ref:`Vector2` **polar2cartesian** **(** :ref:`float` r, :ref:`float` th **)** - -Converts a 2D point expressed in the polar coordinate system (a distance from the origin ``r`` and an angle ``th``) to the cartesian coordinate system (X and Y axis). - ----- - -.. _class_@GDScript_method_posmod: - -- :ref:`int` **posmod** **(** :ref:`int` a, :ref:`int` b **)** - -Returns the integer modulus of ``a/b`` that wraps equally in positive and negative. - -:: - - var i = -6 - while i < 5: - prints(i, posmod(i, 3)) - i += 1 - -Produces: - -:: - - -6 0 - -5 1 - -4 2 - -3 0 - -2 1 - -1 2 - 0 0 - 1 1 - 2 2 - 3 0 - 4 1 - ----- - -.. _class_@GDScript_method_pow: - -- :ref:`float` **pow** **(** :ref:`float` base, :ref:`float` exp **)** - -Returns the result of ``x`` raised to the power of ``y``. - -:: - - pow(2, 5) # Returns 32 +This method is a simplified version of :ref:`ResourceLoader.load`, which can be used for more advanced scenarios. ---- @@ -973,35 +248,22 @@ Returns the result of ``x`` raised to the power of ``y``. - :ref:`Resource` **preload** **(** :ref:`String` path **)** -Returns a resource from the filesystem that is loaded during script parsing. +Returns a :ref:`Resource` from the filesystem located at ``path``. The resource is loaded during script parsing, i.e. is loaded with the script and :ref:`preload` effectively acts as a reference to that resource. Note that the method requires a constant path. If you want to load a resource from a dynamic/variable path, use :ref:`load`. -**Note:** Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path". +**Note:** Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. :: - # Load a scene called main located in the root of the project directory. - var main = preload("res://main.tscn") - ----- - -.. _class_@GDScript_method_print: - -- void **print** **(** ... **)** vararg - -Converts one or more arguments to strings in the best way possible and prints them to the console. - -:: - - a = [1, 2, 3] - print("a", "b", a) # Prints ab[1, 2, 3] + # Instance a scene. + var diamond = preload("res://diamond.tscn").instantiate() ---- .. _class_@GDScript_method_print_debug: -- void **print_debug** **(** ... **)** vararg +- void **print_debug** **(** ... **)** |vararg| -Like :ref:`print`, but prints only when used in debug mode. +Like :ref:`@GlobalScope.print`, but prints only when used in debug mode. ---- @@ -1019,323 +281,51 @@ Output in the console would look something like this: ---- -.. _class_@GDScript_method_printerr: - -- void **printerr** **(** ... **)** vararg - -Prints one or more arguments to strings in the best way possible to standard error line. - -:: - - printerr("prints to stderr") - ----- - -.. _class_@GDScript_method_printraw: - -- void **printraw** **(** ... **)** vararg - -Prints one or more arguments to strings in the best way possible to console. No newline is added at the end. - -:: - - printraw("A") - printraw("B") - # Prints AB - -**Note:** 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 :ref:`print`. - ----- - -.. _class_@GDScript_method_prints: - -- void **prints** **(** ... **)** vararg - -Prints one or more arguments to the console with a space between each argument. - -:: - - prints("A", "B", "C") # Prints A B C - ----- - -.. _class_@GDScript_method_printt: - -- void **printt** **(** ... **)** vararg - -Prints one or more arguments to the console with a tab between each argument. - -:: - - printt("A", "B", "C") # Prints A B C - ----- - -.. _class_@GDScript_method_push_error: - -- void **push_error** **(** :ref:`String` message **)** - -Pushes an error message to Godot's built-in debugger and to the OS terminal. - -:: - - push_error("test error") # Prints "test error" to debugger and terminal as error call - ----- - -.. _class_@GDScript_method_push_warning: - -- void **push_warning** **(** :ref:`String` message **)** - -Pushes a warning message to Godot's built-in debugger and to the OS terminal. - -:: - - push_warning("test warning") # Prints "test warning" to debugger and terminal as warning call - ----- - -.. _class_@GDScript_method_rad2deg: - -- :ref:`float` **rad2deg** **(** :ref:`float` rad **)** - -Converts from radians to degrees. - -:: - - rad2deg(0.523599) # Returns 30 - ----- - -.. _class_@GDScript_method_rand_range: - -- :ref:`float` **rand_range** **(** :ref:`float` from, :ref:`float` to **)** - -Random range, any floating point value between ``from`` and ``to``. - -:: - - prints(rand_range(0, 1), rand_range(0, 1)) # Prints e.g. 0.135591 0.405263 - ----- - -.. _class_@GDScript_method_rand_seed: - -- :ref:`Array` **rand_seed** **(** :ref:`int` seed **)** - -Random from seed: pass a ``seed``, 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. - ----- - -.. _class_@GDScript_method_randf: - -- :ref:`float` **randf** **(** **)** - -Returns a random floating point value on the interval ``[0, 1]``. - -:: - - randf() # Returns e.g. 0.375671 - ----- - -.. _class_@GDScript_method_randi: - -- :ref:`int` **randi** **(** **)** - -Returns a random unsigned 32 bit integer. Use remainder to obtain a random value in the interval ``[0, N - 1]`` (where N is smaller than 2^32). - -:: - - 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 - ----- - -.. _class_@GDScript_method_randomize: - -- void **randomize** **(** **)** - -Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. - -:: - - func _ready(): - randomize() - ----- - .. _class_@GDScript_method_range: -- :ref:`Array` **range** **(** ... **)** vararg +- :ref:`Array` **range** **(** ... **)** |vararg| -Returns an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial, final-1, increment). +Returns an array with the given range. Range can be 1 argument ``N`` (0 to ``N`` - 1), two arguments (``initial``, ``final - 1``) or three arguments (``initial``, ``final - 1``, ``increment``). Returns an empty array if the range isn't valid (e.g. ``range(2, 5, -1)`` or ``range(5, 5, 1)``). + +Returns an array with the given range. ``range()`` can have 1 argument N (``0`` to ``N - 1``), two arguments (``initial``, ``final - 1``) or three arguments (``initial``, ``final - 1``, ``increment``). ``increment`` can be negative. If ``increment`` is negative, ``final - 1`` will become ``final + 1``. Also, the initial value must be greater than the final value for the loop to run. :: - for i in range(4): - print(i) - for i in range(2, 5): - print(i) - for i in range(0, 6, 2): - print(i) + print(range(4)) + print(range(2, 5)) + print(range(0, 6, 2)) Output: :: - 0 - 1 - 2 + [0, 1, 2, 3] + [2, 3, 4] + [0, 2, 4] + +To iterate over an :ref:`Array` backwards, use: + +:: + + var array = [3, 6, 9] + var i := array.size() - 1 + while i >= 0: + print(array[i]) + i -= 1 + +Output: + +:: + + 9 + 6 3 - - 2 - 3 - 4 - - 0 - 2 - 4 - ----- - -.. _class_@GDScript_method_range_lerp: - -- :ref:`float` **range_lerp** **(** :ref:`float` value, :ref:`float` istart, :ref:`float` istop, :ref:`float` ostart, :ref:`float` ostop **)** - -Maps a ``value`` from range ``[istart, istop]`` to ``[ostart, ostop]``. - -:: - - range_lerp(75, 0, 100, -1, 1) # Returns 0.5 - ----- - -.. _class_@GDScript_method_round: - -- :ref:`float` **round** **(** :ref:`float` s **)** - -Returns the integral value that is nearest to ``s``, with halfway cases rounded away from zero. - -:: - - round(2.6) # Returns 3 - ----- - -.. _class_@GDScript_method_seed: - -- void **seed** **(** :ref:`int` seed **)** - -Sets seed for the random number generator. - -:: - - my_seed = "Godot Rocks" - seed(my_seed.hash()) - ----- - -.. _class_@GDScript_method_sign: - -- :ref:`float` **sign** **(** :ref:`float` s **)** - -Returns the sign of ``s``: -1 or 1. Returns 0 if ``s`` is 0. - -:: - - sign(-6) # Returns -1 - sign(0) # Returns 0 - sign(6) # Returns 1 - ----- - -.. _class_@GDScript_method_sin: - -- :ref:`float` **sin** **(** :ref:`float` s **)** - -Returns the sine of angle ``s`` in radians. - -:: - - sin(0.523599) # Returns 0.5 - ----- - -.. _class_@GDScript_method_sinh: - -- :ref:`float` **sinh** **(** :ref:`float` s **)** - -Returns the hyperbolic sine of ``s``. - -:: - - a = log(2.0) # Returns 0.693147 - sinh(a) # Returns 0.75 - ----- - -.. _class_@GDScript_method_smoothstep: - -- :ref:`float` **smoothstep** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** - -Returns a number smoothly interpolated between the ``from`` and ``to``, based on the ``weight``. Similar to :ref:`lerp`, but interpolates faster at the beginning and slower at the end. - -:: - - smoothstep(0, 2, 0.5) # Returns 0.15 - smoothstep(0, 2, 1.0) # Returns 0.5 - smoothstep(0, 2, 2.0) # Returns 1.0 - ----- - -.. _class_@GDScript_method_sqrt: - -- :ref:`float` **sqrt** **(** :ref:`float` s **)** - -Returns the square root of ``s``. - -:: - - sqrt(9) # Returns 3 - ----- - -.. _class_@GDScript_method_step_decimals: - -- :ref:`int` **step_decimals** **(** :ref:`float` step **)** - -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. - -:: - - # n is 0 - n = step_decimals(5) - # n is 4 - n = step_decimals(1.0005) - # n is 9 - n = step_decimals(0.000000005) - ----- - -.. _class_@GDScript_method_stepify: - -- :ref:`float` **stepify** **(** :ref:`float` s, :ref:`float` step **)** - -Snaps float value ``s`` to a given ``step``. This can also be used to round a floating point number to an arbitrary number of decimals. - -:: - - stepify(100, 32) # Returns 96 - stepify(3.14159, 0.01) # Returns 3.14 ---- .. _class_@GDScript_method_str: -- :ref:`String` **str** **(** ... **)** vararg +- :ref:`String` **str** **(** ... **)** |vararg| Converts one or more arguments to string in the best way possible. @@ -1348,252 +338,13 @@ Converts one or more arguments to string in the best way possible. ---- -.. _class_@GDScript_method_str2var: - -- :ref:`Variant` **str2var** **(** :ref:`String` string **)** - -Converts a formatted string that was returned by :ref:`var2str` to the original value. - -:: - - a = '{ "a": 1, "b": 2 }' - b = str2var(a) - print(b["a"]) # Prints 1 - ----- - -.. _class_@GDScript_method_tan: - -- :ref:`float` **tan** **(** :ref:`float` s **)** - -Returns the tangent of angle ``s`` in radians. - -:: - - tan(deg2rad(45)) # Returns 1 - ----- - -.. _class_@GDScript_method_tanh: - -- :ref:`float` **tanh** **(** :ref:`float` s **)** - -Returns the hyperbolic tangent of ``s``. - -:: - - a = log(2.0) # Returns 0.693147 - tanh(a) # Returns 0.6 - ----- - -.. _class_@GDScript_method_to_json: - -- :ref:`String` **to_json** **(** :ref:`Variant` var **)** - -Converts a Variant ``var`` to JSON text and return the result. Useful for serializing data to store or send over the network. - -:: - - a = { "a": 1, "b": 2 } - b = to_json(a) - print(b) # {"a":1, "b":2} - ----- - .. _class_@GDScript_method_type_exists: -- :ref:`bool` **type_exists** **(** :ref:`String` type **)** - -Returns whether the given class exists in :ref:`ClassDB`. - -:: - - type_exists("Sprite") # Returns true - type_exists("Variant") # Returns false - ----- - -.. _class_@GDScript_method_typeof: - -- :ref:`int` **typeof** **(** :ref:`Variant` what **)** - -Returns the internal type of the given Variant object, using the :ref:`Variant.Type` values. - -:: - - p = parse_json('["a", "b", "c"]') - if typeof(p) == TYPE_ARRAY: - print(p[0]) # Prints a - else: - print("unexpected results") - ----- - -.. _class_@GDScript_method_validate_json: - -- :ref:`String` **validate_json** **(** :ref:`String` json **)** - -Checks that ``json`` is valid JSON data. Returns an empty string if valid, or an error message otherwise. - -:: - - j = to_json([1, 2, 3]) - v = validate_json(j) - if not v: - print("valid") - else: - prints("invalid", v) - ----- - -.. _class_@GDScript_method_var2bytes: - -- :ref:`PackedByteArray` **var2bytes** **(** :ref:`Variant` var, :ref:`bool` full_objects=false **)** - -Encodes a variable value to a byte array. When ``full_objects`` is ``true`` encoding objects is allowed (and can potentially include code). - ----- - -.. _class_@GDScript_method_var2str: - -- :ref:`String` **var2str** **(** :ref:`Variant` var **)** - -Converts a Variant ``var`` to a formatted string that can later be parsed using :ref:`str2var`. - -:: - - a = { "a": 1, "b": 2 } - print(var2str(a)) - -prints - -:: - - { - "a": 1, - "b": 2 - } - ----- - -.. _class_@GDScript_method_weakref: - -- :ref:`WeakRef` **weakref** **(** :ref:`Object` obj **)** - -Returns a weak reference to an object. - -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. - ----- - -.. _class_@GDScript_method_wrapf: - -- :ref:`float` **wrapf** **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** - -Wraps float ``value`` between ``min`` and ``max``. - -Usable for creating loop-alike behavior or infinite surfaces. - -:: - - # a is 0.5 - a = wrapf(10.5, 0.0, 10.0) - -:: - - # a is 9.5 - a = wrapf(-0.5, 0.0, 10.0) - -:: - - # Infinite loop between 0.0 and 0.99 - f = wrapf(f + 0.1, 0.0, 1.0) - -:: - - # Infinite rotation (in radians) - angle = wrapf(angle + 0.1, 0.0, TAU) - -**Note:** If you just want to wrap between 0.0 and ``n`` (where ``n`` is a positive floating-point value), it is better for performance to use the :ref:`fmod` method like ``fmod(number, n)``. - -``wrapf`` is more flexible than using the :ref:`fmod` approach by giving the user a simple control over the minimum value. It also fully supports negative numbers, e.g. - -:: - - # Infinite rotation (in radians) - angle = wrapf(angle + 0.1, -PI, PI) - ----- - -.. _class_@GDScript_method_wrapi: - -- :ref:`int` **wrapi** **(** :ref:`int` value, :ref:`int` min, :ref:`int` max **)** - -Wraps integer ``value`` between ``min`` and ``max``. - -Usable for creating loop-alike behavior or infinite surfaces. - -:: - - # a is 0 - a = wrapi(10, 0, 10) - -:: - - # a is 9 - a = wrapi(-1, 0, 10) - -:: - - # Infinite loop between 0 and 9 - frame = wrapi(frame + 1, 0, 10) - -**Note:** If you just want to wrap between 0 and ``n`` (where ``n`` is a positive integer value), it is better for performance to use the modulo operator like ``number % n``. - -``wrapi`` is more flexible than using the modulo approach by giving the user a simple control over the minimum value. It also fully supports negative numbers, e.g. - -:: - - # result is -2 - var result = wrapi(-6, -5, -1) - ----- - -.. _class_@GDScript_method_yield: - -- :ref:`GDScriptFunctionState` **yield** **(** :ref:`Object` object=null, :ref:`String` signal="" **)** - -Stops the function execution and returns the current suspended state to the calling function. - -From the caller, call :ref:`GDScriptFunctionState.resume` on the state to resume execution. This invalidates the state. Within the resumed function, ``yield()`` returns whatever was passed to the ``resume()`` function call. - -If passed an object and a signal, the execution is resumed when the object emits the given signal. In this case, ``yield()`` returns the argument passed to ``emit_signal()`` if the signal takes only one argument, or an array containing all the arguments passed to ``emit_signal()`` if the signal takes multiple arguments. - -You can also use ``yield`` to wait for a function to finish: - -:: - - func _ready(): - yield(countdown(), "completed") # waiting for the countdown() function to complete - print('Ready') - - func countdown(): - yield(get_tree(), "idle_frame") # returns a GDScriptFunctionState object to _ready() - print(3) - yield(get_tree().create_timer(1.0), "timeout") - print(2) - yield(get_tree().create_timer(1.0), "timeout") - print(1) - yield(get_tree().create_timer(1.0), "timeout") - - # prints: - # 3 - # 2 - # 1 - # Ready - -When yielding on a function, the ``completed`` signal will be emitted automatically when the function returns. It can, therefore, be used as the ``signal`` parameter of the ``yield`` method to resume. - -In order to yield on a function, the resulting function should also return a ``GDScriptFunctionState``. Notice ``yield(get_tree(), "idle_frame")`` from the above example. - +- :ref:`bool` **type_exists** **(** :ref:`StringName` type **)** + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index 73577e55d..4750b793e 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -21,8 +21,6 @@ Singletons are also documented here, since they can be accessed from anywhere. Properties ---------- -+---------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`ARVRServer` | :ref:`ARVRServer` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`AudioServer` | :ref:`AudioServer` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ @@ -30,9 +28,15 @@ Properties +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`ClassDB` | :ref:`ClassDB` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`DisplayServer` | :ref:`DisplayServer` | ++---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`Engine` | :ref:`Engine` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`Geometry` | :ref:`Geometry` | +| :ref:`EngineDebugger` | :ref:`EngineDebugger` | ++---------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Geometry2D` | :ref:`Geometry2D` | ++---------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Geometry3D` | :ref:`Geometry3D` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`GodotSharp` | :ref:`GodotSharp` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ @@ -42,63 +46,250 @@ Properties +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`InputMap` | :ref:`InputMap` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`JSON` | :ref:`JSON` | -+---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`JavaClassWrapper` | :ref:`JavaClassWrapper` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`JavaScript` | :ref:`JavaScript` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`Marshalls` | :ref:`Marshalls` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`Navigation2DServer` | :ref:`Navigation2DServer` | +| :ref:`NativeExtensionManager` | :ref:`NativeExtensionManager` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`NavigationMeshGenerator` | :ref:`NavigationMeshGenerator` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`NavigationServer` | :ref:`NavigationServer` | +| :ref:`NavigationServer2D` | :ref:`NavigationServer2D` | ++---------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`NavigationServer3D` | :ref:`NavigationServer3D` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`OS` | :ref:`OS` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`Performance` | :ref:`Performance` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`Physics2DServer` | :ref:`Physics2DServer` | +| :ref:`PhysicsServer2D` | :ref:`PhysicsServer2D` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`PhysicsServer` | :ref:`PhysicsServer` | +| :ref:`PhysicsServer3D` | :ref:`PhysicsServer3D` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`ProjectSettings` | :ref:`ProjectSettings` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`RenderingServer` | :ref:`RenderingServer` | ++---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`ResourceLoader` | :ref:`ResourceLoader` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`ResourceSaver` | :ref:`ResourceSaver` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`ResourceUID` | :ref:`ResourceUID` | ++---------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`TextServerManager` | :ref:`TextServerManager` | ++---------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Time` | :ref:`Time` | ++---------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`TranslationServer` | :ref:`TranslationServer` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`VisualScriptEditor` | :ref:`VisualScriptEditor` | +| :ref:`VisualScriptCustomNodes` | :ref:`VisualScriptCustomNodes` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ -| :ref:`VisualServer` | :ref:`VisualServer` | +| :ref:`XRServer` | :ref:`XRServer` | +---------------------------------------------------------------+-------------------------------------------------------------------------------------+ +Methods +------- + ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`abs` **(** :ref:`Variant` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`absf` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`absi` **(** :ref:`int` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`acos` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`asin` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`atan` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`atan2` **(** :ref:`float` y, :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`bytes2var` **(** :ref:`PackedByteArray` bytes **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`bytes2var_with_objects` **(** :ref:`PackedByteArray` bytes **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`ceil` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`clamp` **(** :ref:`Variant` value, :ref:`Variant` min, :ref:`Variant` max **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`clampf` **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`clampi` **(** :ref:`int` value, :ref:`int` min, :ref:`int` max **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`cos` **(** :ref:`float` angle_rad **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`cosh` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`db2linear` **(** :ref:`float` db **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`deg2rad` **(** :ref:`float` deg **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`ease` **(** :ref:`float` x, :ref:`float` curve **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`error_string` **(** :ref:`int` error **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`exp` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`floor` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`fmod` **(** :ref:`float` x, :ref:`float` y **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`fposmod` **(** :ref:`float` x, :ref:`float` y **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`hash` **(** :ref:`Variant` variable **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`instance_from_id` **(** :ref:`int` instance_id **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`inverse_lerp` **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`float` a, :ref:`float` b **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_inf` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_instance_id_valid` **(** :ref:`int` id **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_instance_valid` **(** :ref:`Variant` instance **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_nan` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_zero_approx` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`lerp` **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`lerp_angle` **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`linear2db` **(** :ref:`float` lin **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`log` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`max` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`maxf` **(** :ref:`float` a, :ref:`float` b **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`maxi` **(** :ref:`int` a, :ref:`int` b **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`min` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`minf` **(** :ref:`float` a, :ref:`float` b **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`mini` **(** :ref:`int` a, :ref:`int` b **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`move_toward` **(** :ref:`float` from, :ref:`float` to, :ref:`float` delta **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`nearest_po2` **(** :ref:`int` value **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`posmod` **(** :ref:`int` x, :ref:`int` y **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`pow` **(** :ref:`float` base, :ref:`float` exp **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_verbose` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`printerr` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`printraw` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`prints` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`printt` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_error` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_warning` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rad2deg` **(** :ref:`float` rad **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedInt64Array` | :ref:`rand_from_seed` **(** :ref:`int` seed **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`randf` **(** **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`randf_range` **(** :ref:`float` from, :ref:`float` to **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`randi` **(** **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`randi_range` **(** :ref:`int` from, :ref:`int` to **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`randomize` **(** **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`range_lerp` **(** :ref:`float` value, :ref:`float` istart, :ref:`float` istop, :ref:`float` ostart, :ref:`float` ostop **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`range_step_decimals` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rid_allocate_id` **(** **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`rid_from_int64` **(** :ref:`int` base **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`round` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`seed` **(** :ref:`int` base **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`sign` **(** :ref:`Variant` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`signf` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`signi` **(** :ref:`int` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`sin` **(** :ref:`float` angle_rad **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`sinh` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`smoothstep` **(** :ref:`float` from, :ref:`float` to, :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`snapped` **(** :ref:`float` x, :ref:`float` step **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`sqrt` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`step_decimals` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`str` **(** ... **)** |vararg| | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`str2var` **(** :ref:`String` string **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`tan` **(** :ref:`float` angle_rad **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`tanh` **(** :ref:`float` x **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`typeof` **(** :ref:`Variant` variable **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`var2bytes` **(** :ref:`Variant` variable **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`var2bytes_with_objects` **(** :ref:`Variant` variable **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`var2str` **(** :ref:`Variant` variable **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`weakref` **(** :ref:`Variant` obj **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`wrapf` **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`wrapi` **(** :ref:`int` value, :ref:`int` min, :ref:`int` max **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + Enumerations ------------ -.. _enum_@GlobalScope_Margin: +.. _enum_@GlobalScope_Side: -.. _class_@GlobalScope_constant_MARGIN_LEFT: +.. _class_@GlobalScope_constant_SIDE_LEFT: -.. _class_@GlobalScope_constant_MARGIN_TOP: +.. _class_@GlobalScope_constant_SIDE_TOP: -.. _class_@GlobalScope_constant_MARGIN_RIGHT: +.. _class_@GlobalScope_constant_SIDE_RIGHT: -.. _class_@GlobalScope_constant_MARGIN_BOTTOM: +.. _class_@GlobalScope_constant_SIDE_BOTTOM: -enum **Margin**: +enum **Side**: -- **MARGIN_LEFT** = **0** --- Left margin, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. +- **SIDE_LEFT** = **0** --- Left side, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. -- **MARGIN_TOP** = **1** --- Top margin, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. +- **SIDE_TOP** = **1** --- Top side, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. -- **MARGIN_RIGHT** = **2** --- Right margin, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. +- **SIDE_RIGHT** = **2** --- Right side, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. -- **MARGIN_BOTTOM** = **3** --- Bottom margin, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. +- **SIDE_BOTTOM** = **3** --- Bottom side, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. ---- @@ -138,6 +329,20 @@ enum **Orientation**: ---- +.. _enum_@GlobalScope_ClockDirection: + +.. _class_@GlobalScope_constant_CLOCKWISE: + +.. _class_@GlobalScope_constant_COUNTERCLOCKWISE: + +enum **ClockDirection**: + +- **CLOCKWISE** = **0** + +- **COUNTERCLOCKWISE** = **1** + +---- + .. _enum_@GlobalScope_HAlign: .. _class_@GlobalScope_constant_HALIGN_LEFT: @@ -146,6 +351,8 @@ enum **Orientation**: .. _class_@GlobalScope_constant_HALIGN_RIGHT: +.. _class_@GlobalScope_constant_HALIGN_FILL: + enum **HAlign**: - **HALIGN_LEFT** = **0** --- Horizontal left alignment, usually for text-derived classes. @@ -154,6 +361,8 @@ enum **HAlign**: - **HALIGN_RIGHT** = **2** --- Horizontal right alignment, usually for text-derived classes. +- **HALIGN_FILL** = **3** --- Expand row to fit width, usually for text-derived classes. + ---- .. _enum_@GlobalScope_VAlign: @@ -174,7 +383,53 @@ enum **VAlign**: ---- -.. _enum_@GlobalScope_KeyList: +.. _enum_@GlobalScope_InlineAlign: + +.. _class_@GlobalScope_constant_INLINE_ALIGN_TOP_TO: + +.. _class_@GlobalScope_constant_INLINE_ALIGN_CENTER_TO: + +.. _class_@GlobalScope_constant_INLINE_ALIGN_BOTTOM_TO: + +.. _class_@GlobalScope_constant_INLINE_ALIGN_TO_TOP: + +.. _class_@GlobalScope_constant_INLINE_ALIGN_TO_CENTER: + +.. _class_@GlobalScope_constant_INLINE_ALIGN_TO_BASELINE: + +.. _class_@GlobalScope_constant_INLINE_ALIGN_TO_BOTTOM: + +.. _class_@GlobalScope_constant_INLINE_ALIGN_TOP: + +.. _class_@GlobalScope_constant_INLINE_ALIGN_CENTER: + +.. _class_@GlobalScope_constant_INLINE_ALIGN_BOTTOM: + +enum **InlineAlign**: + +- **INLINE_ALIGN_TOP_TO** = **0** --- Aligns the top of the inline object (e.g. image, table) to the position of the text specified by ``INLINE_ALIGN_TO_*`` constant. + +- **INLINE_ALIGN_CENTER_TO** = **1** --- Aligns the center of the inline object (e.g. image, table) to the position of the text specified by ``INLINE_ALIGN_TO_*`` constant. + +- **INLINE_ALIGN_BOTTOM_TO** = **2** --- Aligns the bottom of the inline object (e.g. image, table) to the position of the text specified by ``INLINE_ALIGN_TO_*`` constant. + +- **INLINE_ALIGN_TO_TOP** = **0** --- Aligns the position of the inline object (e.g. image, table) specified by ``INLINE_ALIGN_*_TO`` constant to the top of the text. + +- **INLINE_ALIGN_TO_CENTER** = **4** --- Aligns the position of the inline object (e.g. image, table) specified by ``INLINE_ALIGN_*_TO`` constant to the center of the text. + +- **INLINE_ALIGN_TO_BASELINE** = **8** --- Aligns the position of the inline object (e.g. image, table) specified by ``INLINE_ALIGN_*_TO`` constant to the baseline of the text. + +- **INLINE_ALIGN_TO_BOTTOM** = **12** --- Aligns inline object (e.g. image, table) to the bottom of the text. + +- **INLINE_ALIGN_TOP** = **0** --- Aligns top of the inline object (e.g. image, table) to the top of the text. Equvalent to ``INLINE_ALIGN_TOP_TO | INLINE_ALIGN_TO_TOP``. + +- **INLINE_ALIGN_CENTER** = **5** --- Aligns center of the inline object (e.g. image, table) to the center of the text. Equvalent to ``INLINE_ALIGN_CENTER_TO | INLINE_ALIGN_TO_CENTER``. + +- **INLINE_ALIGN_BOTTOM** = **14** --- Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equvalent to ``INLINE_ALIGN_BOTTOM_TO | INLINE_ALIGN_TO_BOTTOM``. + +---- + +.. _enum_@GlobalScope_Key: .. _class_@GlobalScope_constant_KEY_ESCAPE: @@ -218,7 +473,7 @@ enum **VAlign**: .. _class_@GlobalScope_constant_KEY_SHIFT: -.. _class_@GlobalScope_constant_KEY_CONTROL: +.. _class_@GlobalScope_constant_KEY_CTRL: .. _class_@GlobalScope_constant_KEY_META: @@ -660,13 +915,13 @@ enum **VAlign**: .. _class_@GlobalScope_constant_KEY_YDIAERESIS: -enum **KeyList**: +enum **Key**: - **KEY_ESCAPE** = **16777217** --- Escape key. - **KEY_TAB** = **16777218** --- Tab key. -- **KEY_BACKTAB** = **16777219** --- Shift+Tab key. +- **KEY_BACKTAB** = **16777219** --- Shift + Tab key. - **KEY_BACKSPACE** = **16777220** --- Backspace key. @@ -704,7 +959,7 @@ enum **KeyList**: - **KEY_SHIFT** = **16777237** --- Shift key. -- **KEY_CONTROL** = **16777238** --- Control key. +- **KEY_CTRL** = **16777238** --- Control key. - **KEY_META** = **16777239** --- Meta key. @@ -794,13 +1049,13 @@ enum **KeyList**: - **KEY_DIRECTION_R** = **16777267** --- Right Direction key. -- **KEY_BACK** = **16777280** --- Back key. +- **KEY_BACK** = **16777280** --- Media back key. Not to be confused with the Back button on an Android device. -- **KEY_FORWARD** = **16777281** --- Forward key. +- **KEY_FORWARD** = **16777281** --- Media forward key. -- **KEY_STOP** = **16777282** --- Stop key. +- **KEY_STOP** = **16777282** --- Media stop key. -- **KEY_REFRESH** = **16777283** --- Refresh key. +- **KEY_REFRESH** = **16777283** --- Media refresh key. - **KEY_VOLUMEDOWN** = **16777284** --- Volume down key. @@ -1182,7 +1437,7 @@ enum **KeyModifierMask**: - **KEY_MASK_CTRL** = **268435456** --- Ctrl key mask. -- **KEY_MASK_CMD** = **268435456** --- Command key mask. On macOS, this is equivalent to :ref:`KEY_MASK_META`. On other platforms, this is equivalent to :ref:`KEY_MASK_CTRL`. This mask should be preferred to :ref:`KEY_MASK_META` or :ref:`KEY_MASK_CTRL` for system shortcuts as it handles all platforms correctly. +- **KEY_MASK_CMD** = **platform-dependent** --- Command key mask. On macOS, this is equivalent to :ref:`KEY_MASK_META`. On other platforms, this is equivalent to :ref:`KEY_MASK_CTRL`. This mask should be preferred to :ref:`KEY_MASK_META` or :ref:`KEY_MASK_CTRL` for system shortcuts as it handles all platforms correctly. - **KEY_MASK_KPAD** = **536870912** --- Keypad key mask. @@ -1190,351 +1445,213 @@ enum **KeyModifierMask**: ---- -.. _enum_@GlobalScope_ButtonList: +.. _enum_@GlobalScope_MouseButton: -.. _class_@GlobalScope_constant_BUTTON_LEFT: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_LEFT: -.. _class_@GlobalScope_constant_BUTTON_RIGHT: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_RIGHT: -.. _class_@GlobalScope_constant_BUTTON_MIDDLE: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_MIDDLE: -.. _class_@GlobalScope_constant_BUTTON_XBUTTON1: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_XBUTTON1: -.. _class_@GlobalScope_constant_BUTTON_XBUTTON2: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_XBUTTON2: -.. _class_@GlobalScope_constant_BUTTON_WHEEL_UP: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_UP: -.. _class_@GlobalScope_constant_BUTTON_WHEEL_DOWN: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_DOWN: -.. _class_@GlobalScope_constant_BUTTON_WHEEL_LEFT: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_LEFT: -.. _class_@GlobalScope_constant_BUTTON_WHEEL_RIGHT: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_RIGHT: -.. _class_@GlobalScope_constant_BUTTON_MASK_LEFT: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_MASK_LEFT: -.. _class_@GlobalScope_constant_BUTTON_MASK_RIGHT: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_MASK_RIGHT: -.. _class_@GlobalScope_constant_BUTTON_MASK_MIDDLE: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_MASK_MIDDLE: -.. _class_@GlobalScope_constant_BUTTON_MASK_XBUTTON1: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_MASK_XBUTTON1: -.. _class_@GlobalScope_constant_BUTTON_MASK_XBUTTON2: +.. _class_@GlobalScope_constant_MOUSE_BUTTON_MASK_XBUTTON2: -enum **ButtonList**: +enum **MouseButton**: -- **BUTTON_LEFT** = **1** --- Left mouse button. +- **MOUSE_BUTTON_LEFT** = **1** --- Left mouse button. -- **BUTTON_RIGHT** = **2** --- Right mouse button. +- **MOUSE_BUTTON_RIGHT** = **2** --- Right mouse button. -- **BUTTON_MIDDLE** = **3** --- Middle mouse button. +- **MOUSE_BUTTON_MIDDLE** = **3** --- Middle mouse button. -- **BUTTON_XBUTTON1** = **8** --- Extra mouse button 1 (only present on some mice). +- **MOUSE_BUTTON_XBUTTON1** = **8** --- Extra mouse button 1 (only present on some mice). -- **BUTTON_XBUTTON2** = **9** --- Extra mouse button 2 (only present on some mice). +- **MOUSE_BUTTON_XBUTTON2** = **9** --- Extra mouse button 2 (only present on some mice). -- **BUTTON_WHEEL_UP** = **4** --- Mouse wheel up. +- **MOUSE_BUTTON_WHEEL_UP** = **4** --- Mouse wheel up. -- **BUTTON_WHEEL_DOWN** = **5** --- Mouse wheel down. +- **MOUSE_BUTTON_WHEEL_DOWN** = **5** --- Mouse wheel down. -- **BUTTON_WHEEL_LEFT** = **6** --- Mouse wheel left button (only present on some mice). +- **MOUSE_BUTTON_WHEEL_LEFT** = **6** --- Mouse wheel left button (only present on some mice). -- **BUTTON_WHEEL_RIGHT** = **7** --- Mouse wheel right button (only present on some mice). +- **MOUSE_BUTTON_WHEEL_RIGHT** = **7** --- Mouse wheel right button (only present on some mice). -- **BUTTON_MASK_LEFT** = **1** --- Left mouse button mask. +- **MOUSE_BUTTON_MASK_LEFT** = **1** --- Left mouse button mask. -- **BUTTON_MASK_RIGHT** = **2** --- Right mouse button mask. +- **MOUSE_BUTTON_MASK_RIGHT** = **2** --- Right mouse button mask. -- **BUTTON_MASK_MIDDLE** = **4** --- Middle mouse button mask. +- **MOUSE_BUTTON_MASK_MIDDLE** = **4** --- Middle mouse button mask. -- **BUTTON_MASK_XBUTTON1** = **128** --- Extra mouse button 1 mask. +- **MOUSE_BUTTON_MASK_XBUTTON1** = **128** --- Extra mouse button 1 mask. -- **BUTTON_MASK_XBUTTON2** = **256** --- Extra mouse button 2 mask. +- **MOUSE_BUTTON_MASK_XBUTTON2** = **256** --- Extra mouse button 2 mask. ---- -.. _enum_@GlobalScope_JoystickList: +.. _enum_@GlobalScope_JoyButton: -.. _class_@GlobalScope_constant_JOY_BUTTON_0: +.. _class_@GlobalScope_constant_JOY_BUTTON_INVALID: -.. _class_@GlobalScope_constant_JOY_BUTTON_1: +.. _class_@GlobalScope_constant_JOY_BUTTON_A: -.. _class_@GlobalScope_constant_JOY_BUTTON_2: +.. _class_@GlobalScope_constant_JOY_BUTTON_B: -.. _class_@GlobalScope_constant_JOY_BUTTON_3: +.. _class_@GlobalScope_constant_JOY_BUTTON_X: -.. _class_@GlobalScope_constant_JOY_BUTTON_4: +.. _class_@GlobalScope_constant_JOY_BUTTON_Y: -.. _class_@GlobalScope_constant_JOY_BUTTON_5: +.. _class_@GlobalScope_constant_JOY_BUTTON_BACK: -.. _class_@GlobalScope_constant_JOY_BUTTON_6: +.. _class_@GlobalScope_constant_JOY_BUTTON_GUIDE: -.. _class_@GlobalScope_constant_JOY_BUTTON_7: +.. _class_@GlobalScope_constant_JOY_BUTTON_START: -.. _class_@GlobalScope_constant_JOY_BUTTON_8: +.. _class_@GlobalScope_constant_JOY_BUTTON_LEFT_STICK: -.. _class_@GlobalScope_constant_JOY_BUTTON_9: +.. _class_@GlobalScope_constant_JOY_BUTTON_RIGHT_STICK: -.. _class_@GlobalScope_constant_JOY_BUTTON_10: +.. _class_@GlobalScope_constant_JOY_BUTTON_LEFT_SHOULDER: -.. _class_@GlobalScope_constant_JOY_BUTTON_11: +.. _class_@GlobalScope_constant_JOY_BUTTON_RIGHT_SHOULDER: -.. _class_@GlobalScope_constant_JOY_BUTTON_12: +.. _class_@GlobalScope_constant_JOY_BUTTON_DPAD_UP: -.. _class_@GlobalScope_constant_JOY_BUTTON_13: +.. _class_@GlobalScope_constant_JOY_BUTTON_DPAD_DOWN: -.. _class_@GlobalScope_constant_JOY_BUTTON_14: +.. _class_@GlobalScope_constant_JOY_BUTTON_DPAD_LEFT: -.. _class_@GlobalScope_constant_JOY_BUTTON_15: +.. _class_@GlobalScope_constant_JOY_BUTTON_DPAD_RIGHT: + +.. _class_@GlobalScope_constant_JOY_BUTTON_MISC1: + +.. _class_@GlobalScope_constant_JOY_BUTTON_PADDLE1: + +.. _class_@GlobalScope_constant_JOY_BUTTON_PADDLE2: + +.. _class_@GlobalScope_constant_JOY_BUTTON_PADDLE3: + +.. _class_@GlobalScope_constant_JOY_BUTTON_PADDLE4: + +.. _class_@GlobalScope_constant_JOY_BUTTON_TOUCHPAD: + +.. _class_@GlobalScope_constant_JOY_BUTTON_SDL_MAX: .. _class_@GlobalScope_constant_JOY_BUTTON_MAX: -.. _class_@GlobalScope_constant_JOY_SONY_CIRCLE: +enum **JoyButton**: -.. _class_@GlobalScope_constant_JOY_SONY_X: +- **JOY_BUTTON_INVALID** = **-1** --- An invalid game controller button. -.. _class_@GlobalScope_constant_JOY_SONY_SQUARE: +- **JOY_BUTTON_A** = **0** --- Game controller SDL button A. Corresponds to the bottom action button: Sony Cross, Xbox A, Nintendo B. -.. _class_@GlobalScope_constant_JOY_SONY_TRIANGLE: +- **JOY_BUTTON_B** = **1** --- Game controller SDL button B. Corresponds to the right action button: Sony Circle, Xbox B, Nintendo A. -.. _class_@GlobalScope_constant_JOY_XBOX_B: +- **JOY_BUTTON_X** = **2** --- Game controller SDL button X. Corresponds to the left action button: Sony Square, Xbox X, Nintendo Y. -.. _class_@GlobalScope_constant_JOY_XBOX_A: +- **JOY_BUTTON_Y** = **3** --- Game controller SDL button Y. Corresponds to the top action button: Sony Triangle, Xbox Y, Nintendo X. -.. _class_@GlobalScope_constant_JOY_XBOX_X: +- **JOY_BUTTON_BACK** = **4** --- Game controller SDL back button. Corresponds to the Sony Select, Xbox Back, Nintendo - button. -.. _class_@GlobalScope_constant_JOY_XBOX_Y: +- **JOY_BUTTON_GUIDE** = **5** --- Game controller SDL guide button. Corresponds to the Sony PS, Xbox Home button. -.. _class_@GlobalScope_constant_JOY_DS_A: +- **JOY_BUTTON_START** = **6** --- Game controller SDL start button. Corresponds to the Nintendo + button. -.. _class_@GlobalScope_constant_JOY_DS_B: +- **JOY_BUTTON_LEFT_STICK** = **7** --- Game controller SDL left stick button. Corresponds to the Sony L3, Xbox L/LS button. -.. _class_@GlobalScope_constant_JOY_DS_X: +- **JOY_BUTTON_RIGHT_STICK** = **8** --- Game controller SDL right stick button. Corresponds to the Sony R3, Xbox R/RS button. -.. _class_@GlobalScope_constant_JOY_DS_Y: +- **JOY_BUTTON_LEFT_SHOULDER** = **9** --- Game controller SDL left shoulder button. Corresponds to the Sony L1, Xbox LB button. -.. _class_@GlobalScope_constant_JOY_VR_GRIP: +- **JOY_BUTTON_RIGHT_SHOULDER** = **10** --- Game controller SDL right shoulder button. Corresponds to the Sony R1, Xbox RB button. -.. _class_@GlobalScope_constant_JOY_VR_PAD: +- **JOY_BUTTON_DPAD_UP** = **11** --- Game controller D-pad up button. -.. _class_@GlobalScope_constant_JOY_VR_TRIGGER: +- **JOY_BUTTON_DPAD_DOWN** = **12** --- Game controller D-pad down button. -.. _class_@GlobalScope_constant_JOY_OCULUS_AX: +- **JOY_BUTTON_DPAD_LEFT** = **13** --- Game controller D-pad left button. -.. _class_@GlobalScope_constant_JOY_OCULUS_BY: +- **JOY_BUTTON_DPAD_RIGHT** = **14** --- Game controller D-pad right button. -.. _class_@GlobalScope_constant_JOY_OCULUS_MENU: +- **JOY_BUTTON_MISC1** = **15** --- Game controller SDL miscellaneous button. Corresponds to Xbox share button, PS5 microphone button, Nintendo capture button. -.. _class_@GlobalScope_constant_JOY_OPENVR_MENU: +- **JOY_BUTTON_PADDLE1** = **16** --- Game controller SDL paddle 1 button. -.. _class_@GlobalScope_constant_JOY_SELECT: +- **JOY_BUTTON_PADDLE2** = **17** --- Game controller SDL paddle 2 button. -.. _class_@GlobalScope_constant_JOY_START: +- **JOY_BUTTON_PADDLE3** = **18** --- Game controller SDL paddle 3 button. -.. _class_@GlobalScope_constant_JOY_DPAD_UP: +- **JOY_BUTTON_PADDLE4** = **19** --- Game controller SDL paddle 4 button. -.. _class_@GlobalScope_constant_JOY_DPAD_DOWN: +- **JOY_BUTTON_TOUCHPAD** = **20** --- Game controller SDL touchpad button. -.. _class_@GlobalScope_constant_JOY_DPAD_LEFT: +- **JOY_BUTTON_SDL_MAX** = **21** --- The number of SDL game controller buttons. -.. _class_@GlobalScope_constant_JOY_DPAD_RIGHT: - -.. _class_@GlobalScope_constant_JOY_L: - -.. _class_@GlobalScope_constant_JOY_L2: - -.. _class_@GlobalScope_constant_JOY_L3: - -.. _class_@GlobalScope_constant_JOY_R: - -.. _class_@GlobalScope_constant_JOY_R2: - -.. _class_@GlobalScope_constant_JOY_R3: - -.. _class_@GlobalScope_constant_JOY_AXIS_0: - -.. _class_@GlobalScope_constant_JOY_AXIS_1: - -.. _class_@GlobalScope_constant_JOY_AXIS_2: - -.. _class_@GlobalScope_constant_JOY_AXIS_3: - -.. _class_@GlobalScope_constant_JOY_AXIS_4: - -.. _class_@GlobalScope_constant_JOY_AXIS_5: - -.. _class_@GlobalScope_constant_JOY_AXIS_6: - -.. _class_@GlobalScope_constant_JOY_AXIS_7: - -.. _class_@GlobalScope_constant_JOY_AXIS_8: - -.. _class_@GlobalScope_constant_JOY_AXIS_9: - -.. _class_@GlobalScope_constant_JOY_AXIS_MAX: - -.. _class_@GlobalScope_constant_JOY_ANALOG_LX: - -.. _class_@GlobalScope_constant_JOY_ANALOG_LY: - -.. _class_@GlobalScope_constant_JOY_ANALOG_RX: - -.. _class_@GlobalScope_constant_JOY_ANALOG_RY: - -.. _class_@GlobalScope_constant_JOY_ANALOG_L2: - -.. _class_@GlobalScope_constant_JOY_ANALOG_R2: - -.. _class_@GlobalScope_constant_JOY_VR_ANALOG_TRIGGER: - -.. _class_@GlobalScope_constant_JOY_VR_ANALOG_GRIP: - -.. _class_@GlobalScope_constant_JOY_OPENVR_TOUCHPADX: - -.. _class_@GlobalScope_constant_JOY_OPENVR_TOUCHPADY: - -enum **JoystickList**: - -- **JOY_BUTTON_0** = **0** --- Gamepad button 0. - -- **JOY_BUTTON_1** = **1** --- Gamepad button 1. - -- **JOY_BUTTON_2** = **2** --- Gamepad button 2. - -- **JOY_BUTTON_3** = **3** --- Gamepad button 3. - -- **JOY_BUTTON_4** = **4** --- Gamepad button 4. - -- **JOY_BUTTON_5** = **5** --- Gamepad button 5. - -- **JOY_BUTTON_6** = **6** --- Gamepad button 6. - -- **JOY_BUTTON_7** = **7** --- Gamepad button 7. - -- **JOY_BUTTON_8** = **8** --- Gamepad button 8. - -- **JOY_BUTTON_9** = **9** --- Gamepad button 9. - -- **JOY_BUTTON_10** = **10** --- Gamepad button 10. - -- **JOY_BUTTON_11** = **11** --- Gamepad button 11. - -- **JOY_BUTTON_12** = **12** --- Gamepad button 12. - -- **JOY_BUTTON_13** = **13** --- Gamepad button 13. - -- **JOY_BUTTON_14** = **14** --- Gamepad button 14. - -- **JOY_BUTTON_15** = **15** --- Gamepad button 15. - -- **JOY_BUTTON_MAX** = **16** --- Represents the maximum number of joystick buttons supported. - -- **JOY_SONY_CIRCLE** = **1** --- DualShock circle button. - -- **JOY_SONY_X** = **0** --- DualShock X button. - -- **JOY_SONY_SQUARE** = **2** --- DualShock square button. - -- **JOY_SONY_TRIANGLE** = **3** --- DualShock triangle button. - -- **JOY_XBOX_B** = **1** --- Xbox controller B button. - -- **JOY_XBOX_A** = **0** --- Xbox controller A button. - -- **JOY_XBOX_X** = **2** --- Xbox controller X button. - -- **JOY_XBOX_Y** = **3** --- Xbox controller Y button. - -- **JOY_DS_A** = **1** --- Nintendo controller A button. - -- **JOY_DS_B** = **0** --- Nintendo controller B button. - -- **JOY_DS_X** = **3** --- Nintendo controller X button. - -- **JOY_DS_Y** = **2** --- Nintendo controller Y button. - -- **JOY_VR_GRIP** = **2** --- Grip (side) buttons on a VR controller. - -- **JOY_VR_PAD** = **14** --- Push down on the touchpad or main joystick on a VR controller. - -- **JOY_VR_TRIGGER** = **15** --- Trigger on a VR controller. - -- **JOY_OCULUS_AX** = **7** --- A button on the right Oculus Touch controller, X button on the left controller (also when used in OpenVR). - -- **JOY_OCULUS_BY** = **1** --- B button on the right Oculus Touch controller, Y button on the left controller (also when used in OpenVR). - -- **JOY_OCULUS_MENU** = **3** --- Menu button on either Oculus Touch controller. - -- **JOY_OPENVR_MENU** = **1** --- Menu button in OpenVR (Except when Oculus Touch controllers are used). - -- **JOY_SELECT** = **10** --- Gamepad button Select. - -- **JOY_START** = **11** --- Gamepad button Start. - -- **JOY_DPAD_UP** = **12** --- Gamepad DPad up. - -- **JOY_DPAD_DOWN** = **13** --- Gamepad DPad down. - -- **JOY_DPAD_LEFT** = **14** --- Gamepad DPad left. - -- **JOY_DPAD_RIGHT** = **15** --- Gamepad DPad right. - -- **JOY_L** = **4** --- Gamepad left Shoulder button. - -- **JOY_L2** = **6** --- Gamepad left trigger. - -- **JOY_L3** = **8** --- Gamepad left stick click. - -- **JOY_R** = **5** --- Gamepad right Shoulder button. - -- **JOY_R2** = **7** --- Gamepad right trigger. - -- **JOY_R3** = **9** --- Gamepad right stick click. - -- **JOY_AXIS_0** = **0** --- Gamepad left stick horizontal axis. - -- **JOY_AXIS_1** = **1** --- Gamepad left stick vertical axis. - -- **JOY_AXIS_2** = **2** --- Gamepad right stick horizontal axis. - -- **JOY_AXIS_3** = **3** --- Gamepad right stick vertical axis. - -- **JOY_AXIS_4** = **4** --- Generic gamepad axis 4. - -- **JOY_AXIS_5** = **5** --- Generic gamepad axis 5. - -- **JOY_AXIS_6** = **6** --- Gamepad left trigger analog axis. - -- **JOY_AXIS_7** = **7** --- Gamepad right trigger analog axis. - -- **JOY_AXIS_8** = **8** --- Generic gamepad axis 8. - -- **JOY_AXIS_9** = **9** --- Generic gamepad axis 9. - -- **JOY_AXIS_MAX** = **10** --- Represents the maximum number of joystick axes supported. - -- **JOY_ANALOG_LX** = **0** --- Gamepad left stick horizontal axis. - -- **JOY_ANALOG_LY** = **1** --- Gamepad left stick vertical axis. - -- **JOY_ANALOG_RX** = **2** --- Gamepad right stick horizontal axis. - -- **JOY_ANALOG_RY** = **3** --- Gamepad right stick vertical axis. - -- **JOY_ANALOG_L2** = **6** --- Gamepad left analog trigger. - -- **JOY_ANALOG_R2** = **7** --- Gamepad right analog trigger. - -- **JOY_VR_ANALOG_TRIGGER** = **2** --- VR Controller analog trigger. - -- **JOY_VR_ANALOG_GRIP** = **4** --- VR Controller analog grip (side buttons). - -- **JOY_OPENVR_TOUCHPADX** = **0** --- OpenVR touchpad X axis (Joystick axis on Oculus Touch and Windows MR controllers). - -- **JOY_OPENVR_TOUCHPADY** = **1** --- OpenVR touchpad Y axis (Joystick axis on Oculus Touch and Windows MR controllers). +- **JOY_BUTTON_MAX** = **36** --- The maximum number of game controller buttons: Android supports up to 36 buttons. ---- -.. _enum_@GlobalScope_MidiMessageList: +.. _enum_@GlobalScope_JoyAxis: + +.. _class_@GlobalScope_constant_JOY_AXIS_INVALID: + +.. _class_@GlobalScope_constant_JOY_AXIS_LEFT_X: + +.. _class_@GlobalScope_constant_JOY_AXIS_LEFT_Y: + +.. _class_@GlobalScope_constant_JOY_AXIS_RIGHT_X: + +.. _class_@GlobalScope_constant_JOY_AXIS_RIGHT_Y: + +.. _class_@GlobalScope_constant_JOY_AXIS_TRIGGER_LEFT: + +.. _class_@GlobalScope_constant_JOY_AXIS_TRIGGER_RIGHT: + +.. _class_@GlobalScope_constant_JOY_AXIS_SDL_MAX: + +.. _class_@GlobalScope_constant_JOY_AXIS_MAX: + +enum **JoyAxis**: + +- **JOY_AXIS_INVALID** = **-1** --- An invalid game controller axis. + +- **JOY_AXIS_LEFT_X** = **0** --- Game controller left joystick x-axis. + +- **JOY_AXIS_LEFT_Y** = **1** --- Game controller left joystick y-axis. + +- **JOY_AXIS_RIGHT_X** = **2** --- Game controller right joystick x-axis. + +- **JOY_AXIS_RIGHT_Y** = **3** --- Game controller right joystick y-axis. + +- **JOY_AXIS_TRIGGER_LEFT** = **4** --- Game controller left trigger axis. + +- **JOY_AXIS_TRIGGER_RIGHT** = **5** --- Game controller right trigger axis. + +- **JOY_AXIS_SDL_MAX** = **6** --- The number of SDL game controller axes. + +- **JOY_AXIS_MAX** = **10** --- The maximum number of game controller axes: OpenVR supports up to 5 Joysticks making a total of 10 axes. + +---- + +.. _enum_@GlobalScope_MIDIMessage: .. _class_@GlobalScope_constant_MIDI_MESSAGE_NOTE_OFF: @@ -1550,7 +1667,7 @@ enum **JoystickList**: .. _class_@GlobalScope_constant_MIDI_MESSAGE_PITCH_BEND: -enum **MidiMessageList**: +enum **MIDIMessage**: - **MIDI_MESSAGE_NOTE_OFF** = **8** --- MIDI note OFF message. @@ -1678,10 +1795,10 @@ Since :ref:`OK` has value 0, and all other failu var err = method_that_returns_error() if err != OK: - print("Failure!) + print("Failure!") # Or, equivalent: if err: - print("Still failing!) + print("Still failing!") - **FAILED** = **1** --- Generic error. @@ -1787,10 +1904,10 @@ Since :ref:`OK` has value 0, and all other failu .. _class_@GlobalScope_constant_PROPERTY_HINT_RANGE: -.. _class_@GlobalScope_constant_PROPERTY_HINT_EXP_RANGE: - .. _class_@GlobalScope_constant_PROPERTY_HINT_ENUM: +.. _class_@GlobalScope_constant_PROPERTY_HINT_ENUM_SUGGESTION: + .. _class_@GlobalScope_constant_PROPERTY_HINT_EXP_EASING: .. _class_@GlobalScope_constant_PROPERTY_HINT_LENGTH: @@ -1803,10 +1920,14 @@ Since :ref:`OK` has value 0, and all other failu .. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_2D_PHYSICS: +.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_2D_NAVIGATION: + .. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_3D_RENDER: .. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_3D_PHYSICS: +.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_3D_NAVIGATION: + .. _class_@GlobalScope_constant_PROPERTY_HINT_FILE: .. _class_@GlobalScope_constant_PROPERTY_HINT_DIR: @@ -1827,56 +1948,147 @@ Since :ref:`OK` has value 0, and all other failu .. _class_@GlobalScope_constant_PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS: +.. _class_@GlobalScope_constant_PROPERTY_HINT_OBJECT_ID: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_TYPE_STRING: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_METHOD_OF_VARIANT_TYPE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_METHOD_OF_BASE_TYPE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_METHOD_OF_INSTANCE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_METHOD_OF_SCRIPT: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_PROPERTY_OF_BASE_TYPE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_PROPERTY_OF_INSTANCE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_PROPERTY_OF_SCRIPT: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_OBJECT_TOO_BIG: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_NODE_PATH_VALID_TYPES: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_SAVE_FILE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_INT_IS_OBJECTID: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_INT_IS_POINTER: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_ARRAY_TYPE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_MAX: + enum **PropertyHint**: - **PROPERTY_HINT_NONE** = **0** --- No hint for the edited property. - **PROPERTY_HINT_RANGE** = **1** --- Hints that an integer or float property should be within a range specified via the hint string ``"min,max"`` or ``"min,max,step"``. The hint string can optionally include ``"or_greater"`` and/or ``"or_lesser"`` to allow manual input going respectively above the max or below the min values. Example: ``"-360,360,1,or_greater,or_lesser"``. -- **PROPERTY_HINT_EXP_RANGE** = **2** --- Hints that an integer or float property should be within an exponential range specified via the hint string ``"min,max"`` or ``"min,max,step"``. The hint string can optionally include ``"or_greater"`` and/or ``"or_lesser"`` to allow manual input going respectively above the max or below the min values. Example: ``"0.01,100,0.01,or_greater"``. +Additionally, other keywords can be included: "exp" for exponential range editing, "radians" for editing radian angles in degrees, "degrees" to hint at an angle and "noslider" to hide the slider. -- **PROPERTY_HINT_ENUM** = **3** --- Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string such as ``"Hello,Something,Else"``. +- **PROPERTY_HINT_ENUM** = **2** --- Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string such as ``"Hello,Something,Else"``. + +- **PROPERTY_HINT_ENUM_SUGGESTION** = **3** --- Hints that a string property is can be an enumerated value to pick in a list specified via a hint string such as ``"Hello,Something,Else"``. + +Unlike :ref:`PROPERTY_HINT_ENUM` a property with this hint still accepts arbitrary values and can be empty. The list of values serves to suggest possible values. - **PROPERTY_HINT_EXP_EASING** = **4** --- Hints that a float property should be edited via an exponential easing function. The hint string can include ``"attenuation"`` to flip the curve horizontally and/or ``"inout"`` to also include in/out easing. - **PROPERTY_HINT_LENGTH** = **5** --- Deprecated hint, unused. -- **PROPERTY_HINT_KEY_ACCEL** = **7** --- Deprecated hint, unused. +- **PROPERTY_HINT_KEY_ACCEL** = **6** --- Deprecated hint, unused. -- **PROPERTY_HINT_FLAGS** = **8** --- Hints that an integer property is a bitmask with named bit flags. For example, to allow toggling bits 0, 1, 2 and 4, the hint could be something like ``"Bit0,Bit1,Bit2,,Bit4"``. +- **PROPERTY_HINT_FLAGS** = **7** --- Hints that an integer property is a bitmask with named bit flags. For example, to allow toggling bits 0, 1, 2 and 4, the hint could be something like ``"Bit0,Bit1,Bit2,,Bit4"``. -- **PROPERTY_HINT_LAYERS_2D_RENDER** = **9** --- Hints that an integer property is a bitmask using the optionally named 2D render layers. +- **PROPERTY_HINT_LAYERS_2D_RENDER** = **8** --- Hints that an integer property is a bitmask using the optionally named 2D render layers. -- **PROPERTY_HINT_LAYERS_2D_PHYSICS** = **10** --- Hints that an integer property is a bitmask using the optionally named 2D physics layers. +- **PROPERTY_HINT_LAYERS_2D_PHYSICS** = **9** --- Hints that an integer property is a bitmask using the optionally named 2D physics layers. + +- **PROPERTY_HINT_LAYERS_2D_NAVIGATION** = **10** --- Hints that an integer property is a bitmask using the optionally named 2D navigation layers. - **PROPERTY_HINT_LAYERS_3D_RENDER** = **11** --- Hints that an integer property is a bitmask using the optionally named 3D render layers. - **PROPERTY_HINT_LAYERS_3D_PHYSICS** = **12** --- Hints that an integer property is a bitmask using the optionally named 3D physics layers. -- **PROPERTY_HINT_FILE** = **13** --- Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like ``"*.png,*.jpg"``. +- **PROPERTY_HINT_LAYERS_3D_NAVIGATION** = **13** --- Hints that an integer property is a bitmask using the optionally named 2D navigation layers. -- **PROPERTY_HINT_DIR** = **14** --- Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. +- **PROPERTY_HINT_FILE** = **14** --- Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like ``"*.png,*.jpg"``. -- **PROPERTY_HINT_GLOBAL_FILE** = **15** --- Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like ``"*.png,*.jpg"``. +- **PROPERTY_HINT_DIR** = **15** --- Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. -- **PROPERTY_HINT_GLOBAL_DIR** = **16** --- Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. +- **PROPERTY_HINT_GLOBAL_FILE** = **16** --- Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like ``"*.png,*.jpg"``. -- **PROPERTY_HINT_RESOURCE_TYPE** = **17** --- Hints that a property is an instance of a :ref:`Resource`-derived type, optionally specified via the hint string (e.g. ``"Texture2D"``). Editing it will show a popup menu of valid resource types to instantiate. +- **PROPERTY_HINT_GLOBAL_DIR** = **17** --- Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. -- **PROPERTY_HINT_MULTILINE_TEXT** = **18** --- Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. +- **PROPERTY_HINT_RESOURCE_TYPE** = **18** --- Hints that a property is an instance of a :ref:`Resource`-derived type, optionally specified via the hint string (e.g. ``"Texture2D"``). Editing it will show a popup menu of valid resource types to instantiate. -- **PROPERTY_HINT_PLACEHOLDER_TEXT** = **19** --- Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use. +- **PROPERTY_HINT_MULTILINE_TEXT** = **19** --- Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. -- **PROPERTY_HINT_COLOR_NO_ALPHA** = **20** --- Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited. +- **PROPERTY_HINT_PLACEHOLDER_TEXT** = **20** --- Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use. -- **PROPERTY_HINT_IMAGE_COMPRESS_LOSSY** = **21** --- Hints that an image is compressed using lossy compression. +- **PROPERTY_HINT_COLOR_NO_ALPHA** = **21** --- Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited. -- **PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS** = **22** --- Hints that an image is compressed using lossless compression. +- **PROPERTY_HINT_IMAGE_COMPRESS_LOSSY** = **22** --- Hints that an image is compressed using lossy compression. + +- **PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS** = **23** --- Hints that an image is compressed using lossless compression. + +- **PROPERTY_HINT_OBJECT_ID** = **24** + +- **PROPERTY_HINT_TYPE_STRING** = **25** --- Hint that a property represents a particular type. If a property is :ref:`TYPE_STRING`, allows to set a type from the create dialog. If you need to create an :ref:`Array` to contain elements of a specific type, the ``hint_string`` must encode nested types using ``":"`` and ``"/"`` for specifying :ref:`Resource` types. For instance: + +:: + + hint_string = "%s:" % [TYPE_INT] # Array of inteters. + hint_string = "%s:%s:" % [TYPE_ARRAY, TYPE_REAL] # Two-dimensional array of floats. + hint_string = "%s/%s:Resource" % [TYPE_OBJECT, TYPE_OBJECT] # Array of resources. + hint_string = "%s:%s/%s:Resource" % [TYPE_ARRAY, TYPE_OBJECT, TYPE_OBJECT] # Two-dimensional array of resources. + +**Note:** The final colon is required to specify for properly detecting built-in types. + +- **PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE** = **26** + +- **PROPERTY_HINT_METHOD_OF_VARIANT_TYPE** = **27** + +- **PROPERTY_HINT_METHOD_OF_BASE_TYPE** = **28** + +- **PROPERTY_HINT_METHOD_OF_INSTANCE** = **29** + +- **PROPERTY_HINT_METHOD_OF_SCRIPT** = **30** + +- **PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE** = **31** + +- **PROPERTY_HINT_PROPERTY_OF_BASE_TYPE** = **32** + +- **PROPERTY_HINT_PROPERTY_OF_INSTANCE** = **33** + +- **PROPERTY_HINT_PROPERTY_OF_SCRIPT** = **34** + +- **PROPERTY_HINT_OBJECT_TOO_BIG** = **35** + +- **PROPERTY_HINT_NODE_PATH_VALID_TYPES** = **36** + +- **PROPERTY_HINT_SAVE_FILE** = **37** + +- **PROPERTY_HINT_INT_IS_OBJECTID** = **38** + +- **PROPERTY_HINT_INT_IS_POINTER** = **40** + +- **PROPERTY_HINT_ARRAY_TYPE** = **39** + +- **PROPERTY_HINT_MAX** = **41** ---- .. _enum_@GlobalScope_PropertyUsageFlags: +.. _class_@GlobalScope_constant_PROPERTY_USAGE_NONE: + .. _class_@GlobalScope_constant_PROPERTY_USAGE_STORAGE: .. _class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR: @@ -1895,12 +2107,46 @@ enum **PropertyHint**: .. _class_@GlobalScope_constant_PROPERTY_USAGE_CATEGORY: +.. _class_@GlobalScope_constant_PROPERTY_USAGE_SUBGROUP: + .. _class_@GlobalScope_constant_PROPERTY_USAGE_NO_INSTANCE_STATE: .. _class_@GlobalScope_constant_PROPERTY_USAGE_RESTART_IF_CHANGED: .. _class_@GlobalScope_constant_PROPERTY_USAGE_SCRIPT_VARIABLE: +.. _class_@GlobalScope_constant_PROPERTY_USAGE_STORE_IF_NULL: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_ANIMATE_AS_TRIGGER: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_CLASS_IS_ENUM: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_NIL_IS_VARIANT: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_INTERNAL: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_HIGH_END_GFX: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_KEYING_INCREMENTS: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_DEFERRED_SET_RESOURCE: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR_BASIC_SETTING: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_ARRAY: + .. _class_@GlobalScope_constant_PROPERTY_USAGE_DEFAULT: .. _class_@GlobalScope_constant_PROPERTY_USAGE_DEFAULT_INTL: @@ -1909,6 +2155,8 @@ enum **PropertyHint**: enum **PropertyUsageFlags**: +- **PROPERTY_USAGE_NONE** = **0** + - **PROPERTY_USAGE_STORAGE** = **1** --- The property is serialized and saved in the scene file (default). - **PROPERTY_USAGE_EDITOR** = **2** --- The property is shown in the editor inspector (default). @@ -1927,12 +2175,46 @@ enum **PropertyUsageFlags**: - **PROPERTY_USAGE_CATEGORY** = **256** --- Used to categorize properties together in the editor. +- **PROPERTY_USAGE_SUBGROUP** = **512** --- Used to group properties together in the editor in a subgroup (under a group). + - **PROPERTY_USAGE_NO_INSTANCE_STATE** = **2048** --- The property does not save its state in :ref:`PackedScene`. - **PROPERTY_USAGE_RESTART_IF_CHANGED** = **4096** --- Editing the property prompts the user for restarting the editor. - **PROPERTY_USAGE_SCRIPT_VARIABLE** = **8192** --- The property is a script variable which should be serialized and saved in the scene file. +- **PROPERTY_USAGE_STORE_IF_NULL** = **16384** + +- **PROPERTY_USAGE_ANIMATE_AS_TRIGGER** = **32768** + +- **PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED** = **65536** + +- **PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE** = **131072** + +- **PROPERTY_USAGE_CLASS_IS_ENUM** = **262144** + +- **PROPERTY_USAGE_NIL_IS_VARIANT** = **524288** + +- **PROPERTY_USAGE_INTERNAL** = **1048576** + +- **PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE** = **2097152** + +- **PROPERTY_USAGE_HIGH_END_GFX** = **4194304** + +- **PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT** = **8388608** + +- **PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT** = **16777216** + +- **PROPERTY_USAGE_KEYING_INCREMENTS** = **33554432** + +- **PROPERTY_USAGE_DEFERRED_SET_RESOURCE** = **67108864** + +- **PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT** = **134217728** + +- **PROPERTY_USAGE_EDITOR_BASIC_SETTING** = **268435456** + +- **PROPERTY_USAGE_ARRAY** = **1073741824** + - **PROPERTY_USAGE_DEFAULT** = **7** --- Default usage (storage, editor and network). - **PROPERTY_USAGE_DEFAULT_INTL** = **71** --- Default usage for translatable strings (storage, editor, network and internationalized). @@ -1957,6 +2239,10 @@ enum **PropertyUsageFlags**: .. _class_@GlobalScope_constant_METHOD_FLAG_FROM_SCRIPT: +.. _class_@GlobalScope_constant_METHOD_FLAG_STATIC: + +.. _class_@GlobalScope_constant_METHOD_FLAG_OBJECT_CORE: + .. _class_@GlobalScope_constant_METHOD_FLAGS_DEFAULT: enum **MethodFlags**: @@ -1975,10 +2261,50 @@ enum **MethodFlags**: - **METHOD_FLAG_FROM_SCRIPT** = **64** --- Deprecated method flag, unused. +- **METHOD_FLAG_STATIC** = **256** + +- **METHOD_FLAG_OBJECT_CORE** = **512** --- Used internally. Allows to not dump core virtuals such as ``_notification`` to the JSON API. + - **METHOD_FLAGS_DEFAULT** = **1** --- Default method flags. ---- +.. _enum_@GlobalScope_RPCMode: + +.. _class_@GlobalScope_constant_RPC_MODE_DISABLED: + +.. _class_@GlobalScope_constant_RPC_MODE_ANY_PEER: + +.. _class_@GlobalScope_constant_RPC_MODE_AUTH: + +enum **RPCMode**: + +- **RPC_MODE_DISABLED** = **0** --- Used with :ref:`Node.rpc_config` to disable a method or property for all RPC calls, making it unavailable. Default for all methods. + +- **RPC_MODE_ANY_PEER** = **1** --- Used with :ref:`Node.rpc_config` to set a method to be callable remotely by any peer. Analogous to the ``@rpc(any)`` annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not. + +- **RPC_MODE_AUTH** = **2** --- Used with :ref:`Node.rpc_config` to set a method to be callable remotely only by the current multiplayer authority (which is the server by default). Analogous to the ``@rpc(auth)`` annotation. See :ref:`Node.set_multiplayer_authority`. + +---- + +.. _enum_@GlobalScope_TransferMode: + +.. _class_@GlobalScope_constant_TRANSFER_MODE_UNRELIABLE: + +.. _class_@GlobalScope_constant_TRANSFER_MODE_UNRELIABLE_ORDERED: + +.. _class_@GlobalScope_constant_TRANSFER_MODE_RELIABLE: + +enum **TransferMode**: + +- **TRANSFER_MODE_UNRELIABLE** = **0** --- Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than :ref:`TRANSFER_MODE_UNRELIABLE_ORDERED`. Use for non-critical data, and always consider whether the order matters. + +- **TRANSFER_MODE_UNRELIABLE_ORDERED** = **1** --- Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than :ref:`TRANSFER_MODE_RELIABLE`. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data. + +- **TRANSFER_MODE_RELIABLE** = **2** --- Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially the slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly. + +---- + .. _enum_@GlobalScope_Variant.Type: .. _class_@GlobalScope_constant_TYPE_NIL: @@ -1987,7 +2313,7 @@ enum **MethodFlags**: .. _class_@GlobalScope_constant_TYPE_INT: -.. _class_@GlobalScope_constant_TYPE_REAL: +.. _class_@GlobalScope_constant_TYPE_FLOAT: .. _class_@GlobalScope_constant_TYPE_STRING: @@ -2007,13 +2333,13 @@ enum **MethodFlags**: .. _class_@GlobalScope_constant_TYPE_PLANE: -.. _class_@GlobalScope_constant_TYPE_QUAT: +.. _class_@GlobalScope_constant_TYPE_QUATERNION: .. _class_@GlobalScope_constant_TYPE_AABB: .. _class_@GlobalScope_constant_TYPE_BASIS: -.. _class_@GlobalScope_constant_TYPE_TRANSFORM: +.. _class_@GlobalScope_constant_TYPE_TRANSFORM3D: .. _class_@GlobalScope_constant_TYPE_COLOR: @@ -2061,7 +2387,7 @@ enum **Variant.Type**: - **TYPE_INT** = **2** --- Variable is of type :ref:`int`. -- **TYPE_REAL** = **3** --- Variable is of type :ref:`float` (real). +- **TYPE_FLOAT** = **3** --- Variable is of type :ref:`float` (real). - **TYPE_STRING** = **4** --- Variable is of type :ref:`String`. @@ -2081,13 +2407,13 @@ enum **Variant.Type**: - **TYPE_PLANE** = **12** --- Variable is of type :ref:`Plane`. -- **TYPE_QUAT** = **13** --- Variable is of type :ref:`Quat`. +- **TYPE_QUATERNION** = **13** --- Variable is of type :ref:`Quaternion`. - **TYPE_AABB** = **14** --- Variable is of type :ref:`AABB`. - **TYPE_BASIS** = **15** --- Variable is of type :ref:`Basis`. -- **TYPE_TRANSFORM** = **16** --- Variable is of type :ref:`Transform`. +- **TYPE_TRANSFORM3D** = **16** --- Variable is of type :ref:`Transform3D`. - **TYPE_COLOR** = **17** --- Variable is of type :ref:`Color`. @@ -2157,8 +2483,6 @@ enum **Variant.Type**: .. _class_@GlobalScope_constant_OP_MODULE: -.. _class_@GlobalScope_constant_OP_STRING_CONCAT: - .. _class_@GlobalScope_constant_OP_SHIFT_LEFT: .. _class_@GlobalScope_constant_OP_SHIFT_RIGHT: @@ -2211,31 +2535,29 @@ enum **Variant.Operator**: - **OP_MODULE** = **12** --- Remainder/modulo operator (``%``). -- **OP_STRING_CONCAT** = **13** --- String concatenation operator (``+``). +- **OP_SHIFT_LEFT** = **13** --- Left shift operator (``<<``). -- **OP_SHIFT_LEFT** = **14** --- Left shift operator (``<<``). +- **OP_SHIFT_RIGHT** = **14** --- Right shift operator (``>>``). -- **OP_SHIFT_RIGHT** = **15** --- Right shift operator (``>>``). +- **OP_BIT_AND** = **15** --- Bitwise AND operator (``&``). -- **OP_BIT_AND** = **16** --- Bitwise AND operator (``&``). +- **OP_BIT_OR** = **16** --- Bitwise OR operator (``|``). -- **OP_BIT_OR** = **17** --- Bitwise OR operator (``|``). +- **OP_BIT_XOR** = **17** --- Bitwise XOR operator (``^``). -- **OP_BIT_XOR** = **18** --- Bitwise XOR operator (``^``). +- **OP_BIT_NEGATE** = **18** --- Bitwise NOT operator (``~``). -- **OP_BIT_NEGATE** = **19** --- Bitwise NOT operator (``~``). +- **OP_AND** = **19** --- Logical AND operator (``and`` or ``&&``). -- **OP_AND** = **20** --- Logical AND operator (``and`` or ``&&``). +- **OP_OR** = **20** --- Logical OR operator (``or`` or ``||``). -- **OP_OR** = **21** --- Logical OR operator (``or`` or ``||``). +- **OP_XOR** = **21** --- Logical XOR operator (not implemented in GDScript). -- **OP_XOR** = **22** --- Logical XOR operator (not implemented in GDScript). +- **OP_NOT** = **22** --- Logical NOT operator (``not`` or ``!``). -- **OP_NOT** = **23** --- Logical NOT operator (``not`` or ``!``). +- **OP_IN** = **23** --- Logical IN operator (``in``). -- **OP_IN** = **24** --- Logical IN operator (``in``). - -- **OP_MAX** = **25** --- Represents the size of the :ref:`Variant.Operator` enum. +- **OP_MAX** = **24** --- Represents the size of the :ref:`Variant.Operator` enum. Constants --------- @@ -2247,14 +2569,6 @@ Constants Property Descriptions --------------------- -.. _class_@GlobalScope_property_ARVRServer: - -- :ref:`ARVRServer` **ARVRServer** - -The :ref:`ARVRServer` singleton. - ----- - .. _class_@GlobalScope_property_AudioServer: - :ref:`AudioServer` **AudioServer** @@ -2279,6 +2593,14 @@ The :ref:`ClassDB` singleton. ---- +.. _class_@GlobalScope_property_DisplayServer: + +- :ref:`DisplayServer` **DisplayServer** + +The :ref:`DisplayServer` singleton. + +---- + .. _class_@GlobalScope_property_Engine: - :ref:`Engine` **Engine** @@ -2287,11 +2609,27 @@ The :ref:`Engine` singleton. ---- -.. _class_@GlobalScope_property_Geometry: +.. _class_@GlobalScope_property_EngineDebugger: -- :ref:`Geometry` **Geometry** +- :ref:`EngineDebugger` **EngineDebugger** -The :ref:`Geometry` singleton. +The :ref:`EngineDebugger` singleton. + +---- + +.. _class_@GlobalScope_property_Geometry2D: + +- :ref:`Geometry2D` **Geometry2D** + +The :ref:`Geometry2D` singleton. + +---- + +.. _class_@GlobalScope_property_Geometry3D: + +- :ref:`Geometry3D` **Geometry3D** + +The :ref:`Geometry3D` singleton. ---- @@ -2299,7 +2637,7 @@ The :ref:`Geometry` singleton. - :ref:`GodotSharp` **GodotSharp** -The :ref:`GodotSharp` singleton. Only available when using Godot's Mono build. +The :ref:`GodotSharp` singleton. ---- @@ -2327,14 +2665,6 @@ The :ref:`InputMap` singleton. ---- -.. _class_@GlobalScope_property_JSON: - -- :ref:`JSON` **JSON** - -The :ref:`JSON` singleton. - ----- - .. _class_@GlobalScope_property_JavaClassWrapper: - :ref:`JavaClassWrapper` **JavaClassWrapper** @@ -2363,11 +2693,9 @@ The :ref:`Marshalls` singleton. ---- -.. _class_@GlobalScope_property_Navigation2DServer: +.. _class_@GlobalScope_property_NativeExtensionManager: -- :ref:`Navigation2DServer` **Navigation2DServer** - -The :ref:`Navigation2DServer` singleton. +- :ref:`NativeExtensionManager` **NativeExtensionManager** ---- @@ -2379,11 +2707,19 @@ The :ref:`NavigationMeshGenerator` singleton. ---- -.. _class_@GlobalScope_property_NavigationServer: +.. _class_@GlobalScope_property_NavigationServer2D: -- :ref:`NavigationServer` **NavigationServer** +- :ref:`NavigationServer2D` **NavigationServer2D** -The :ref:`NavigationServer` singleton. +The :ref:`NavigationServer2D` singleton. + +---- + +.. _class_@GlobalScope_property_NavigationServer3D: + +- :ref:`NavigationServer3D` **NavigationServer3D** + +The :ref:`NavigationServer2D` singleton. ---- @@ -2403,19 +2739,19 @@ The :ref:`Performance` singleton. ---- -.. _class_@GlobalScope_property_Physics2DServer: +.. _class_@GlobalScope_property_PhysicsServer2D: -- :ref:`Physics2DServer` **Physics2DServer** +- :ref:`PhysicsServer2D` **PhysicsServer2D** -The :ref:`Physics2DServer` singleton. +The :ref:`PhysicsServer2D` singleton. ---- -.. _class_@GlobalScope_property_PhysicsServer: +.. _class_@GlobalScope_property_PhysicsServer3D: -- :ref:`PhysicsServer` **PhysicsServer** +- :ref:`PhysicsServer3D` **PhysicsServer3D** -The :ref:`PhysicsServer` singleton. +The :ref:`PhysicsServer3D` singleton. ---- @@ -2427,6 +2763,14 @@ The :ref:`ProjectSettings` singleton. ---- +.. _class_@GlobalScope_property_RenderingServer: + +- :ref:`RenderingServer` **RenderingServer** + +The :ref:`RenderingServer` singleton. + +---- + .. _class_@GlobalScope_property_ResourceLoader: - :ref:`ResourceLoader` **ResourceLoader** @@ -2443,6 +2787,28 @@ The :ref:`ResourceSaver` singleton. ---- +.. _class_@GlobalScope_property_ResourceUID: + +- :ref:`ResourceUID` **ResourceUID** + +---- + +.. _class_@GlobalScope_property_TextServerManager: + +- :ref:`TextServerManager` **TextServerManager** + +The :ref:`TextServerManager` singleton. + +---- + +.. _class_@GlobalScope_property_Time: + +- :ref:`Time` **Time** + +The :ref:`Time` singleton. + +---- + .. _class_@GlobalScope_property_TranslationServer: - :ref:`TranslationServer` **TranslationServer** @@ -2451,17 +2817,1189 @@ The :ref:`TranslationServer` singleton. ---- -.. _class_@GlobalScope_property_VisualScriptEditor: +.. _class_@GlobalScope_property_VisualScriptCustomNodes: -- :ref:`VisualScriptEditor` **VisualScriptEditor** +- :ref:`VisualScriptCustomNodes` **VisualScriptCustomNodes** -The :ref:`VisualScriptEditor` singleton. +The :ref:`VisualScriptCustomNodes` singleton. ---- -.. _class_@GlobalScope_property_VisualServer: +.. _class_@GlobalScope_property_XRServer: -- :ref:`VisualServer` **VisualServer** +- :ref:`XRServer` **XRServer** -The :ref:`VisualServer` singleton. +The :ref:`XRServer` singleton. +Method Descriptions +------------------- + +.. _class_@GlobalScope_method_abs: + +- :ref:`Variant` **abs** **(** :ref:`Variant` x **)** + +---- + +.. _class_@GlobalScope_method_absf: + +- :ref:`float` **absf** **(** :ref:`float` x **)** + +Returns the absolute value of float parameter ``x`` (i.e. positive value). + +:: + + # a is 1.2 + var a = absf(-1.2) + +---- + +.. _class_@GlobalScope_method_absi: + +- :ref:`int` **absi** **(** :ref:`int` x **)** + +Returns the absolute value of int parameter ``x`` (i.e. positive value). + +:: + + # a is 1 + var a = absi(-1) + +---- + +.. _class_@GlobalScope_method_acos: + +- :ref:`float` **acos** **(** :ref:`float` x **)** + +Returns the arc cosine of ``x`` in radians. Use to get the angle of cosine ``x``. ``x`` must be between ``-1.0`` and ``1.0`` (inclusive), otherwise, :ref:`acos` will return :ref:`@GDScript.NAN`. + +:: + + # c is 0.523599 or 30 degrees if converted with rad2deg(c) + var c = acos(0.866025) + +---- + +.. _class_@GlobalScope_method_asin: + +- :ref:`float` **asin** **(** :ref:`float` x **)** + +Returns the arc sine of ``x`` in radians. Use to get the angle of sine ``x``. ``x`` must be between ``-1.0`` and ``1.0`` (inclusive), otherwise, :ref:`asin` will return :ref:`@GDScript.NAN`. + +:: + + # s is 0.523599 or 30 degrees if converted with rad2deg(s) + var s = asin(0.5) + +---- + +.. _class_@GlobalScope_method_atan: + +- :ref:`float` **atan** **(** :ref:`float` x **)** + +Returns the arc tangent of ``x`` in radians. Use it to get the angle from an angle's tangent in trigonometry. + +The method cannot know in which quadrant the angle should fall. See :ref:`atan2` if you have both ``y`` and ``x``. + +:: + + var a = atan(0.5) # a is 0.463648 + +If ``x`` is between ``-PI / 2`` and ``PI / 2`` (inclusive), ``atan(tan(x))`` is equal to ``x``. + +---- + +.. _class_@GlobalScope_method_atan2: + +- :ref:`float` **atan2** **(** :ref:`float` y, :ref:`float` x **)** + +Returns the arc tangent of ``y/x`` in radians. Use to get the angle of tangent ``y/x``. 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. + +:: + + var a = atan2(0, -1) # a is 3.141593 + +---- + +.. _class_@GlobalScope_method_bytes2var: + +- :ref:`Variant` **bytes2var** **(** :ref:`PackedByteArray` bytes **)** + +Decodes a byte array back to a :ref:`Variant` value, without decoding objects. + +**Note:** If you need object deserialization, see :ref:`bytes2var_with_objects`. + +---- + +.. _class_@GlobalScope_method_bytes2var_with_objects: + +- :ref:`Variant` **bytes2var_with_objects** **(** :ref:`PackedByteArray` bytes **)** + +Decodes a byte array back to a :ref:`Variant` value. Decoding objects is allowed. + +**Warning:** 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). + +---- + +.. _class_@GlobalScope_method_ceil: + +- :ref:`float` **ceil** **(** :ref:`float` x **)** + +Rounds ``x`` upward (towards positive infinity), returning the smallest whole number that is not less than ``x``. + +:: + + var i = ceil(1.45) # i is 2.0 + i = ceil(1.001) # i is 2.0 + +See also :ref:`floor`, :ref:`round`, and :ref:`snapped`. + +---- + +.. _class_@GlobalScope_method_clamp: + +- :ref:`Variant` **clamp** **(** :ref:`Variant` value, :ref:`Variant` min, :ref:`Variant` max **)** + +---- + +.. _class_@GlobalScope_method_clampf: + +- :ref:`float` **clampf** **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** + +Clamps the float ``value`` and returns a value not less than ``min`` and not more than ``max``. + +:: + + var speed = 42.1 + # a is 20.0 + var a = clampf(speed, 1.0, 20.0) + + speed = -10.0 + # a is -1.0 + a = clampf(speed, -1.0, 1.0) + +---- + +.. _class_@GlobalScope_method_clampi: + +- :ref:`int` **clampi** **(** :ref:`int` value, :ref:`int` min, :ref:`int` max **)** + +Clamps the integer ``value`` and returns a value not less than ``min`` and not more than ``max``. + +:: + + var speed = 42 + # a is 20 + var a = clampi(speed, 1, 20) + + speed = -10 + # a is -1 + a = clampi(speed, -1, 1) + +---- + +.. _class_@GlobalScope_method_cos: + +- :ref:`float` **cos** **(** :ref:`float` angle_rad **)** + +Returns the cosine of angle ``angle_rad`` in radians. + +:: + + cos(PI * 2) # Returns 1.0 + cos(PI) # Returns -1.0 + cos(deg2rad(90)) # Returns 0.0 + +---- + +.. _class_@GlobalScope_method_cosh: + +- :ref:`float` **cosh** **(** :ref:`float` x **)** + +Returns the hyperbolic cosine of ``x`` in radians. + +:: + + # Prints 1.543081 + print(cosh(1)) + +---- + +.. _class_@GlobalScope_method_db2linear: + +- :ref:`float` **db2linear** **(** :ref:`float` db **)** + +Converts from decibels to linear energy (audio). + +---- + +.. _class_@GlobalScope_method_deg2rad: + +- :ref:`float` **deg2rad** **(** :ref:`float` deg **)** + +Converts an angle expressed in degrees to radians. + +:: + + # r is 3.141593 + var r = deg2rad(180) + +---- + +.. _class_@GlobalScope_method_ease: + +- :ref:`float` **ease** **(** :ref:`float` x, :ref:`float` curve **)** + +Returns an "eased" value of ``x`` based on an easing function defined with ``curve``. This easing function is based on an exponent. The ``curve`` can be any floating-point number, with specific values leading to the following behaviors: + +:: + + - Lower than -1.0 (exclusive): Ease in-out + - 1.0: Linear + - Between -1.0 and 0.0 (exclusive): Ease out-in + - 0.0: Constant + - Between 0.0 to 1.0 (exclusive): Ease in + - 1.0: Linear + - Greater than 1.0 (exclusive): Ease out + +`ease() curve values cheatsheet `__ + +See also :ref:`smoothstep`. If you need to perform more advanced transitions, use :ref:`Tween` or :ref:`AnimationPlayer`. + +---- + +.. _class_@GlobalScope_method_error_string: + +- :ref:`String` **error_string** **(** :ref:`int` error **)** + +Returns a human-readable name for the given error code. + +---- + +.. _class_@GlobalScope_method_exp: + +- :ref:`float` **exp** **(** :ref:`float` x **)** + +The natural exponential function. It raises the mathematical constant **e** to the power of ``x`` and returns it. + +**e** has an approximate value of 2.71828, and can be obtained with ``exp(1)``. + +For exponents to other bases use the method :ref:`pow`. + +:: + + var a = exp(2) # Approximately 7.39 + +---- + +.. _class_@GlobalScope_method_floor: + +- :ref:`float` **floor** **(** :ref:`float` x **)** + +Rounds ``x`` downward (towards negative infinity), returning the largest whole number that is not more than ``x``. + +:: + + # a is 2.0 + var a = floor(2.99) + # a is -3.0 + a = floor(-2.99) + +See also :ref:`ceil`, :ref:`round`, and :ref:`snapped`. + +**Note:** This method returns a float. If you need an integer, you can use ``int(x)`` directly. + +---- + +.. _class_@GlobalScope_method_fmod: + +- :ref:`float` **fmod** **(** :ref:`float` x, :ref:`float` y **)** + +Returns the floating-point remainder of ``x/y``, keeping the sign of ``x``. + +:: + + # Remainder is 1.5 + var remainder = fmod(7, 5.5) + +For the integer remainder operation, use the ``%`` operator. + +---- + +.. _class_@GlobalScope_method_fposmod: + +- :ref:`float` **fposmod** **(** :ref:`float` x, :ref:`float` y **)** + +Returns the floating-point modulus of ``x/y`` that wraps equally in positive and negative. + +:: + + 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)]) + +Produces: + +:: + + -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 + +---- + +.. _class_@GlobalScope_method_hash: + +- :ref:`int` **hash** **(** :ref:`Variant` variable **)** + +Returns the integer hash of the variable passed. + +:: + + print(hash("a")) # Prints 177670 + +---- + +.. _class_@GlobalScope_method_instance_from_id: + +- :ref:`Object` **instance_from_id** **(** :ref:`int` instance_id **)** + +Returns the Object that corresponds to ``instance_id``. All Objects have a unique instance ID. + +:: + + var foo = "bar" + func _ready(): + var id = get_instance_id() + var inst = instance_from_id(id) + print(inst.foo) # Prints bar + +---- + +.. _class_@GlobalScope_method_inverse_lerp: + +- :ref:`float` **inverse_lerp** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** + +Returns a normalized value considering the given range. This is the opposite of :ref:`lerp`. + +:: + + 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. + +---- + +.. _class_@GlobalScope_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`float` a, :ref:`float` b **)** + +Returns ``true`` if ``a`` and ``b`` are approximately equal to each other. + +Here, approximately equal means that ``a`` and ``b`` 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. + +---- + +.. _class_@GlobalScope_method_is_inf: + +- :ref:`bool` **is_inf** **(** :ref:`float` x **)** + +Returns whether ``x`` is an infinity value (either positive infinity or negative infinity). + +---- + +.. _class_@GlobalScope_method_is_instance_id_valid: + +- :ref:`bool` **is_instance_id_valid** **(** :ref:`int` id **)** + +---- + +.. _class_@GlobalScope_method_is_instance_valid: + +- :ref:`bool` **is_instance_valid** **(** :ref:`Variant` instance **)** + +Returns whether ``instance`` is a valid object (e.g. has not been deleted from memory). + +---- + +.. _class_@GlobalScope_method_is_nan: + +- :ref:`bool` **is_nan** **(** :ref:`float` x **)** + +Returns whether ``x`` is a NaN ("Not a Number" or invalid) value. + +---- + +.. _class_@GlobalScope_method_is_zero_approx: + +- :ref:`bool` **is_zero_approx** **(** :ref:`float` x **)** + +Returns ``true`` if ``x`` is zero or almost zero. + +This method is faster than using :ref:`is_equal_approx` with one value as zero. + +---- + +.. _class_@GlobalScope_method_lerp: + +- :ref:`float` **lerp** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** + +Linearly interpolates between two values by a normalized value. This is the opposite of :ref:`inverse_lerp`. + +:: + + lerp(0, 4, 0.75) # Returns 3.0 + +---- + +.. _class_@GlobalScope_method_lerp_angle: + +- :ref:`float` **lerp_angle** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** + +Linearly interpolates between two angles (in radians) by a normalized value. + +Similar to :ref:`lerp`, but interpolates correctly when the angles wrap around :ref:`@GDScript.TAU`. + +:: + + 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 + +---- + +.. _class_@GlobalScope_method_linear2db: + +- :ref:`float` **linear2db** **(** :ref:`float` lin **)** + +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: + +:: + + # "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)) + +---- + +.. _class_@GlobalScope_method_log: + +- :ref:`float` **log** **(** :ref:`float` x **)** + +Natural logarithm. The amount of time needed to reach a certain level of continuous growth. + +**Note:** This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. + +:: + + log(10) # Returns 2.302585 + +**Note:** The logarithm of ``0`` returns ``-inf``, while negative values return ``-nan``. + +---- + +.. _class_@GlobalScope_method_max: + +- :ref:`Variant` **max** **(** ... **)** |vararg| + +Returns the maximum of the given values. This method can take any number of arguments. + +:: + + max(1, 7, 3, -6, 5) # Returns 7 + +---- + +.. _class_@GlobalScope_method_maxf: + +- :ref:`float` **maxf** **(** :ref:`float` a, :ref:`float` b **)** + +Returns the maximum of two float values. + +:: + + maxf(3.6, 24) # Returns 24.0 + maxf(-3.99, -4) # Returns -3.99 + +---- + +.. _class_@GlobalScope_method_maxi: + +- :ref:`int` **maxi** **(** :ref:`int` a, :ref:`int` b **)** + +Returns the maximum of two int values. + +:: + + maxi(1, 2) # Returns 2 + maxi(-3, -4) # Returns -3 + +---- + +.. _class_@GlobalScope_method_min: + +- :ref:`Variant` **min** **(** ... **)** |vararg| + +Returns the minimum of the given values. This method can take any number of arguments. + +:: + + min(1, 7, 3, -6, 5) # Returns -6 + +---- + +.. _class_@GlobalScope_method_minf: + +- :ref:`float` **minf** **(** :ref:`float` a, :ref:`float` b **)** + +Returns the minimum of two float values. + +:: + + minf(3.6, 24) # Returns 3.6 + minf(-3.99, -4) # Returns -4.0 + +---- + +.. _class_@GlobalScope_method_mini: + +- :ref:`int` **mini** **(** :ref:`int` a, :ref:`int` b **)** + +Returns the minimum of two int values. + +:: + + mini(1, 2) # Returns 1 + mini(-3, -4) # Returns -4 + +---- + +.. _class_@GlobalScope_method_move_toward: + +- :ref:`float` **move_toward** **(** :ref:`float` from, :ref:`float` to, :ref:`float` delta **)** + +Moves ``from`` toward ``to`` by the ``delta`` value. + +Use a negative ``delta`` value to move away. + +:: + + move_toward(5, 10, 4) # Returns 9 + move_toward(10, 5, 4) # Returns 6 + move_toward(10, 5, -1.5) # Returns 11.5 + +---- + +.. _class_@GlobalScope_method_nearest_po2: + +- :ref:`int` **nearest_po2** **(** :ref:`int` value **)** + +Returns the nearest equal or larger power of 2 for integer ``value``. + +In other words, returns the smallest value ``a`` where ``a = pow(2, n)`` such that ``value <= a`` for some non-negative integer ``n``. + +:: + + 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) + +**Warning:** Due to the way it is implemented, this function returns ``0`` rather than ``1`` for non-positive values of ``value`` (in reality, 1 is the smallest integer power of 2). + +---- + +.. _class_@GlobalScope_method_posmod: + +- :ref:`int` **posmod** **(** :ref:`int` x, :ref:`int` y **)** + +Returns the integer modulus of ``x/y`` that wraps equally in positive and negative. + +:: + + for i in range(-3, 4): + print("%2d %2d %2d" % [i, i % 3, posmod(i, 3)]) + +Produces: + +:: + + -3 0 0 + -2 -2 1 + -1 -1 2 + 0 0 0 + 1 1 1 + 2 2 2 + 3 0 0 + +---- + +.. _class_@GlobalScope_method_pow: + +- :ref:`float` **pow** **(** :ref:`float` base, :ref:`float` exp **)** + +Returns the result of ``base`` raised to the power of ``exp``. + +:: + + pow(2, 5) # Returns 32 + +---- + +.. _class_@GlobalScope_method_print: + +- void **print** **(** ... **)** |vararg| + +Converts one or more arguments of any type to string in the best way possible and prints them to the console. + +:: + + var a = [1, 2, 3] + print("a", "b", a) # Prints ab[1, 2, 3] + +**Note:** Consider using :ref:`push_error` and :ref:`push_warning` to print error and warning messages instead of :ref:`print`. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. + +---- + +.. _class_@GlobalScope_method_print_verbose: + +- void **print_verbose** **(** ... **)** |vararg| + +If verbose mode is enabled (:ref:`OS.is_stdout_verbose` returning ``true``), converts one or more arguments of any type to string in the best way possible and prints them to the console. + +---- + +.. _class_@GlobalScope_method_printerr: + +- void **printerr** **(** ... **)** |vararg| + +Prints one or more arguments to strings in the best way possible to standard error line. + +:: + + printerr("prints to stderr") + +---- + +.. _class_@GlobalScope_method_printraw: + +- void **printraw** **(** ... **)** |vararg| + +Prints one or more arguments to strings in the best way possible to console. No newline is added at the end. + +:: + + printraw("A") + printraw("B") + # Prints AB + +**Note:** 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 :ref:`print`. + +---- + +.. _class_@GlobalScope_method_prints: + +- void **prints** **(** ... **)** |vararg| + +Prints one or more arguments to the console with a space between each argument. + +:: + + prints("A", "B", "C") # Prints A B C + +---- + +.. _class_@GlobalScope_method_printt: + +- void **printt** **(** ... **)** |vararg| + +Prints one or more arguments to the console with a tab between each argument. + +:: + + printt("A", "B", "C") # Prints A B C + +---- + +.. _class_@GlobalScope_method_push_error: + +- void **push_error** **(** ... **)** |vararg| + +Pushes an error message to Godot's built-in debugger and to the OS terminal. + +:: + + push_error("test error") # Prints "test error" to debugger and terminal as error call + +**Note:** Errors printed this way will not pause project execution. To print an error message and pause project execution in debug builds, use ``assert(false, "test error")`` instead. + +---- + +.. _class_@GlobalScope_method_push_warning: + +- void **push_warning** **(** ... **)** |vararg| + +Pushes a warning message to Godot's built-in debugger and to the OS terminal. + +:: + + push_warning("test warning") # Prints "test warning" to debugger and terminal as warning call + +---- + +.. _class_@GlobalScope_method_rad2deg: + +- :ref:`float` **rad2deg** **(** :ref:`float` rad **)** + +Converts an angle expressed in radians to degrees. + +:: + + rad2deg(0.523599) # Returns 30 + +---- + +.. _class_@GlobalScope_method_rand_from_seed: + +- :ref:`PackedInt64Array` **rand_from_seed** **(** :ref:`int` seed **)** + +Random from seed: pass a ``seed``, 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. + +---- + +.. _class_@GlobalScope_method_randf: + +- :ref:`float` **randf** **(** **)** + +Returns a random floating point value between ``0.0`` and ``1.0`` (inclusive). + +:: + + randf() # Returns e.g. 0.375671 + +---- + +.. _class_@GlobalScope_method_randf_range: + +- :ref:`float` **randf_range** **(** :ref:`float` from, :ref:`float` to **)** + +Returns a random floating point value on the interval between ``from`` and ``to`` (inclusive). + +:: + + prints(randf_range(-10, 10), randf_range(-10, 10)) # Prints e.g. -3.844535 7.45315 + +---- + +.. _class_@GlobalScope_method_randi: + +- :ref:`int` **randi** **(** **)** + +Returns a random unsigned 32-bit integer. Use remainder to obtain a random value in the interval ``[0, N - 1]`` (where N is smaller than 2^32). + +:: + + 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 + +---- + +.. _class_@GlobalScope_method_randi_range: + +- :ref:`int` **randi_range** **(** :ref:`int` from, :ref:`int` to **)** + +Returns a random signed 32-bit integer between ``from`` and ``to`` (inclusive). If ``to`` is lesser than ``from``, they are swapped. + +:: + + print(randi_range(0, 1)) # Prints 0 or 1 + print(randi_range(-10, 1000)) # Prints any number from -10 to 1000 + +---- + +.. _class_@GlobalScope_method_randomize: + +- void **randomize** **(** **)** + +Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. + +**Note:** This method is called automatically when the project is run. If you need to fix the seed to have reproducible results, use :ref:`seed` to initialize the random number generator. + +---- + +.. _class_@GlobalScope_method_range_lerp: + +- :ref:`float` **range_lerp** **(** :ref:`float` value, :ref:`float` istart, :ref:`float` istop, :ref:`float` ostart, :ref:`float` ostop **)** + +Maps a ``value`` from range ``[istart, istop]`` to ``[ostart, ostop]``. + +:: + + range_lerp(75, 0, 100, -1, 1) # Returns 0.5 + +---- + +.. _class_@GlobalScope_method_range_step_decimals: + +- :ref:`int` **range_step_decimals** **(** :ref:`float` x **)** + +---- + +.. _class_@GlobalScope_method_rid_allocate_id: + +- :ref:`int` **rid_allocate_id** **(** **)** + +Allocate a unique ID which can be used by the implementation to construct a RID. This is used mainly from native extensions to implement servers. + +---- + +.. _class_@GlobalScope_method_rid_from_int64: + +- :ref:`RID` **rid_from_int64** **(** :ref:`int` base **)** + +Create a RID from an int64. This is used mainly from native extensions to build servers. + +---- + +.. _class_@GlobalScope_method_round: + +- :ref:`float` **round** **(** :ref:`float` x **)** + +Rounds ``x`` to the nearest whole number, with halfway cases rounded away from zero. + +:: + + round(2.6) # Returns 3 + +See also :ref:`floor`, :ref:`ceil`, and :ref:`snapped`. + +---- + +.. _class_@GlobalScope_method_seed: + +- void **seed** **(** :ref:`int` base **)** + +Sets seed for the random number generator. + +:: + + var my_seed = "Godot Rocks" + seed(my_seed.hash()) + +---- + +.. _class_@GlobalScope_method_sign: + +- :ref:`Variant` **sign** **(** :ref:`Variant` x **)** + +---- + +.. _class_@GlobalScope_method_signf: + +- :ref:`float` **signf** **(** :ref:`float` x **)** + +Returns the sign of ``x`` as a float: -1.0 or 1.0. Returns 0.0 if ``x`` is 0. + +:: + + sign(-6.0) # Returns -1.0 + sign(0.0) # Returns 0.0 + sign(6.0) # Returns 1.0 + +---- + +.. _class_@GlobalScope_method_signi: + +- :ref:`int` **signi** **(** :ref:`int` x **)** + +Returns the sign of ``x`` as an integer: -1 or 1. Returns 0 if ``x`` is 0. + +:: + + sign(-6) # Returns -1 + sign(0) # Returns 0 + sign(6) # Returns 1 + +---- + +.. _class_@GlobalScope_method_sin: + +- :ref:`float` **sin** **(** :ref:`float` angle_rad **)** + +Returns the sine of angle ``angle_rad`` in radians. + +:: + + sin(0.523599) # Returns 0.5 + sin(deg2rad(90)) # Returns 1.0 + +---- + +.. _class_@GlobalScope_method_sinh: + +- :ref:`float` **sinh** **(** :ref:`float` x **)** + +Returns the hyperbolic sine of ``x``. + +:: + + var a = log(2.0) # Returns 0.693147 + sinh(a) # Returns 0.75 + +---- + +.. _class_@GlobalScope_method_smoothstep: + +- :ref:`float` **smoothstep** **(** :ref:`float` from, :ref:`float` to, :ref:`float` x **)** + +Returns the result of smoothly interpolating the value of ``x`` between ``0`` and ``1``, based on the where ``x`` lies with respect to the edges ``from`` and ``to``. + +The return value is ``0`` if ``x <= from``, and ``1`` if ``x >= to``. If ``x`` lies between ``from`` and ``to``, the returned value follows an S-shaped curve that maps ``x`` between ``0`` and ``1``. + +This S-shaped curve is the cubic Hermite interpolator, given by ``f(y) = 3*y^2 - 2*y^3`` where ``y = (x-from) / (to-from)``. + +:: + + 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 + +Compared to :ref:`ease` with a curve value of ``-1.6521``, :ref:`smoothstep` returns the smoothest possible curve with no sudden changes in the derivative. If you need to perform more advanced transitions, use :ref:`Tween` or :ref:`AnimationPlayer`. + +`Comparison between smoothstep() and ease(x, -1.6521) return values `__ + +---- + +.. _class_@GlobalScope_method_snapped: + +- :ref:`float` **snapped** **(** :ref:`float` x, :ref:`float` step **)** + +Snaps float value ``x`` to a given ``step``. This can also be used to round a floating point number to an arbitrary number of decimals. + +:: + + snapped(100, 32) # Returns 96 + snapped(3.14159, 0.01) # Returns 3.14 + +See also :ref:`ceil`, :ref:`floor`, and :ref:`round`. + +---- + +.. _class_@GlobalScope_method_sqrt: + +- :ref:`float` **sqrt** **(** :ref:`float` x **)** + +Returns the square root of ``x``, where ``x`` is a non-negative number. + +:: + + sqrt(9) # Returns 3 + +**Note:** Negative values of ``x`` return NaN. If you need negative inputs, use ``System.Numerics.Complex`` in C#. + +---- + +.. _class_@GlobalScope_method_step_decimals: + +- :ref:`int` **step_decimals** **(** :ref:`float` x **)** + +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. + +:: + + # n is 0 + var n = step_decimals(5) + # n is 4 + n = step_decimals(1.0005) + # n is 9 + n = step_decimals(0.000000005) + +---- + +.. _class_@GlobalScope_method_str: + +- :ref:`String` **str** **(** ... **)** |vararg| + +Converts one or more arguments of any type to string in the best way possible. + +---- + +.. _class_@GlobalScope_method_str2var: + +- :ref:`Variant` **str2var** **(** :ref:`String` string **)** + +Converts a formatted string that was returned by :ref:`var2str` to the original value. + +:: + + var a = '{ "a": 1, "b": 2 }' + var b = str2var(a) + print(b["a"]) # Prints 1 + +---- + +.. _class_@GlobalScope_method_tan: + +- :ref:`float` **tan** **(** :ref:`float` angle_rad **)** + +Returns the tangent of angle ``angle_rad`` in radians. + +:: + + tan(deg2rad(45)) # Returns 1 + +---- + +.. _class_@GlobalScope_method_tanh: + +- :ref:`float` **tanh** **(** :ref:`float` x **)** + +Returns the hyperbolic tangent of ``x``. + +:: + + var a = log(2.0) # Returns 0.693147 + tanh(a) # Returns 0.6 + +---- + +.. _class_@GlobalScope_method_typeof: + +- :ref:`int` **typeof** **(** :ref:`Variant` variable **)** + +Returns the internal type of the given Variant object, using the :ref:`Variant.Type` values. + +:: + + var json = JSON.new() + json.parse('["a", "b", "c"]') + var result = json.get_data() + if typeof(result) == TYPE_ARRAY: + print(result[0]) # Prints a + else: + print("Unexpected result") + +---- + +.. _class_@GlobalScope_method_var2bytes: + +- :ref:`PackedByteArray` **var2bytes** **(** :ref:`Variant` variable **)** + +Encodes a :ref:`Variant` value to a byte array, without encoding objects. Deserialization can be done with :ref:`bytes2var`. + +**Note:** If you need object serialization, see :ref:`var2bytes_with_objects`. + +---- + +.. _class_@GlobalScope_method_var2bytes_with_objects: + +- :ref:`PackedByteArray` **var2bytes_with_objects** **(** :ref:`Variant` variable **)** + +Encodes a :ref:`Variant` value to a byte array. Encoding objects is allowed (and can potentially include code). Deserialization can be done with :ref:`bytes2var_with_objects`. + +---- + +.. _class_@GlobalScope_method_var2str: + +- :ref:`String` **var2str** **(** :ref:`Variant` variable **)** + +Converts a Variant ``variable`` to a formatted string that can later be parsed using :ref:`str2var`. + +:: + + a = { "a": 1, "b": 2 } + print(var2str(a)) + +prints + +:: + + { + "a": 1, + "b": 2 + } + +---- + +.. _class_@GlobalScope_method_weakref: + +- :ref:`Variant` **weakref** **(** :ref:`Variant` obj **)** + +Returns a weak reference to an object, or ``null`` 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. + +---- + +.. _class_@GlobalScope_method_wrapf: + +- :ref:`float` **wrapf** **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** + +Wraps float ``value`` between ``min`` and ``max``. + +Usable for creating loop-alike behavior or infinite surfaces. + +:: + + # Infinite loop between 5.0 and 9.9 + value = wrapf(value + 0.1, 5.0, 10.0) + +:: + + # Infinite rotation (in radians) + angle = wrapf(angle + 0.1, 0.0, TAU) + +:: + + # Infinite rotation (in radians) + angle = wrapf(angle + 0.1, -PI, PI) + +**Note:** If ``min`` is ``0``, this is equivalent to :ref:`fposmod`, so prefer using that instead. + +``wrapf`` is more flexible than using the :ref:`fposmod` approach by giving the user control over the minimum value. + +---- + +.. _class_@GlobalScope_method_wrapi: + +- :ref:`int` **wrapi** **(** :ref:`int` value, :ref:`int` min, :ref:`int` max **)** + +Wraps integer ``value`` between ``min`` and ``max``. + +Usable for creating loop-alike behavior or infinite surfaces. + +:: + + # Infinite loop between 5 and 9 + frame = wrapi(frame + 1, 5, 10) + +:: + + # result is -2 + var result = wrapi(-6, -5, -1) + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_@nativescript.rst b/classes/class_@nativescript.rst deleted file mode 100644 index aa731484b..000000000 --- a/classes/class_@nativescript.rst +++ /dev/null @@ -1,13 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the @NativeScript.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_@NativeScript: - -@NativeScript -============= - - - diff --git a/classes/class_@visualscript.rst b/classes/class_@visualscript.rst deleted file mode 100644 index 323db2046..000000000 --- a/classes/class_@visualscript.rst +++ /dev/null @@ -1,18 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the @VisualScript.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_@VisualScript: - -@VisualScript -============= - -Built-in visual script functions. - -Description ------------ - -A list of built-in visual script functions, see :ref:`VisualScriptBuiltinFunc` and :ref:`VisualScript`. - diff --git a/classes/class_aabb.rst b/classes/class_aabb.rst index 177bb571b..066286e9a 100644 --- a/classes/class_aabb.rst +++ b/classes/class_aabb.rst @@ -14,72 +14,100 @@ Axis-Aligned Bounding Box. 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 :ref:`Rect2`. + +**Note:** Unlike :ref:`Rect2`, ``AABB`` does not have a variant that uses integer coordinates. Tutorials --------- - :doc:`../tutorials/math/index` +- :doc:`../tutorials/math/vector_math` + +- :doc:`../tutorials/math/vectors_advanced` + Properties ---------- -+-------------------------------+-----------------------------------------------+------------------------+ -| :ref:`Vector3` | :ref:`end` | ``Vector3( 0, 0, 0 )`` | -+-------------------------------+-----------------------------------------------+------------------------+ -| :ref:`Vector3` | :ref:`position` | ``Vector3( 0, 0, 0 )`` | -+-------------------------------+-----------------------------------------------+------------------------+ -| :ref:`Vector3` | :ref:`size` | ``Vector3( 0, 0, 0 )`` | -+-------------------------------+-----------------------------------------------+------------------------+ ++-------------------------------+-----------------------------------------------+----------------------+ +| :ref:`Vector3` | :ref:`end` | ``Vector3(0, 0, 0)`` | ++-------------------------------+-----------------------------------------------+----------------------+ +| :ref:`Vector3` | :ref:`position` | ``Vector3(0, 0, 0)`` | ++-------------------------------+-----------------------------------------------+----------------------+ +| :ref:`Vector3` | :ref:`size` | ``Vector3(0, 0, 0)`` | ++-------------------------------+-----------------------------------------------+----------------------+ Methods ------- -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AABB` | :ref:`AABB` **(** :ref:`Vector3` position, :ref:`Vector3` size **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`encloses` **(** :ref:`AABB` with **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AABB` | :ref:`expand` **(** :ref:`Vector3` to_point **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_area` **(** **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`get_endpoint` **(** :ref:`int` idx **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`get_longest_axis` **(** **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_longest_axis_index` **(** **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_longest_axis_size` **(** **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`get_shortest_axis` **(** **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_shortest_axis_index` **(** **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_shortest_axis_size` **(** **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`get_support` **(** :ref:`Vector3` dir **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AABB` | :ref:`grow` **(** :ref:`float` by **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_no_area` **(** **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_no_surface` **(** **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_point` **(** :ref:`Vector3` point **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AABB` | :ref:`intersection` **(** :ref:`AABB` with **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`intersects` **(** :ref:`AABB` with **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`intersects_plane` **(** :ref:`Plane` plane **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`intersects_segment` **(** :ref:`Vector3` from, :ref:`Vector3` to **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`AABB` aabb **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AABB` | :ref:`merge` **(** :ref:`AABB` with **)** | -+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`AABB` **(** **)** |constructor| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`AABB` **(** :ref:`AABB` from **)** |constructor| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`AABB` **(** :ref:`Vector3` position, :ref:`Vector3` size **)** |constructor| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`abs` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`encloses` **(** :ref:`AABB` with **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`expand` **(** :ref:`Vector3` to_point **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_area` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_center` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_endpoint` **(** :ref:`int` idx **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_longest_axis` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_longest_axis_index` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_longest_axis_size` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_shortest_axis` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_shortest_axis_index` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_shortest_axis_size` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_support` **(** :ref:`Vector3` dir **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`grow` **(** :ref:`float` by **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_no_area` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_no_surface` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_point` **(** :ref:`Vector3` point **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`intersection` **(** :ref:`AABB` with **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`intersects` **(** :ref:`AABB` with **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`intersects_plane` **(** :ref:`Plane` plane **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`intersects_ray` **(** :ref:`Vector3` from, :ref:`Vector3` dir **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`intersects_segment` **(** :ref:`Vector3` from, :ref:`Vector3` to **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`AABB` aabb **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`merge` **(** :ref:`AABB` with **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator !=** **(** **)** |operator| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator !=** **(** :ref:`AABB` right **)** |operator| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | **operator *** **(** :ref:`Transform3D` right **)** |operator| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator ==** **(** **)** |operator| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator ==** **(** :ref:`AABB` right **)** |operator| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- @@ -88,11 +116,11 @@ Property Descriptions - :ref:`Vector3` **end** -+-----------+------------------------+ -| *Default* | ``Vector3( 0, 0, 0 )`` | -+-----------+------------------------+ ++-----------+----------------------+ +| *Default* | ``Vector3(0, 0, 0)`` | ++-----------+----------------------+ -Ending corner. This is calculated as ``position + size``. Changing this property changes :ref:`size` accordingly. +Ending corner. This is calculated as ``position + size``. Setting this value will change the size. ---- @@ -100,11 +128,11 @@ Ending corner. This is calculated as ``position + size``. Changing this property - :ref:`Vector3` **position** -+-----------+------------------------+ -| *Default* | ``Vector3( 0, 0, 0 )`` | -+-----------+------------------------+ ++-----------+----------------------+ +| *Default* | ``Vector3(0, 0, 0)`` | ++-----------+----------------------+ -Beginning corner. +Beginning corner. Typically has values lower than :ref:`end`. ---- @@ -112,26 +140,48 @@ Beginning corner. - :ref:`Vector3` **size** -+-----------+------------------------+ -| *Default* | ``Vector3( 0, 0, 0 )`` | -+-----------+------------------------+ ++-----------+----------------------+ +| *Default* | ``Vector3(0, 0, 0)`` | ++-----------+----------------------+ -Size from position to end. +Size from :ref:`position` to :ref:`end`. Typically, all components are positive. + +If the size is negative, you can use :ref:`abs` to fix it. Method Descriptions ------------------- .. _class_AABB_method_AABB: -- :ref:`AABB` **AABB** **(** :ref:`Vector3` position, :ref:`Vector3` size **)** +- :ref:`AABB` **AABB** **(** **)** |constructor| -Optional constructor, accepts position and size. +Constructs a default-initialized ``AABB`` with default (zero) values of :ref:`position` and :ref:`size`. + +---- + +- :ref:`AABB` **AABB** **(** :ref:`AABB` from **)** |constructor| + +Constructs an ``AABB`` as a copy of the given ``AABB``. + +---- + +- :ref:`AABB` **AABB** **(** :ref:`Vector3` position, :ref:`Vector3` size **)** |constructor| + +Constructs an ``AABB`` from a position and size. + +---- + +.. _class_AABB_method_abs: + +- :ref:`AABB` **abs** **(** **)** |const| + +Returns an AABB with equivalent position and size, modified so that the most-negative corner is the origin and the size is positive. ---- .. _class_AABB_method_encloses: -- :ref:`bool` **encloses** **(** :ref:`AABB` with **)** +- :ref:`bool` **encloses** **(** :ref:`AABB` with **)** |const| Returns ``true`` if this ``AABB`` completely encloses another one. @@ -139,7 +189,7 @@ Returns ``true`` if this ``AABB`` completely encloses another one. .. _class_AABB_method_expand: -- :ref:`AABB` **expand** **(** :ref:`Vector3` to_point **)** +- :ref:`AABB` **expand** **(** :ref:`Vector3` to_point **)** |const| Returns this ``AABB`` expanded to include a given point. @@ -147,15 +197,23 @@ Returns this ``AABB`` expanded to include a given point. .. _class_AABB_method_get_area: -- :ref:`float` **get_area** **(** **)** +- :ref:`float` **get_area** **(** **)** |const| Returns the volume of the ``AABB``. ---- +.. _class_AABB_method_get_center: + +- :ref:`Vector3` **get_center** **(** **)** |const| + +Returns the center of the ``AABB``, which is equal to :ref:`position` + (:ref:`size` / 2). + +---- + .. _class_AABB_method_get_endpoint: -- :ref:`Vector3` **get_endpoint** **(** :ref:`int` idx **)** +- :ref:`Vector3` **get_endpoint** **(** :ref:`int` idx **)** |const| Gets the position of the 8 endpoints of the ``AABB`` in space. @@ -163,7 +221,7 @@ Gets the position of the 8 endpoints of the ``AABB`` in space. .. _class_AABB_method_get_longest_axis: -- :ref:`Vector3` **get_longest_axis** **(** **)** +- :ref:`Vector3` **get_longest_axis** **(** **)** |const| Returns the normalized longest axis of the ``AABB``. @@ -171,7 +229,7 @@ Returns the normalized longest axis of the ``AABB``. .. _class_AABB_method_get_longest_axis_index: -- :ref:`int` **get_longest_axis_index** **(** **)** +- :ref:`int` **get_longest_axis_index** **(** **)** |const| Returns the index of the longest axis of the ``AABB`` (according to :ref:`Vector3`'s ``AXIS_*`` constants). @@ -179,7 +237,7 @@ Returns the index of the longest axis of the ``AABB`` (according to :ref:`Vector .. _class_AABB_method_get_longest_axis_size: -- :ref:`float` **get_longest_axis_size** **(** **)** +- :ref:`float` **get_longest_axis_size** **(** **)** |const| Returns the scalar length of the longest axis of the ``AABB``. @@ -187,7 +245,7 @@ Returns the scalar length of the longest axis of the ``AABB``. .. _class_AABB_method_get_shortest_axis: -- :ref:`Vector3` **get_shortest_axis** **(** **)** +- :ref:`Vector3` **get_shortest_axis** **(** **)** |const| Returns the normalized shortest axis of the ``AABB``. @@ -195,7 +253,7 @@ Returns the normalized shortest axis of the ``AABB``. .. _class_AABB_method_get_shortest_axis_index: -- :ref:`int` **get_shortest_axis_index** **(** **)** +- :ref:`int` **get_shortest_axis_index** **(** **)** |const| Returns the index of the shortest axis of the ``AABB`` (according to :ref:`Vector3`::AXIS\* enum). @@ -203,7 +261,7 @@ Returns the index of the shortest axis of the ``AABB`` (according to :ref:`Vecto .. _class_AABB_method_get_shortest_axis_size: -- :ref:`float` **get_shortest_axis_size** **(** **)** +- :ref:`float` **get_shortest_axis_size** **(** **)** |const| Returns the scalar length of the shortest axis of the ``AABB``. @@ -211,7 +269,7 @@ Returns the scalar length of the shortest axis of the ``AABB``. .. _class_AABB_method_get_support: -- :ref:`Vector3` **get_support** **(** :ref:`Vector3` dir **)** +- :ref:`Vector3` **get_support** **(** :ref:`Vector3` dir **)** |const| Returns the support point in a given direction. This is useful for collision detection algorithms. @@ -219,7 +277,7 @@ Returns the support point in a given direction. This is useful for collision det .. _class_AABB_method_grow: -- :ref:`AABB` **grow** **(** :ref:`float` by **)** +- :ref:`AABB` **grow** **(** :ref:`float` by **)** |const| Returns a copy of the ``AABB`` grown a given amount of units towards all the sides. @@ -227,7 +285,7 @@ Returns a copy of the ``AABB`` grown a given amount of units towards all the sid .. _class_AABB_method_has_no_area: -- :ref:`bool` **has_no_area** **(** **)** +- :ref:`bool` **has_no_area** **(** **)** |const| Returns ``true`` if the ``AABB`` is flat or empty. @@ -235,7 +293,7 @@ Returns ``true`` if the ``AABB`` is flat or empty. .. _class_AABB_method_has_no_surface: -- :ref:`bool` **has_no_surface** **(** **)** +- :ref:`bool` **has_no_surface** **(** **)** |const| Returns ``true`` if the ``AABB`` is empty. @@ -243,7 +301,7 @@ Returns ``true`` if the ``AABB`` is empty. .. _class_AABB_method_has_point: -- :ref:`bool` **has_point** **(** :ref:`Vector3` point **)** +- :ref:`bool` **has_point** **(** :ref:`Vector3` point **)** |const| Returns ``true`` if the ``AABB`` contains a point. @@ -251,7 +309,7 @@ Returns ``true`` if the ``AABB`` contains a point. .. _class_AABB_method_intersection: -- :ref:`AABB` **intersection** **(** :ref:`AABB` with **)** +- :ref:`AABB` **intersection** **(** :ref:`AABB` with **)** |const| Returns the intersection between two ``AABB``. An empty AABB (size 0,0,0) is returned on failure. @@ -259,7 +317,7 @@ Returns the intersection between two ``AABB``. An empty AABB (size 0,0,0) is ret .. _class_AABB_method_intersects: -- :ref:`bool` **intersects** **(** :ref:`AABB` with **)** +- :ref:`bool` **intersects** **(** :ref:`AABB` with **)** |const| Returns ``true`` if the ``AABB`` overlaps with another. @@ -267,15 +325,21 @@ Returns ``true`` if the ``AABB`` overlaps with another. .. _class_AABB_method_intersects_plane: -- :ref:`bool` **intersects_plane** **(** :ref:`Plane` plane **)** +- :ref:`bool` **intersects_plane** **(** :ref:`Plane` plane **)** |const| Returns ``true`` if the ``AABB`` is on both sides of a plane. ---- +.. _class_AABB_method_intersects_ray: + +- :ref:`Variant` **intersects_ray** **(** :ref:`Vector3` from, :ref:`Vector3` dir **)** |const| + +---- + .. _class_AABB_method_intersects_segment: -- :ref:`bool` **intersects_segment** **(** :ref:`Vector3` from, :ref:`Vector3` to **)** +- :ref:`Variant` **intersects_segment** **(** :ref:`Vector3` from, :ref:`Vector3` to **)** |const| Returns ``true`` if the ``AABB`` intersects the line segment between ``from`` and ``to``. @@ -283,15 +347,47 @@ Returns ``true`` if the ``AABB`` intersects the line segment between ``from`` an .. _class_AABB_method_is_equal_approx: -- :ref:`bool` **is_equal_approx** **(** :ref:`AABB` aabb **)** +- :ref:`bool` **is_equal_approx** **(** :ref:`AABB` aabb **)** |const| -Returns ``true`` if this ``AABB`` and ``aabb`` are approximately equal, by calling :ref:`@GDScript.is_equal_approx` on each component. +Returns ``true`` if this ``AABB`` and ``aabb`` are approximately equal, by calling :ref:`@GlobalScope.is_equal_approx` on each component. ---- .. _class_AABB_method_merge: -- :ref:`AABB` **merge** **(** :ref:`AABB` with **)** +- :ref:`AABB` **merge** **(** :ref:`AABB` with **)** |const| Returns a larger ``AABB`` that contains both this ``AABB`` and ``with``. +---- + +.. _class_AABB_method_operator !=: + +- :ref:`bool` **operator !=** **(** **)** |operator| + +---- + +- :ref:`bool` **operator !=** **(** :ref:`AABB` right **)** |operator| + +---- + +.. _class_AABB_method_operator *: + +- :ref:`AABB` **operator *** **(** :ref:`Transform3D` right **)** |operator| + +---- + +.. _class_AABB_method_operator ==: + +- :ref:`bool` **operator ==** **(** **)** |operator| + +---- + +- :ref:`bool` **operator ==** **(** :ref:`AABB` right **)** |operator| + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_acceptdialog.rst b/classes/class_acceptdialog.rst index 7311aa148..2c6bfd614 100644 --- a/classes/class_acceptdialog.rst +++ b/classes/class_acceptdialog.rst @@ -9,7 +9,7 @@ AcceptDialog ============ -**Inherits:** :ref:`WindowDialog` **<** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` +**Inherits:** :ref:`Window` **<** :ref:`Viewport` **<** :ref:`Node` **<** :ref:`Object` **Inherited By:** :ref:`ConfirmationDialog` @@ -23,15 +23,23 @@ This dialog is useful for small notifications to the user about an event. It can Properties ---------- -+-----------------------------+-------------------------------------------------------------------------+---------------------+ -| :ref:`bool` | :ref:`dialog_autowrap` | ``false`` | -+-----------------------------+-------------------------------------------------------------------------+---------------------+ -| :ref:`bool` | :ref:`dialog_hide_on_ok` | ``true`` | -+-----------------------------+-------------------------------------------------------------------------+---------------------+ -| :ref:`String` | :ref:`dialog_text` | ``""`` | -+-----------------------------+-------------------------------------------------------------------------+---------------------+ -| :ref:`String` | window_title | **O:** ``"Alert!"`` | -+-----------------------------+-------------------------------------------------------------------------+---------------------+ ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`bool` | :ref:`dialog_autowrap` | ``false`` | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`bool` | :ref:`dialog_hide_on_ok` | ``true`` | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`String` | :ref:`dialog_text` | ``""`` | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`bool` | exclusive | ``true`` *(parent override)* | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`String` | title | ``"Alert!"`` *(parent override)* | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`bool` | transient | ``true`` *(parent override)* | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`bool` | visible | ``false`` *(parent override)* | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`bool` | wrap_controls | ``true`` *(parent override)* | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ Methods ------- @@ -39,18 +47,35 @@ Methods +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Button` | :ref:`add_button` **(** :ref:`String` text, :ref:`bool` right=false, :ref:`String` action="" **)** | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Button` | :ref:`add_cancel` **(** :ref:`String` name **)** | +| :ref:`Button` | :ref:`add_cancel_button` **(** :ref:`String` name **)** | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Label` | :ref:`get_label` **(** **)** | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Button` | :ref:`get_ok` **(** **)** | +| :ref:`Button` | :ref:`get_ok_button` **(** **)** | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`register_text_enter` **(** :ref:`Node` line_edit **)** | +| void | :ref:`register_text_enter` **(** :ref:`Control` line_edit **)** | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_button` **(** :ref:`Control` button **)** | ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+----------------------------------------------------+ +| :ref:`StyleBox` | :ref:`panel` | ++---------------------------------+----------------------------------------------------+ Signals ------- +.. _class_AcceptDialog_signal_cancelled: + +- **cancelled** **(** **)** + +Emitted when the dialog is closed or the button created with :ref:`add_cancel_button` is pressed. + +---- + .. _class_AcceptDialog_signal_confirmed: - **confirmed** **(** **)** @@ -127,14 +152,18 @@ Adds a button with label ``text`` and a custom ``action`` to the dialog and retu If ``true``, ``right`` will place the button to the right of any sibling buttons. +You can use :ref:`remove_button` method to remove a button created with this method from the dialog. + ---- -.. _class_AcceptDialog_method_add_cancel: +.. _class_AcceptDialog_method_add_cancel_button: -- :ref:`Button` **add_cancel** **(** :ref:`String` name **)** +- :ref:`Button` **add_cancel_button** **(** :ref:`String` name **)** Adds a button with label ``name`` and a cancel action to the dialog and returns the created button. +You can use :ref:`remove_button` method to remove a button created with this method from the dialog. + ---- .. _class_AcceptDialog_method_get_label: @@ -145,9 +174,9 @@ Returns the label used for built-in text. ---- -.. _class_AcceptDialog_method_get_ok: +.. _class_AcceptDialog_method_get_ok_button: -- :ref:`Button` **get_ok** **(** **)** +- :ref:`Button` **get_ok_button** **(** **)** Returns the OK :ref:`Button` instance. @@ -155,7 +184,30 @@ Returns the OK :ref:`Button` instance. .. _class_AcceptDialog_method_register_text_enter: -- void **register_text_enter** **(** :ref:`Node` line_edit **)** +- void **register_text_enter** **(** :ref:`Control` line_edit **)** Registers a :ref:`LineEdit` in the dialog. When the enter key is pressed, the dialog will be accepted. +---- + +.. _class_AcceptDialog_method_remove_button: + +- void **remove_button** **(** :ref:`Control` button **)** + +Removes the ``button`` from the dialog. Does NOT free the ``button``. The ``button`` must be a :ref:`Button` added with :ref:`add_button` or :ref:`add_cancel_button` method. After removal, pressing the ``button`` will no longer emit this dialog's :ref:`custom_action` or :ref:`cancelled` signals. + +Theme Property Descriptions +--------------------------- + +.. _class_AcceptDialog_theme_style_panel: + +- :ref:`StyleBox` **panel** + +Panel that fills up the background of the window. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_aescontext.rst b/classes/class_aescontext.rst new file mode 100644 index 000000000..981074146 --- /dev/null +++ b/classes/class_aescontext.rst @@ -0,0 +1,178 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AESContext.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AESContext: + +AESContext +========== + +**Inherits:** :ref:`RefCounted` **<** :ref:`Object` + +Interface to low level AES encryption features. + +Description +----------- + +This class provides access to AES encryption/decryption of raw data. Both AES-ECB and AES-CBC mode are supported. + + +.. tabs:: + + .. code-tab:: 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()) + + .. code-tab:: 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()); + } + } + + + +Methods +------- + ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`finish` **(** **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`get_iv_state` **(** **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`start` **(** :ref:`Mode` mode, :ref:`PackedByteArray` key, :ref:`PackedByteArray` iv=PackedByteArray() **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedByteArray` | :ref:`update` **(** :ref:`PackedByteArray` src **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_AESContext_Mode: + +.. _class_AESContext_constant_MODE_ECB_ENCRYPT: + +.. _class_AESContext_constant_MODE_ECB_DECRYPT: + +.. _class_AESContext_constant_MODE_CBC_ENCRYPT: + +.. _class_AESContext_constant_MODE_CBC_DECRYPT: + +.. _class_AESContext_constant_MODE_MAX: + +enum **Mode**: + +- **MODE_ECB_ENCRYPT** = **0** --- AES electronic codebook encryption mode. + +- **MODE_ECB_DECRYPT** = **1** --- AES electronic codebook decryption mode. + +- **MODE_CBC_ENCRYPT** = **2** --- AES cipher blocker chaining encryption mode. + +- **MODE_CBC_DECRYPT** = **3** --- AES cipher blocker chaining decryption mode. + +- **MODE_MAX** = **4** --- Maximum value for the mode enum. + +Method Descriptions +------------------- + +.. _class_AESContext_method_finish: + +- void **finish** **(** **)** + +Close this AES context so it can be started again. See :ref:`start`. + +---- + +.. _class_AESContext_method_get_iv_state: + +- :ref:`PackedByteArray` **get_iv_state** **(** **)** + +Get the current IV state for this context (IV gets updated when calling :ref:`update`). You normally don't need this function. + +**Note:** This function only makes sense when the context is started with :ref:`MODE_CBC_ENCRYPT` or :ref:`MODE_CBC_DECRYPT`. + +---- + +.. _class_AESContext_method_start: + +- :ref:`Error` **start** **(** :ref:`Mode` mode, :ref:`PackedByteArray` key, :ref:`PackedByteArray` iv=PackedByteArray() **)** + +Start the AES context in the given ``mode``. A ``key`` of either 16 or 32 bytes must always be provided, while an ``iv`` (initialization vector) of exactly 16 bytes, is only needed when ``mode`` is either :ref:`MODE_CBC_ENCRYPT` or :ref:`MODE_CBC_DECRYPT`. + +---- + +.. _class_AESContext_method_update: + +- :ref:`PackedByteArray` **update** **(** :ref:`PackedByteArray` src **)** + +Run the desired operation for this AES context. Will return a :ref:`PackedByteArray` containing the result of encrypting (or decrypting) the given ``src``. See :ref:`start` for mode of operation. + +**Note:** The size of ``src`` must be a multiple of 16. Apply some padding if needed. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animatablebody2d.rst b/classes/class_animatablebody2d.rst new file mode 100644 index 000000000..f86e2aa73 --- /dev/null +++ b/classes/class_animatablebody2d.rst @@ -0,0 +1,54 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AnimatableBody2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AnimatableBody2D: + +AnimatableBody2D +================ + +**Inherits:** :ref:`StaticBody2D` **<** :ref:`PhysicsBody2D` **<** :ref:`CollisionObject2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Physics body for 2D physics which moves only by script or animation. Useful for moving platforms and doors. + +Description +----------- + +Animatable body for 2D physics. + +An animatable body can't be moved by external forces or contacts, but can be moved by script or animation to affect other bodies in its path. It is ideal for implementing moving objects in the environment, such as moving platforms or doors. + +When the body is moved manually, either from code or from an :ref:`AnimationPlayer` (with :ref:`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). + +Properties +---------- + ++-------------------------+-------------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`sync_to_physics` | ``true`` | ++-------------------------+-------------------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_AnimatableBody2D_property_sync_to_physics: + +- :ref:`bool` **sync_to_physics** + ++-----------+------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------+ +| *Setter* | set_sync_to_physics(value) | ++-----------+------------------------------+ +| *Getter* | is_sync_to_physics_enabled() | ++-----------+------------------------------+ + +If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer`, for example on moving platforms. Do **not** use together with :ref:`PhysicsBody2D.move_and_collide`. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animatablebody3d.rst b/classes/class_animatablebody3d.rst new file mode 100644 index 000000000..7268e9922 --- /dev/null +++ b/classes/class_animatablebody3d.rst @@ -0,0 +1,63 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AnimatableBody3D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AnimatableBody3D: + +AnimatableBody3D +================ + +**Inherits:** :ref:`StaticBody3D` **<** :ref:`PhysicsBody3D` **<** :ref:`CollisionObject3D` **<** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` + +Physics body for 3D physics which moves only by script or animation. Useful for moving platforms and doors. + +Description +----------- + +Animatable body for 3D physics. + +An animatable body can't be moved by external forces or contacts, but can be moved by script or animation to affect other bodies in its path. It is ideal for implementing moving objects in the environment, such as moving platforms or doors. + +When the body is moved manually, either from code or from an :ref:`AnimationPlayer` (with :ref:`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). + +Tutorials +--------- + +- `3D Physics Tests Demo `__ + +- `Third Person Shooter Demo `__ + +- `3D Voxel Demo `__ + +Properties +---------- + ++-------------------------+-------------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`sync_to_physics` | ``true`` | ++-------------------------+-------------------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_AnimatableBody3D_property_sync_to_physics: + +- :ref:`bool` **sync_to_physics** + ++-----------+------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------+ +| *Setter* | set_sync_to_physics(value) | ++-----------+------------------------------+ +| *Getter* | is_sync_to_physics_enabled() | ++-----------+------------------------------+ + +If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer`, for example on moving platforms. Do **not** use together with :ref:`PhysicsBody3D.move_and_collide`. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animatedsprite.rst b/classes/class_animatedsprite2d.rst similarity index 54% rename from classes/class_animatedsprite.rst rename to classes/class_animatedsprite2d.rst index bd74b043b..ec6090aae 100644 --- a/classes/class_animatedsprite.rst +++ b/classes/class_animatedsprite2d.rst @@ -1,13 +1,13 @@ :github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the AnimatedSprite.xml source instead. +.. DO NOT EDIT THIS FILE, but the AnimatedSprite2D.xml source instead. .. The source is found in doc/classes or modules//doc_classes. -.. _class_AnimatedSprite: +.. _class_AnimatedSprite2D: -AnimatedSprite -============== +AnimatedSprite2D +================ **Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` @@ -18,48 +18,53 @@ Description Animations are created using a :ref:`SpriteFrames` resource, which can be configured in the editor via the SpriteFrames panel. +**Note:** You can associate a set of normal or specular maps by creating additional :ref:`SpriteFrames` resources with a ``_normal`` or ``_specular`` suffix. For example, having 3 :ref:`SpriteFrames` resources ``run``, ``run_normal``, and ``run_specular`` will make it so the ``run`` animation uses normal and specular maps. + +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_sprite_animation` + +- `2D Dodge The Creeps Demo `__ + Properties ---------- -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`StringName` | :ref:`animation` | ``@"default"`` | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`centered` | ``true`` | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`flip_h` | ``false`` | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`flip_v` | ``false`` | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`int` | :ref:`frame` | ``0`` | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`SpriteFrames` | :ref:`frames` | | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`playing` | ``false`` | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`shininess` | ``1.0`` | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`Color` | :ref:`specular_color` | ``Color( 1, 1, 1, 1 )`` | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`speed_scale` | ``1.0`` | -+-----------------------------------------+---------------------------------------------------------------------+-------------------------+ ++-----------------------------------------+-----------------------------------------------------------------+-------------------+ +| :ref:`StringName` | :ref:`animation` | ``&"default"`` | ++-----------------------------------------+-----------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`centered` | ``true`` | ++-----------------------------------------+-----------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`flip_h` | ``false`` | ++-----------------------------------------+-----------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`flip_v` | ``false`` | ++-----------------------------------------+-----------------------------------------------------------------+-------------------+ +| :ref:`int` | :ref:`frame` | ``0`` | ++-----------------------------------------+-----------------------------------------------------------------+-------------------+ +| :ref:`SpriteFrames` | :ref:`frames` | | ++-----------------------------------------+-----------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2(0, 0)`` | ++-----------------------------------------+-----------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`playing` | ``false`` | ++-----------------------------------------+-----------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`speed_scale` | ``1.0`` | ++-----------------------------------------+-----------------------------------------------------------------+-------------------+ Methods ------- -+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_playing` **(** **)** const | -+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`play` **(** :ref:`StringName` anim=@"", :ref:`bool` backwards=false **)** | -+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`stop` **(** **)** | -+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play` **(** :ref:`StringName` anim=&"", :ref:`bool` backwards=false **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- -.. _class_AnimatedSprite_signal_animation_finished: +.. _class_AnimatedSprite2D_signal_animation_finished: - **animation_finished** **(** **)** @@ -67,21 +72,21 @@ Emitted when the animation is finished (when it plays the last frame). If the an ---- -.. _class_AnimatedSprite_signal_frame_changed: +.. _class_AnimatedSprite2D_signal_frame_changed: - **frame_changed** **(** **)** -Emitted when :ref:`frame` changed. +Emitted when :ref:`frame` changed. Property Descriptions --------------------- -.. _class_AnimatedSprite_property_animation: +.. _class_AnimatedSprite2D_property_animation: - :ref:`StringName` **animation** +-----------+----------------------+ -| *Default* | ``@"default"`` | +| *Default* | ``&"default"`` | +-----------+----------------------+ | *Setter* | set_animation(value) | +-----------+----------------------+ @@ -92,7 +97,7 @@ The current animation from the ``frames`` resource. If this value changes, the ` ---- -.. _class_AnimatedSprite_property_centered: +.. _class_AnimatedSprite2D_property_centered: - :ref:`bool` **centered** @@ -108,7 +113,7 @@ If ``true``, texture will be centered. ---- -.. _class_AnimatedSprite_property_flip_h: +.. _class_AnimatedSprite2D_property_flip_h: - :ref:`bool` **flip_h** @@ -124,7 +129,7 @@ If ``true``, texture is flipped horizontally. ---- -.. _class_AnimatedSprite_property_flip_v: +.. _class_AnimatedSprite2D_property_flip_v: - :ref:`bool` **flip_v** @@ -140,7 +145,7 @@ If ``true``, texture is flipped vertically. ---- -.. _class_AnimatedSprite_property_frame: +.. _class_AnimatedSprite2D_property_frame: - :ref:`int` **frame** @@ -156,7 +161,7 @@ The displayed animation frame's index. ---- -.. _class_AnimatedSprite_property_frames: +.. _class_AnimatedSprite2D_property_frames: - :ref:`SpriteFrames` **frames** @@ -170,23 +175,23 @@ The :ref:`SpriteFrames` resource containing the animation(s) ---- -.. _class_AnimatedSprite_property_offset: +.. _class_AnimatedSprite2D_property_offset: - :ref:`Vector2` **offset** -+-----------+---------------------+ -| *Default* | ``Vector2( 0, 0 )`` | -+-----------+---------------------+ -| *Setter* | set_offset(value) | -+-----------+---------------------+ -| *Getter* | get_offset() | -+-----------+---------------------+ ++-----------+-------------------+ +| *Default* | ``Vector2(0, 0)`` | ++-----------+-------------------+ +| *Setter* | set_offset(value) | ++-----------+-------------------+ +| *Getter* | get_offset() | ++-----------+-------------------+ The texture's drawing offset. ---- -.. _class_AnimatedSprite_property_playing: +.. _class_AnimatedSprite2D_property_playing: - :ref:`bool` **playing** @@ -194,43 +199,11 @@ The texture's drawing offset. | *Default* | ``false`` | +-----------+-----------+ -If ``true``, the :ref:`animation` is currently playing. +If ``true``, the :ref:`animation` is currently playing. ---- -.. _class_AnimatedSprite_property_shininess: - -- :ref:`float` **shininess** - -+-----------+----------------------+ -| *Default* | ``1.0`` | -+-----------+----------------------+ -| *Setter* | set_shininess(value) | -+-----------+----------------------+ -| *Getter* | get_shininess() | -+-----------+----------------------+ - -Strength of the specular light effect of this ``AnimatedSprite``. - ----- - -.. _class_AnimatedSprite_property_specular_color: - -- :ref:`Color` **specular_color** - -+-----------+---------------------------+ -| *Default* | ``Color( 1, 1, 1, 1 )`` | -+-----------+---------------------------+ -| *Setter* | set_specular_color(value) | -+-----------+---------------------------+ -| *Getter* | get_specular_color() | -+-----------+---------------------------+ - -The color of the specular light effect. - ----- - -.. _class_AnimatedSprite_property_speed_scale: +.. _class_AnimatedSprite2D_property_speed_scale: - :ref:`float` **speed_scale** @@ -247,25 +220,31 @@ The animation speed is multiplied by this value. Method Descriptions ------------------- -.. _class_AnimatedSprite_method_is_playing: +.. _class_AnimatedSprite2D_method_is_playing: -- :ref:`bool` **is_playing** **(** **)** const +- :ref:`bool` **is_playing** **(** **)** |const| Returns ``true`` if an animation is currently being played. ---- -.. _class_AnimatedSprite_method_play: +.. _class_AnimatedSprite2D_method_play: -- void **play** **(** :ref:`StringName` anim=@"", :ref:`bool` backwards=false **)** +- void **play** **(** :ref:`StringName` anim=&"", :ref:`bool` backwards=false **)** Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played. If ``backwards`` is ``true``, the animation will be played in reverse. ---- -.. _class_AnimatedSprite_method_stop: +.. _class_AnimatedSprite2D_method_stop: - void **stop** **(** **)** Stops the current animation (does not reset the frame counter). +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animatedsprite3d.rst b/classes/class_animatedsprite3d.rst index 660af2238..92fe4ce3e 100644 --- a/classes/class_animatedsprite3d.rst +++ b/classes/class_animatedsprite3d.rst @@ -9,7 +9,7 @@ AnimatedSprite3D ================ -**Inherits:** :ref:`SpriteBase3D` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` +**Inherits:** :ref:`SpriteBase3D` **<** :ref:`GeometryInstance3D` **<** :ref:`VisualInstance3D` **<** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` 2D sprite node in 3D world, that can use multiple 2D textures for animation. @@ -18,11 +18,16 @@ Description Animations are created using a :ref:`SpriteFrames` resource, which can be configured in the editor via the SpriteFrames panel. +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_sprite_animation` + Properties ---------- +-----------------------------------------+-------------------------------------------------------------+----------------+ -| :ref:`StringName` | :ref:`animation` | ``@"default"`` | +| :ref:`StringName` | :ref:`animation` | ``&"default"`` | +-----------------------------------------+-------------------------------------------------------------+----------------+ | :ref:`int` | :ref:`frame` | ``0`` | +-----------------------------------------+-------------------------------------------------------------+----------------+ @@ -35,9 +40,9 @@ Methods ------- +-------------------------+----------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_playing` **(** **)** const | +| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | +-------------------------+----------------------------------------------------------------------------------------------------------+ -| void | :ref:`play` **(** :ref:`StringName` anim=@"" **)** | +| void | :ref:`play` **(** :ref:`StringName` anim=&"" **)** | +-------------------------+----------------------------------------------------------------------------------------------------------+ | void | :ref:`stop` **(** **)** | +-------------------------+----------------------------------------------------------------------------------------------------------+ @@ -45,6 +50,14 @@ Methods Signals ------- +.. _class_AnimatedSprite3D_signal_animation_finished: + +- **animation_finished** **(** **)** + +Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn. + +---- + .. _class_AnimatedSprite3D_signal_frame_changed: - **frame_changed** **(** **)** @@ -59,7 +72,7 @@ Property Descriptions - :ref:`StringName` **animation** +-----------+----------------------+ -| *Default* | ``@"default"`` | +| *Default* | ``&"default"`` | +-----------+----------------------+ | *Setter* | set_animation(value) | +-----------+----------------------+ @@ -115,7 +128,7 @@ Method Descriptions .. _class_AnimatedSprite3D_method_is_playing: -- :ref:`bool` **is_playing** **(** **)** const +- :ref:`bool` **is_playing** **(** **)** |const| Returns ``true`` if an animation is currently being played. @@ -123,7 +136,7 @@ Returns ``true`` if an animation is currently being played. .. _class_AnimatedSprite3D_method_play: -- void **play** **(** :ref:`StringName` anim=@"" **)** +- void **play** **(** :ref:`StringName` anim=&"" **)** Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played. @@ -135,3 +148,9 @@ Plays the animation named ``anim``. If no ``anim`` is provided, the current anim Stops the current animation (does not reset the frame counter). +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animatedtexture.rst b/classes/class_animatedtexture.rst index 2a05bf66a..1b07ef178 100644 --- a/classes/class_animatedtexture.rst +++ b/classes/class_animatedtexture.rst @@ -9,35 +9,43 @@ AnimatedTexture =============== -**Inherits:** :ref:`Texture2D` **<** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`Texture2D` **<** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Proxy texture for simple frame-based animations. 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 :ref:`AnimationPlayer` or :ref:`AnimatedSprite`, it isn't a :ref:`Node`, but has the advantage of being usable anywhere a :ref:`Texture2D` resource can be used, e.g. in a :ref:`TileSet`. +``AnimatedTexture`` is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike :ref:`AnimationPlayer` or :ref:`AnimatedSprite2D`, it isn't a :ref:`Node`, but has the advantage of being usable anywhere a :ref:`Texture2D` resource can be used, e.g. in a :ref:`TileSet`. The playback of the animation is controlled by the :ref:`fps` property as well as each frame's optional delay (see :ref:`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 :ref:`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. + +**Note:** AnimatedTexture doesn't support using :ref:`AtlasTexture`\ s. Each frame needs to be a separate :ref:`Texture2D`. Properties ---------- -+---------------------------+------------------------------------------------------+---------+ -| :ref:`float` | :ref:`fps` | ``4.0`` | -+---------------------------+------------------------------------------------------+---------+ -| :ref:`int` | :ref:`frames` | ``1`` | -+---------------------------+------------------------------------------------------+---------+ ++---------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`current_frame` | | ++---------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`fps` | ``4.0`` | ++---------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`frames` | ``1`` | ++---------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`oneshot` | ``false`` | ++---------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`pause` | ``false`` | ++---------------------------+--------------------------------------------------------------------+-----------+ Methods ------- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_frame_delay` **(** :ref:`int` frame **)** const | +| :ref:`float` | :ref:`get_frame_delay` **(** :ref:`int` frame **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Texture2D` | :ref:`get_frame_texture` **(** :ref:`int` frame **)** const | +| :ref:`Texture2D` | :ref:`get_frame_texture` **(** :ref:`int` frame **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_frame_delay` **(** :ref:`int` frame, :ref:`float` delay **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -49,11 +57,25 @@ Constants .. _class_AnimatedTexture_constant_MAX_FRAMES: -- **MAX_FRAMES** = **256** --- The maximum number of frames supported by ``AnimatedTexture``. If you need more frames in your animation, use :ref:`AnimationPlayer` or :ref:`AnimatedSprite`. +- **MAX_FRAMES** = **256** --- The maximum number of frames supported by ``AnimatedTexture``. If you need more frames in your animation, use :ref:`AnimationPlayer` or :ref:`AnimatedSprite2D`. Property Descriptions --------------------- +.. _class_AnimatedTexture_property_current_frame: + +- :ref:`int` **current_frame** + ++----------+--------------------------+ +| *Setter* | set_current_frame(value) | ++----------+--------------------------+ +| *Getter* | get_current_frame() | ++----------+--------------------------+ + +Sets the currently visible frame of the texture. + +---- + .. _class_AnimatedTexture_property_fps: - :ref:`float` **fps** @@ -86,12 +108,44 @@ For example, an animation with 8 frames, no frame delay and a ``fps`` value of 2 Number of frames to use in the animation. While you can create the frames independently with :ref:`set_frame_texture`, you need to set this value for the animation to take new frames into account. The maximum number of frames is :ref:`MAX_FRAMES`. +---- + +.. _class_AnimatedTexture_property_oneshot: + +- :ref:`bool` **oneshot** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_oneshot(value) | ++-----------+--------------------+ +| *Getter* | get_oneshot() | ++-----------+--------------------+ + +If ``true``, 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 :ref:`pause` to ``true``. + +---- + +.. _class_AnimatedTexture_property_pause: + +- :ref:`bool` **pause** + ++-----------+------------------+ +| *Default* | ``false`` | ++-----------+------------------+ +| *Setter* | set_pause(value) | ++-----------+------------------+ +| *Getter* | get_pause() | ++-----------+------------------+ + +If ``true``, the animation will pause where it currently is (i.e. at :ref:`current_frame`). The animation will continue from where it was paused when changing this property to ``false``. + Method Descriptions ------------------- .. _class_AnimatedTexture_method_get_frame_delay: -- :ref:`float` **get_frame_delay** **(** :ref:`int` frame **)** const +- :ref:`float` **get_frame_delay** **(** :ref:`int` frame **)** |const| Returns the given frame's delay value. @@ -99,7 +153,7 @@ Returns the given frame's delay value. .. _class_AnimatedTexture_method_get_frame_texture: -- :ref:`Texture2D` **get_frame_texture** **(** :ref:`int` frame **)** const +- :ref:`Texture2D` **get_frame_texture** **(** :ref:`int` frame **)** |const| Returns the given frame's :ref:`Texture2D`. @@ -130,3 +184,9 @@ Assigns a :ref:`Texture2D` to the given frame. Frame IDs start You can define any number of textures up to :ref:`MAX_FRAMES`, but keep in mind that only frames from 0 to :ref:`frames` - 1 will be part of the animation. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animation.rst b/classes/class_animation.rst index ac50bd6a3..8e478f35e 100644 --- a/classes/class_animation.rst +++ b/classes/class_animation.rst @@ -9,7 +9,7 @@ Animation ========= -**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Contains data used to animate everything in the engine. @@ -18,16 +18,31 @@ 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. -:: + +.. tabs:: + + .. code-tab:: 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_insert_key(track_index, 0.0, 0) animation.track_insert_key(track_index, 0.5, 100) + .. code-tab:: 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); + + + Animations are just data containers, and must be added to nodes such as an :ref:`AnimationPlayer` to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check :ref:`TrackType` to see available types. Tutorials @@ -49,123 +64,125 @@ Properties Methods ------- -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`add_track` **(** :ref:`TrackType` type, :ref:`int` at_position=-1 **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`animation_track_get_key_animation` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`animation_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`StringName` animation **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`animation_track_set_key_animation` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`StringName` animation **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`audio_track_get_key_end_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`audio_track_get_key_start_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Resource` | :ref:`audio_track_get_key_stream` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`audio_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Resource` stream, :ref:`float` start_offset=0, :ref:`float` end_offset=0 **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`audio_track_set_key_end_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` offset **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`audio_track_set_key_start_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` offset **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`audio_track_set_key_stream` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Resource` stream **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`bezier_track_get_key_in_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`bezier_track_get_key_out_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`bezier_track_get_key_value` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`bezier_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`float` value, :ref:`Vector2` in_handle=Vector2( 0, 0 ), :ref:`Vector2` out_handle=Vector2( 0, 0 ) **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`bezier_track_interpolate` **(** :ref:`int` track_idx, :ref:`float` time **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`bezier_track_set_key_in_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Vector2` in_handle **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`bezier_track_set_key_out_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Vector2` out_handle **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`bezier_track_set_key_value` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` value **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear` **(** **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`copy_track` **(** :ref:`int` track_idx, :ref:`Animation` to_animation **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`find_track` **(** :ref:`NodePath` path **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_track_count` **(** **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedInt32Array` | :ref:`method_track_get_key_indices` **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`float` delta **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`method_track_get_name` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`method_track_get_params` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`remove_track` **(** :ref:`int` track_idx **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`track_find_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`bool` exact=false **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`track_get_interpolation_loop_wrap` **(** :ref:`int` track_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`InterpolationType` | :ref:`track_get_interpolation_type` **(** :ref:`int` track_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`track_get_key_count` **(** :ref:`int` track_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`track_get_key_time` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`track_get_key_transition` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`track_get_key_value` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`NodePath` | :ref:`track_get_path` **(** :ref:`int` track_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`TrackType` | :ref:`track_get_type` **(** :ref:`int` track_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Variant` key, :ref:`float` transition=1 **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`track_is_enabled` **(** :ref:`int` track_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`track_is_imported` **(** :ref:`int` track_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_move_down` **(** :ref:`int` track_idx **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_move_to` **(** :ref:`int` track_idx, :ref:`int` to_idx **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_move_up` **(** :ref:`int` track_idx **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_remove_key` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_remove_key_at_position` **(** :ref:`int` track_idx, :ref:`float` position **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_set_enabled` **(** :ref:`int` track_idx, :ref:`bool` enabled **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_set_imported` **(** :ref:`int` track_idx, :ref:`bool` imported **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_set_interpolation_loop_wrap` **(** :ref:`int` track_idx, :ref:`bool` interpolation **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_set_interpolation_type` **(** :ref:`int` track_idx, :ref:`InterpolationType` interpolation **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_set_key_time` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` time **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_set_key_transition` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` transition **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_set_key_value` **(** :ref:`int` track_idx, :ref:`int` key, :ref:`Variant` value **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_set_path` **(** :ref:`int` track_idx, :ref:`NodePath` path **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`track_swap` **(** :ref:`int` track_idx, :ref:`int` with_idx **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`transform_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Vector3` location, :ref:`Quat` rotation, :ref:`Vector3` scale **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`transform_track_interpolate` **(** :ref:`int` track_idx, :ref:`float` time_sec **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedInt32Array` | :ref:`value_track_get_key_indices` **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`float` delta **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`UpdateMode` | :ref:`value_track_get_update_mode` **(** :ref:`int` track_idx **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`value_track_set_update_mode` **(** :ref:`int` track_idx, :ref:`UpdateMode` mode **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`add_track` **(** :ref:`TrackType` type, :ref:`int` at_position=-1 **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`StringName` | :ref:`animation_track_get_key_animation` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`animation_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`StringName` animation **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`animation_track_set_key_animation` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`StringName` animation **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`audio_track_get_key_end_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`audio_track_get_key_start_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`audio_track_get_key_stream` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`audio_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Resource` stream, :ref:`float` start_offset=0, :ref:`float` end_offset=0 **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`audio_track_set_key_end_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` offset **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`audio_track_set_key_start_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` offset **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`audio_track_set_key_stream` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Resource` stream **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`bezier_track_get_key_in_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`bezier_track_get_key_out_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`bezier_track_get_key_value` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`bezier_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`float` value, :ref:`Vector2` in_handle=Vector2(0, 0), :ref:`Vector2` out_handle=Vector2(0, 0) **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`bezier_track_interpolate` **(** :ref:`int` track_idx, :ref:`float` time **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bezier_track_set_key_in_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Vector2` in_handle **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bezier_track_set_key_out_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Vector2` out_handle **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bezier_track_set_key_value` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` value **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`copy_track` **(** :ref:`int` track_idx, :ref:`Animation` to_animation **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_track` **(** :ref:`NodePath` path **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_track_count` **(** **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedInt32Array` | :ref:`method_track_get_key_indices` **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`float` delta **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`StringName` | :ref:`method_track_get_name` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`method_track_get_params` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_track` **(** :ref:`int` track_idx **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`track_find_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`bool` exact=false **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`track_get_interpolation_loop_wrap` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`InterpolationType` | :ref:`track_get_interpolation_type` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`track_get_key_count` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`track_get_key_time` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`track_get_key_transition` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`track_get_key_value` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`track_get_path` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TrackType` | :ref:`track_get_type` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Variant` key, :ref:`float` transition=1 **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`track_is_enabled` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`track_is_imported` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_move_down` **(** :ref:`int` track_idx **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_move_to` **(** :ref:`int` track_idx, :ref:`int` to_idx **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_move_up` **(** :ref:`int` track_idx **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_remove_key` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_remove_key_at_time` **(** :ref:`int` track_idx, :ref:`float` time **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_enabled` **(** :ref:`int` track_idx, :ref:`bool` enabled **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_imported` **(** :ref:`int` track_idx, :ref:`bool` imported **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_interpolation_loop_wrap` **(** :ref:`int` track_idx, :ref:`bool` interpolation **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_interpolation_type` **(** :ref:`int` track_idx, :ref:`InterpolationType` interpolation **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_key_time` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` time **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_key_transition` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` transition **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_key_value` **(** :ref:`int` track_idx, :ref:`int` key, :ref:`Variant` value **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_path` **(** :ref:`int` track_idx, :ref:`NodePath` path **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_swap` **(** :ref:`int` track_idx, :ref:`int` with_idx **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`transform_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Vector3` location, :ref:`Quaternion` rotation, :ref:`Vector3` scale **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`transform_track_interpolate` **(** :ref:`int` track_idx, :ref:`float` time_sec **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedInt32Array` | :ref:`value_track_get_key_indices` **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`float` delta **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`UpdateMode` | :ref:`value_track_get_update_mode` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`value_track_interpolate` **(** :ref:`int` track_idx, :ref:`float` time_sec **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`value_track_set_update_mode` **(** :ref:`int` track_idx, :ref:`UpdateMode` mode **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- @@ -183,7 +200,7 @@ Enumerations .. _class_Animation_constant_TYPE_VALUE: -.. _class_Animation_constant_TYPE_TRANSFORM: +.. _class_Animation_constant_TYPE_TRANSFORM3D: .. _class_Animation_constant_TYPE_METHOD: @@ -197,7 +214,7 @@ enum **TrackType**: - **TYPE_VALUE** = **0** --- Value tracks set values in node properties, but only those which can be Interpolated. -- **TYPE_TRANSFORM** = **1** --- Transform tracks are used to change node local transforms or skeleton pose bones. Transitions are interpolated. +- **TYPE_TRANSFORM3D** = **1** --- Transform3D tracks are used to change node local transforms or skeleton pose bones of 3D nodes. Transitions are interpolated. - **TYPE_METHOD** = **2** --- Method tracks call functions with given arguments per key. @@ -280,7 +297,7 @@ The total length of the animation (in seconds). | *Getter* | has_loop() | +-----------+-----------------+ -A flag indicating that the animation must loop. This is uses for correct interpolation of animation cycles, and for hinting the player that it must restart the animation. +A flag indicating that the animation must loop. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation. ---- @@ -311,7 +328,7 @@ Adds a track to the Animation. .. _class_Animation_method_animation_track_get_key_animation: -- :ref:`StringName` **animation_track_get_key_animation** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`StringName` **animation_track_get_key_animation** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the animation name at the key identified by ``key_idx``. The ``track_idx`` must be the index of an Animation Track. @@ -335,7 +352,7 @@ Sets the key identified by ``key_idx`` to value ``animation``. The ``track_idx`` .. _class_Animation_method_audio_track_get_key_end_offset: -- :ref:`float` **audio_track_get_key_end_offset** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`float` **audio_track_get_key_end_offset** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the end offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track. @@ -345,7 +362,7 @@ End offset is the number of seconds cut off at the ending of the audio stream. .. _class_Animation_method_audio_track_get_key_start_offset: -- :ref:`float` **audio_track_get_key_start_offset** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`float` **audio_track_get_key_start_offset** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the start offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track. @@ -355,7 +372,7 @@ Start offset is the number of seconds cut off at the beginning of the audio stre .. _class_Animation_method_audio_track_get_key_stream: -- :ref:`Resource` **audio_track_get_key_stream** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`Resource` **audio_track_get_key_stream** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the audio stream of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track. @@ -391,13 +408,13 @@ Sets the start offset of the key identified by ``key_idx`` to value ``offset``. - void **audio_track_set_key_stream** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Resource` stream **)** -Sets the stream of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track. +Sets the stream of the key identified by ``key_idx`` to value ``stream``. The ``track_idx`` must be the index of an Audio Track. ---- .. _class_Animation_method_bezier_track_get_key_in_handle: -- :ref:`Vector2` **bezier_track_get_key_in_handle** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`Vector2` **bezier_track_get_key_in_handle** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the in handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track. @@ -405,7 +422,7 @@ Returns the in handle of the key identified by ``key_idx``. The ``track_idx`` mu .. _class_Animation_method_bezier_track_get_key_out_handle: -- :ref:`Vector2` **bezier_track_get_key_out_handle** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`Vector2` **bezier_track_get_key_out_handle** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the out handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track. @@ -413,7 +430,7 @@ Returns the out handle of the key identified by ``key_idx``. The ``track_idx`` m .. _class_Animation_method_bezier_track_get_key_value: -- :ref:`float` **bezier_track_get_key_value** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`float` **bezier_track_get_key_value** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the value of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track. @@ -421,7 +438,7 @@ Returns the value of the key identified by ``key_idx``. The ``track_idx`` must b .. _class_Animation_method_bezier_track_insert_key: -- :ref:`int` **bezier_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`float` value, :ref:`Vector2` in_handle=Vector2( 0, 0 ), :ref:`Vector2` out_handle=Vector2( 0, 0 ) **)** +- :ref:`int` **bezier_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`float` value, :ref:`Vector2` in_handle=Vector2(0, 0), :ref:`Vector2` out_handle=Vector2(0, 0) **)** Inserts a Bezier Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of a Bezier Track. @@ -431,7 +448,7 @@ Inserts a Bezier Track key at the given ``time`` in seconds. The ``track_idx`` m .. _class_Animation_method_bezier_track_interpolate: -- :ref:`float` **bezier_track_interpolate** **(** :ref:`int` track_idx, :ref:`float` time **)** const +- :ref:`float` **bezier_track_interpolate** **(** :ref:`int` track_idx, :ref:`float` time **)** |const| Returns the interpolated value at the given ``time`` (in seconds). The ``track_idx`` must be the index of a Bezier Track. @@ -479,7 +496,7 @@ Adds a new track that is a copy of the given track from ``to_animation``. .. _class_Animation_method_find_track: -- :ref:`int` **find_track** **(** :ref:`NodePath` path **)** const +- :ref:`int` **find_track** **(** :ref:`NodePath` path **)** |const| Returns the index of the specified track. If the track is not found, return -1. @@ -487,7 +504,7 @@ Returns the index of the specified track. If the track is not found, return -1. .. _class_Animation_method_get_track_count: -- :ref:`int` **get_track_count** **(** **)** const +- :ref:`int` **get_track_count** **(** **)** |const| Returns the amount of tracks in the animation. @@ -495,7 +512,7 @@ Returns the amount of tracks in the animation. .. _class_Animation_method_method_track_get_key_indices: -- :ref:`PackedInt32Array` **method_track_get_key_indices** **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`float` delta **)** const +- :ref:`PackedInt32Array` **method_track_get_key_indices** **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`float` delta **)** |const| Returns all the key indices of a method track, given a position and delta time. @@ -503,7 +520,7 @@ Returns all the key indices of a method track, given a position and delta time. .. _class_Animation_method_method_track_get_name: -- :ref:`StringName` **method_track_get_name** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`StringName` **method_track_get_name** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the method name of a method track. @@ -511,7 +528,7 @@ Returns the method name of a method track. .. _class_Animation_method_method_track_get_params: -- :ref:`Array` **method_track_get_params** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`Array` **method_track_get_params** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the arguments values to be called on a method track for a given key in a given track. @@ -527,7 +544,7 @@ Removes a track by specifying the track index. .. _class_Animation_method_track_find_key: -- :ref:`int` **track_find_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`bool` exact=false **)** const +- :ref:`int` **track_find_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`bool` exact=false **)** |const| Finds the key index by time in a given track. Optionally, only find it if the exact time is given. @@ -535,7 +552,7 @@ Finds the key index by time in a given track. Optionally, only find it if the ex .. _class_Animation_method_track_get_interpolation_loop_wrap: -- :ref:`bool` **track_get_interpolation_loop_wrap** **(** :ref:`int` track_idx **)** const +- :ref:`bool` **track_get_interpolation_loop_wrap** **(** :ref:`int` track_idx **)** |const| Returns ``true`` if the track at ``idx`` wraps the interpolation loop. New tracks wrap the interpolation loop by default. @@ -543,7 +560,7 @@ Returns ``true`` if the track at ``idx`` wraps the interpolation loop. New track .. _class_Animation_method_track_get_interpolation_type: -- :ref:`InterpolationType` **track_get_interpolation_type** **(** :ref:`int` track_idx **)** const +- :ref:`InterpolationType` **track_get_interpolation_type** **(** :ref:`int` track_idx **)** |const| Returns the interpolation type of a given track. @@ -551,7 +568,7 @@ Returns the interpolation type of a given track. .. _class_Animation_method_track_get_key_count: -- :ref:`int` **track_get_key_count** **(** :ref:`int` track_idx **)** const +- :ref:`int` **track_get_key_count** **(** :ref:`int` track_idx **)** |const| Returns the amount of keys in a given track. @@ -559,7 +576,7 @@ Returns the amount of keys in a given track. .. _class_Animation_method_track_get_key_time: -- :ref:`float` **track_get_key_time** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`float` **track_get_key_time** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the time at which the key is located. @@ -567,15 +584,15 @@ Returns the time at which the key is located. .. _class_Animation_method_track_get_key_transition: -- :ref:`float` **track_get_key_transition** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`float` **track_get_key_transition** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| -Returns the transition curve (easing) for a specific key (see the built-in math function :ref:`@GDScript.ease`). +Returns the transition curve (easing) for a specific key (see the built-in math function :ref:`@GlobalScope.ease`). ---- .. _class_Animation_method_track_get_key_value: -- :ref:`Variant` **track_get_key_value** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** const +- :ref:`Variant` **track_get_key_value** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| Returns the value of a given key in a given track. @@ -583,7 +600,7 @@ Returns the value of a given key in a given track. .. _class_Animation_method_track_get_path: -- :ref:`NodePath` **track_get_path** **(** :ref:`int` track_idx **)** const +- :ref:`NodePath` **track_get_path** **(** :ref:`int` track_idx **)** |const| Gets the path of a track. For more information on the path format, see :ref:`track_set_path`. @@ -591,7 +608,7 @@ Gets the path of a track. For more information on the path format, see :ref:`tra .. _class_Animation_method_track_get_type: -- :ref:`TrackType` **track_get_type** **(** :ref:`int` track_idx **)** const +- :ref:`TrackType` **track_get_type** **(** :ref:`int` track_idx **)** |const| Gets the type of a track. @@ -607,7 +624,7 @@ Insert a generic key in a given track. .. _class_Animation_method_track_is_enabled: -- :ref:`bool` **track_is_enabled** **(** :ref:`int` track_idx **)** const +- :ref:`bool` **track_is_enabled** **(** :ref:`int` track_idx **)** |const| Returns ``true`` if the track at index ``idx`` is enabled. @@ -615,7 +632,7 @@ Returns ``true`` if the track at index ``idx`` is enabled. .. _class_Animation_method_track_is_imported: -- :ref:`bool` **track_is_imported** **(** :ref:`int` track_idx **)** const +- :ref:`bool` **track_is_imported** **(** :ref:`int` track_idx **)** |const| Returns ``true`` if the given track is imported. Else, return ``false``. @@ -653,11 +670,11 @@ Removes a key by index in a given track. ---- -.. _class_Animation_method_track_remove_key_at_position: +.. _class_Animation_method_track_remove_key_at_time: -- void **track_remove_key_at_position** **(** :ref:`int` track_idx, :ref:`float` position **)** +- void **track_remove_key_at_time** **(** :ref:`int` track_idx, :ref:`float` time **)** -Removes a key by position (seconds) in a given track. +Removes a key at ``time`` in a given track. ---- @@ -705,7 +722,7 @@ Sets the time of an existing key. - void **track_set_key_transition** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` transition **)** -Sets the transition curve (easing) for a specific key (see the built-in math function :ref:`@GDScript.ease`). +Sets the transition curve (easing) for a specific key (see the built-in math function :ref:`@GlobalScope.ease`). ---- @@ -721,7 +738,7 @@ Sets the value of an existing key. - void **track_set_path** **(** :ref:`int` track_idx, :ref:`NodePath` path **)** -Sets the path of a track. 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. Tracks that control properties or bones must append their name after the path, separated by ``":"``. +Sets the path of a track. 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. Tracks that control properties or bones must append their name after the path, separated by ``":"``. For example, ``"character/skeleton:ankle"`` or ``"character/mesh:transform/local"``. @@ -737,7 +754,7 @@ Swaps the track ``idx``'s index position with the track ``with_idx``. .. _class_Animation_method_transform_track_insert_key: -- :ref:`int` **transform_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Vector3` location, :ref:`Quat` rotation, :ref:`Vector3` scale **)** +- :ref:`int` **transform_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Vector3` location, :ref:`Quaternion` rotation, :ref:`Vector3` scale **)** Insert a transform key for a transform track. @@ -745,15 +762,15 @@ Insert a transform key for a transform track. .. _class_Animation_method_transform_track_interpolate: -- :ref:`Array` **transform_track_interpolate** **(** :ref:`int` track_idx, :ref:`float` time_sec **)** const +- :ref:`Array` **transform_track_interpolate** **(** :ref:`int` track_idx, :ref:`float` time_sec **)** |const| -Returns the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position (:ref:`Vector3`), rotation (:ref:`Quat`) and scale (:ref:`Vector3`). +Returns the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position (:ref:`Vector3`), rotation (:ref:`Quaternion`) and scale (:ref:`Vector3`). ---- .. _class_Animation_method_value_track_get_key_indices: -- :ref:`PackedInt32Array` **value_track_get_key_indices** **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`float` delta **)** const +- :ref:`PackedInt32Array` **value_track_get_key_indices** **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`float` delta **)** |const| Returns all the key indices of a value track, given a position and delta time. @@ -761,15 +778,29 @@ Returns all the key indices of a value track, given a position and delta time. .. _class_Animation_method_value_track_get_update_mode: -- :ref:`UpdateMode` **value_track_get_update_mode** **(** :ref:`int` track_idx **)** const +- :ref:`UpdateMode` **value_track_get_update_mode** **(** :ref:`int` track_idx **)** |const| Returns the update mode of a value track. ---- +.. _class_Animation_method_value_track_interpolate: + +- :ref:`Variant` **value_track_interpolate** **(** :ref:`int` track_idx, :ref:`float` time_sec **)** |const| + +Returns the interpolated value at the given time (in seconds). The ``track_idx`` must be the index of a value track. + +---- + .. _class_Animation_method_value_track_set_update_mode: - void **value_track_set_update_mode** **(** :ref:`int` track_idx, :ref:`UpdateMode` mode **)** Sets the update mode (see :ref:`UpdateMode`) of a value track. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnode.rst b/classes/class_animationnode.rst index b9710bcbb..0de0c6994 100644 --- a/classes/class_animationnode.rst +++ b/classes/class_animationnode.rst @@ -9,7 +9,7 @@ AnimationNode ============= -**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`AnimationNodeAdd2`, :ref:`AnimationNodeAdd3`, :ref:`AnimationNodeBlend2`, :ref:`AnimationNodeBlend3`, :ref:`AnimationNodeOneShot`, :ref:`AnimationNodeOutput`, :ref:`AnimationNodeTimeScale`, :ref:`AnimationNodeTimeSeek`, :ref:`AnimationNodeTransition`, :ref:`AnimationRootNode` @@ -37,43 +37,43 @@ Properties Methods ------- -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_input` **(** :ref:`String` name **)** | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`blend_animation` **(** :ref:`StringName` animation, :ref:`float` time, :ref:`float` delta, :ref:`bool` seeked, :ref:`float` blend **)** | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`blend_input` **(** :ref:`int` input_index, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`blend_node` **(** :ref:`StringName` name, :ref:`AnimationNode` node, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_caption` **(** **)** virtual | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Object` | :ref:`get_child_by_name` **(** :ref:`String` name **)** virtual | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Dictionary` | :ref:`get_child_nodes` **(** **)** virtual | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_input_count` **(** **)** const | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_input_name` **(** :ref:`int` input **)** | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`get_parameter` **(** :ref:`StringName` name **)** const | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`get_parameter_default_value` **(** :ref:`StringName` name **)** virtual | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`get_parameter_list` **(** **)** virtual | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_filter` **(** **)** virtual | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_path_filtered` **(** :ref:`NodePath` path **)** const | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`process` **(** :ref:`float` time, :ref:`bool` seek **)** virtual | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`remove_input` **(** :ref:`int` index **)** | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_filter_path` **(** :ref:`NodePath` path, :ref:`bool` enable **)** | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_parameter` **(** :ref:`StringName` name, :ref:`Variant` value **)** | -+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_caption` **(** **)** |virtual| |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AnimationNode` | :ref:`_get_child_by_name` **(** :ref:`StringName` name **)** |virtual| |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`_get_child_nodes` **(** **)** |virtual| |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`_get_parameter_default_value` **(** :ref:`StringName` parameter **)** |virtual| |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`_get_parameter_list` **(** **)** |virtual| |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`_has_filter` **(** **)** |virtual| |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`_process` **(** :ref:`float` time, :ref:`bool` seek **)** |virtual| |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_input` **(** :ref:`String` name **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blend_animation` **(** :ref:`StringName` animation, :ref:`float` time, :ref:`float` delta, :ref:`bool` seeked, :ref:`float` blend **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`blend_input` **(** :ref:`int` input_index, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`blend_node` **(** :ref:`StringName` name, :ref:`AnimationNode` node, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_input_count` **(** **)** |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_input_name` **(** :ref:`int` input **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_parameter` **(** :ref:`StringName` name **)** |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_path_filtered` **(** :ref:`NodePath` path **)** |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_input` **(** :ref:`int` index **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_filter_path` **(** :ref:`NodePath` path, :ref:`bool` enable **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_parameter` **(** :ref:`StringName` name, :ref:`Variant` value **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- @@ -133,6 +133,66 @@ If ``true``, filtering is enabled. Method Descriptions ------------------- +.. _class_AnimationNode_method__get_caption: + +- :ref:`String` **_get_caption** **(** **)** |virtual| |const| + +Gets the text caption for this node (used by some editors). + +---- + +.. _class_AnimationNode_method__get_child_by_name: + +- :ref:`AnimationNode` **_get_child_by_name** **(** :ref:`StringName` name **)** |virtual| |const| + +Gets a child node by index (used by editors inheriting from :ref:`AnimationRootNode`). + +---- + +.. _class_AnimationNode_method__get_child_nodes: + +- :ref:`Dictionary` **_get_child_nodes** **(** **)** |virtual| |const| + +Gets all children nodes in order as a ``name: node`` dictionary. Only useful when inheriting :ref:`AnimationRootNode`. + +---- + +.. _class_AnimationNode_method__get_parameter_default_value: + +- :ref:`Variant` **_get_parameter_default_value** **(** :ref:`StringName` parameter **)** |virtual| |const| + +Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. + +---- + +.. _class_AnimationNode_method__get_parameter_list: + +- :ref:`Array` **_get_parameter_list** **(** **)** |virtual| |const| + +Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to :ref:`Object.get_property_list`. + +---- + +.. _class_AnimationNode_method__has_filter: + +- :ref:`bool` **_has_filter** **(** **)** |virtual| |const| + +Returns ``true`` whether you want the blend tree editor to display filter editing on this node. + +---- + +.. _class_AnimationNode_method__process: + +- :ref:`float` **_process** **(** :ref:`float` time, :ref:`bool` seek **)** |virtual| |const| + +User-defined callback called when a custom node is processed. The ``time`` parameter is a relative delta, unless ``seek`` is ``true``, in which case it is absolute. + +Here, call the :ref:`blend_input`, :ref:`blend_node` or :ref:`blend_animation` functions. You can also use :ref:`get_parameter` and :ref:`set_parameter` to modify local memory. + +This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called). + +---- + .. _class_AnimationNode_method_add_input: - void **add_input** **(** :ref:`String` name **)** @@ -165,33 +225,9 @@ Blend another animation node (in case this node contains children animation node ---- -.. _class_AnimationNode_method_get_caption: - -- :ref:`String` **get_caption** **(** **)** virtual - -Gets the text caption for this node (used by some editors). - ----- - -.. _class_AnimationNode_method_get_child_by_name: - -- :ref:`Object` **get_child_by_name** **(** :ref:`String` name **)** virtual - -Gets a child node by index (used by editors inheriting from :ref:`AnimationRootNode`). - ----- - -.. _class_AnimationNode_method_get_child_nodes: - -- :ref:`Dictionary` **get_child_nodes** **(** **)** virtual - -Gets all children nodes in order as a ``name: node`` dictionary. Only useful when inheriting :ref:`AnimationRootNode`. - ----- - .. _class_AnimationNode_method_get_input_count: -- :ref:`int` **get_input_count** **(** **)** const +- :ref:`int` **get_input_count** **(** **)** |const| Amount of inputs in this node, only useful for nodes that go into :ref:`AnimationNodeBlendTree`. @@ -207,56 +243,20 @@ Gets the name of an input by index. .. _class_AnimationNode_method_get_parameter: -- :ref:`Variant` **get_parameter** **(** :ref:`StringName` name **)** const +- :ref:`Variant` **get_parameter** **(** :ref:`StringName` name **)** |const| Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. ---- -.. _class_AnimationNode_method_get_parameter_default_value: - -- :ref:`Variant` **get_parameter_default_value** **(** :ref:`StringName` name **)** virtual - -Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. - ----- - -.. _class_AnimationNode_method_get_parameter_list: - -- :ref:`Array` **get_parameter_list** **(** **)** virtual - -Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to :ref:`Object.get_property_list`. - ----- - -.. _class_AnimationNode_method_has_filter: - -- :ref:`bool` **has_filter** **(** **)** virtual - -Returns ``true`` whether you want the blend tree editor to display filter editing on this node. - ----- - .. _class_AnimationNode_method_is_path_filtered: -- :ref:`bool` **is_path_filtered** **(** :ref:`NodePath` path **)** const +- :ref:`bool` **is_path_filtered** **(** :ref:`NodePath` path **)** |const| Returns ``true`` whether a given path is filtered. ---- -.. _class_AnimationNode_method_process: - -- void **process** **(** :ref:`float` time, :ref:`bool` seek **)** virtual - -User-defined callback called when a custom node is processed. The ``time`` parameter is a relative delta, unless ``seek`` is ``true``, in which case it is absolute. - -Here, call the :ref:`blend_input`, :ref:`blend_node` or :ref:`blend_animation` functions. You can also use :ref:`get_parameter` and :ref:`set_parameter` to modify local memory. - -This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called). - ----- - .. _class_AnimationNode_method_remove_input: - void **remove_input** **(** :ref:`int` index **)** @@ -279,3 +279,9 @@ Adds or removes a path for the filter. Sets a custom parameter. These are used as local storage, because resources can be reused across the tree or scenes. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodeadd2.rst b/classes/class_animationnodeadd2.rst index 0e6f7004c..56f7ea78a 100644 --- a/classes/class_animationnodeadd2.rst +++ b/classes/class_animationnodeadd2.rst @@ -9,7 +9,7 @@ AnimationNodeAdd2 ================= -**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Blends two animations additively inside of an :ref:`AnimationNodeBlendTree`. @@ -47,3 +47,9 @@ Property Descriptions If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input`, forcing the blended animations to update every frame. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodeadd3.rst b/classes/class_animationnodeadd3.rst index 061e7c17d..2600f557d 100644 --- a/classes/class_animationnodeadd3.rst +++ b/classes/class_animationnodeadd3.rst @@ -9,7 +9,7 @@ AnimationNodeAdd3 ================= -**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Blends two of three animations additively inside of an :ref:`AnimationNodeBlendTree`. @@ -31,6 +31,8 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `Third Person Shooter Demo `__ + Properties ---------- @@ -55,3 +57,9 @@ Property Descriptions If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input`, forcing the blended animations to update every frame. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodeanimation.rst b/classes/class_animationnodeanimation.rst index f60ff766e..4af250415 100644 --- a/classes/class_animationnodeanimation.rst +++ b/classes/class_animationnodeanimation.rst @@ -9,7 +9,7 @@ AnimationNodeAnimation ====================== -**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Input animation to use in an :ref:`AnimationNodeBlendTree`. @@ -23,11 +23,15 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `3D Platformer Demo `__ + +- `Third Person Shooter Demo `__ + Properties ---------- +-------------------------------------+-------------------------------------------------------------------+---------+ -| :ref:`StringName` | :ref:`animation` | ``@""`` | +| :ref:`StringName` | :ref:`animation` | ``&""`` | +-------------------------------------+-------------------------------------------------------------------+---------+ Property Descriptions @@ -38,7 +42,7 @@ Property Descriptions - :ref:`StringName` **animation** +-----------+----------------------+ -| *Default* | ``@""`` | +| *Default* | ``&""`` | +-----------+----------------------+ | *Setter* | set_animation(value) | +-----------+----------------------+ @@ -47,3 +51,9 @@ Property Descriptions Animation to use as an output. It is one of the animations provided by :ref:`AnimationTree.anim_player`. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodeblend2.rst b/classes/class_animationnodeblend2.rst index 8e829a6e3..a9e39852e 100644 --- a/classes/class_animationnodeblend2.rst +++ b/classes/class_animationnodeblend2.rst @@ -9,7 +9,7 @@ AnimationNodeBlend2 =================== -**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Blends two animations linearly inside of an :ref:`AnimationNodeBlendTree`. @@ -23,6 +23,10 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `3D Platformer Demo `__ + +- `Third Person Shooter Demo `__ + Properties ---------- @@ -47,3 +51,9 @@ Property Descriptions If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input`, forcing the blended animations to update every frame. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodeblend3.rst b/classes/class_animationnodeblend3.rst index d2905646a..31d47d6ec 100644 --- a/classes/class_animationnodeblend3.rst +++ b/classes/class_animationnodeblend3.rst @@ -9,7 +9,7 @@ AnimationNodeBlend3 =================== -**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Blends two of three animations linearly inside of an :ref:`AnimationNodeBlendTree`. @@ -55,3 +55,9 @@ Property Descriptions If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input`, forcing the blended animations to update every frame. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodeblendspace1d.rst b/classes/class_animationnodeblendspace1d.rst index f2921b2fb..b51b879d3 100644 --- a/classes/class_animationnodeblendspace1d.rst +++ b/classes/class_animationnodeblendspace1d.rst @@ -9,7 +9,7 @@ AnimationNodeBlendSpace1D ========================= -**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Blends linearly between two of any number of :ref:`AnimationNode` of any type placed on a virtual axis. @@ -48,11 +48,11 @@ Methods +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_blend_point` **(** :ref:`AnimationRootNode` node, :ref:`float` pos, :ref:`int` at_index=-1 **)** | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_blend_point_count` **(** **)** const | +| :ref:`int` | :ref:`get_blend_point_count` **(** **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AnimationRootNode` | :ref:`get_blend_point_node` **(** :ref:`int` point **)** const | +| :ref:`AnimationRootNode` | :ref:`get_blend_point_node` **(** :ref:`int` point **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_blend_point_position` **(** :ref:`int` point **)** const | +| :ref:`float` | :ref:`get_blend_point_position` **(** :ref:`int` point **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_blend_point` **(** :ref:`int` point **)** | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -139,7 +139,7 @@ Adds a new point that represents a ``node`` on the virtual axis at a given posit .. _class_AnimationNodeBlendSpace1D_method_get_blend_point_count: -- :ref:`int` **get_blend_point_count** **(** **)** const +- :ref:`int` **get_blend_point_count** **(** **)** |const| Returns the number of points on the blend axis. @@ -147,7 +147,7 @@ Returns the number of points on the blend axis. .. _class_AnimationNodeBlendSpace1D_method_get_blend_point_node: -- :ref:`AnimationRootNode` **get_blend_point_node** **(** :ref:`int` point **)** const +- :ref:`AnimationRootNode` **get_blend_point_node** **(** :ref:`int` point **)** |const| Returns the :ref:`AnimationNode` referenced by the point at index ``point``. @@ -155,7 +155,7 @@ Returns the :ref:`AnimationNode` referenced by the point at .. _class_AnimationNodeBlendSpace1D_method_get_blend_point_position: -- :ref:`float` **get_blend_point_position** **(** :ref:`int` point **)** const +- :ref:`float` **get_blend_point_position** **(** :ref:`int` point **)** |const| Returns the position of the point at index ``point``. @@ -183,3 +183,9 @@ Changes the :ref:`AnimationNode` referenced by the point at Updates the position of the point at index ``point`` on the blend axis. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodeblendspace2d.rst b/classes/class_animationnodeblendspace2d.rst index df5a476a3..67314b20a 100644 --- a/classes/class_animationnodeblendspace2d.rst +++ b/classes/class_animationnodeblendspace2d.rst @@ -9,7 +9,7 @@ AnimationNodeBlendSpace2D ========================= -**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Blends linearly between three :ref:`AnimationNode` of any type placed in a 2D space. @@ -27,24 +27,26 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `Third Person Shooter Demo `__ + Properties ---------- -+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`auto_triangles` | ``true`` | -+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ -| :ref:`BlendMode` | :ref:`blend_mode` | ``0`` | -+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ -| :ref:`Vector2` | :ref:`max_space` | ``Vector2( 1, 1 )`` | -+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ -| :ref:`Vector2` | :ref:`min_space` | ``Vector2( -1, -1 )`` | -+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ -| :ref:`Vector2` | :ref:`snap` | ``Vector2( 0.1, 0.1 )`` | -+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ -| :ref:`String` | :ref:`x_label` | ``"x"`` | -+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ -| :ref:`String` | :ref:`y_label` | ``"y"`` | -+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ ++------------------------------------------------------------+--------------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`auto_triangles` | ``true`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-----------------------+ +| :ref:`BlendMode` | :ref:`blend_mode` | ``0`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-----------------------+ +| :ref:`Vector2` | :ref:`max_space` | ``Vector2(1, 1)`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-----------------------+ +| :ref:`Vector2` | :ref:`min_space` | ``Vector2(-1, -1)`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-----------------------+ +| :ref:`Vector2` | :ref:`snap` | ``Vector2(0.1, 0.1)`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-----------------------+ +| :ref:`String` | :ref:`x_label` | ``"x"`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-----------------------+ +| :ref:`String` | :ref:`y_label` | ``"y"`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-----------------------+ Methods ------- @@ -54,13 +56,13 @@ Methods +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_triangle` **(** :ref:`int` x, :ref:`int` y, :ref:`int` z, :ref:`int` at_index=-1 **)** | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_blend_point_count` **(** **)** const | +| :ref:`int` | :ref:`get_blend_point_count` **(** **)** |const| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AnimationRootNode` | :ref:`get_blend_point_node` **(** :ref:`int` point **)** const | +| :ref:`AnimationRootNode` | :ref:`get_blend_point_node` **(** :ref:`int` point **)** |const| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_blend_point_position` **(** :ref:`int` point **)** const | +| :ref:`Vector2` | :ref:`get_blend_point_position` **(** :ref:`int` point **)** |const| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_triangle_count` **(** **)** const | +| :ref:`int` | :ref:`get_triangle_count` **(** **)** |const| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_triangle_point` **(** :ref:`int` triangle, :ref:`int` point **)** | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -141,7 +143,7 @@ Controls the interpolation between animations. See :ref:`BlendMode` **max_space** +-----------+----------------------+ -| *Default* | ``Vector2( 1, 1 )`` | +| *Default* | ``Vector2(1, 1)`` | +-----------+----------------------+ | *Setter* | set_max_space(value) | +-----------+----------------------+ @@ -156,13 +158,13 @@ The blend space's X and Y axes' upper limit for the points' position. See :ref:` - :ref:`Vector2` **min_space** -+-----------+-----------------------+ -| *Default* | ``Vector2( -1, -1 )`` | -+-----------+-----------------------+ -| *Setter* | set_min_space(value) | -+-----------+-----------------------+ -| *Getter* | get_min_space() | -+-----------+-----------------------+ ++-----------+----------------------+ +| *Default* | ``Vector2(-1, -1)`` | ++-----------+----------------------+ +| *Setter* | set_min_space(value) | ++-----------+----------------------+ +| *Getter* | get_min_space() | ++-----------+----------------------+ The blend space's X and Y axes' lower limit for the points' position. See :ref:`add_blend_point`. @@ -172,13 +174,13 @@ The blend space's X and Y axes' lower limit for the points' position. See :ref:` - :ref:`Vector2` **snap** -+-----------+-------------------------+ -| *Default* | ``Vector2( 0.1, 0.1 )`` | -+-----------+-------------------------+ -| *Setter* | set_snap(value) | -+-----------+-------------------------+ -| *Getter* | get_snap() | -+-----------+-------------------------+ ++-----------+-----------------------+ +| *Default* | ``Vector2(0.1, 0.1)`` | ++-----------+-----------------------+ +| *Setter* | set_snap(value) | ++-----------+-----------------------+ +| *Getter* | get_snap() | ++-----------+-----------------------+ Position increment to snap to when moving a point. @@ -235,7 +237,7 @@ Creates a new triangle using three points ``x``, ``y``, and ``z``. Triangles can .. _class_AnimationNodeBlendSpace2D_method_get_blend_point_count: -- :ref:`int` **get_blend_point_count** **(** **)** const +- :ref:`int` **get_blend_point_count** **(** **)** |const| Returns the number of points in the blend space. @@ -243,7 +245,7 @@ Returns the number of points in the blend space. .. _class_AnimationNodeBlendSpace2D_method_get_blend_point_node: -- :ref:`AnimationRootNode` **get_blend_point_node** **(** :ref:`int` point **)** const +- :ref:`AnimationRootNode` **get_blend_point_node** **(** :ref:`int` point **)** |const| Returns the :ref:`AnimationRootNode` referenced by the point at index ``point``. @@ -251,7 +253,7 @@ Returns the :ref:`AnimationRootNode` referenced by the .. _class_AnimationNodeBlendSpace2D_method_get_blend_point_position: -- :ref:`Vector2` **get_blend_point_position** **(** :ref:`int` point **)** const +- :ref:`Vector2` **get_blend_point_position** **(** :ref:`int` point **)** |const| Returns the position of the point at index ``point``. @@ -259,7 +261,7 @@ Returns the position of the point at index ``point``. .. _class_AnimationNodeBlendSpace2D_method_get_triangle_count: -- :ref:`int` **get_triangle_count** **(** **)** const +- :ref:`int` **get_triangle_count** **(** **)** |const| Returns the number of triangles in the blend space. @@ -303,3 +305,9 @@ Changes the :ref:`AnimationNode` referenced by the point at Updates the position of the point at index ``point`` on the blend axis. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodeblendtree.rst b/classes/class_animationnodeblendtree.rst index b32c843ed..6c5939a45 100644 --- a/classes/class_animationnodeblendtree.rst +++ b/classes/class_animationnodeblendtree.rst @@ -9,7 +9,7 @@ AnimationNodeBlendTree ====================== -**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` :ref:`AnimationTree` node resource that contains many blend type nodes. @@ -26,32 +26,32 @@ Tutorials Properties ---------- -+-------------------------------+-------------------------------------------------------------------------+---------------------+ -| :ref:`Vector2` | :ref:`graph_offset` | ``Vector2( 0, 0 )`` | -+-------------------------------+-------------------------------------------------------------------------+---------------------+ ++-------------------------------+-------------------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`graph_offset` | ``Vector2(0, 0)`` | ++-------------------------------+-------------------------------------------------------------------------+-------------------+ Methods ------- -+-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_node` **(** :ref:`StringName` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2( 0, 0 ) **)** | -+-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`connect_node` **(** :ref:`StringName` input_node, :ref:`int` input_index, :ref:`StringName` output_node **)** | -+-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`disconnect_node` **(** :ref:`StringName` input_node, :ref:`int` input_index **)** | -+-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AnimationNode` | :ref:`get_node` **(** :ref:`StringName` name **)** const | -+-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_node_position` **(** :ref:`StringName` name **)** const | -+-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_node` **(** :ref:`StringName` name **)** const | -+-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`remove_node` **(** :ref:`StringName` name **)** | -+-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`rename_node` **(** :ref:`StringName` name, :ref:`StringName` new_name **)** | -+-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_node_position` **(** :ref:`StringName` name, :ref:`Vector2` position **)** | -+-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_node` **(** :ref:`StringName` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2(0, 0) **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`connect_node` **(** :ref:`StringName` input_node, :ref:`int` input_index, :ref:`StringName` output_node **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_node` **(** :ref:`StringName` input_node, :ref:`int` input_index **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AnimationNode` | :ref:`get_node` **(** :ref:`StringName` name **)** |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_node_position` **(** :ref:`StringName` name **)** |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_node` **(** :ref:`StringName` name **)** |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_node` **(** :ref:`StringName` name **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_node` **(** :ref:`StringName` name, :ref:`StringName` new_name **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_node_position` **(** :ref:`StringName` name, :ref:`Vector2` position **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Constants --------- @@ -88,7 +88,7 @@ Property Descriptions - :ref:`Vector2` **graph_offset** +-----------+-------------------------+ -| *Default* | ``Vector2( 0, 0 )`` | +| *Default* | ``Vector2(0, 0)`` | +-----------+-------------------------+ | *Setter* | set_graph_offset(value) | +-----------+-------------------------+ @@ -102,7 +102,7 @@ Method Descriptions .. _class_AnimationNodeBlendTree_method_add_node: -- void **add_node** **(** :ref:`StringName` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2( 0, 0 ) **)** +- void **add_node** **(** :ref:`StringName` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2(0, 0) **)** Adds an :ref:`AnimationNode` at the given ``position``. The ``name`` is used to identify the created sub-node later. @@ -126,7 +126,7 @@ Disconnects the node connected to the specified input. .. _class_AnimationNodeBlendTree_method_get_node: -- :ref:`AnimationNode` **get_node** **(** :ref:`StringName` name **)** const +- :ref:`AnimationNode` **get_node** **(** :ref:`StringName` name **)** |const| Returns the sub-node with the specified ``name``. @@ -134,7 +134,7 @@ Returns the sub-node with the specified ``name``. .. _class_AnimationNodeBlendTree_method_get_node_position: -- :ref:`Vector2` **get_node_position** **(** :ref:`StringName` name **)** const +- :ref:`Vector2` **get_node_position** **(** :ref:`StringName` name **)** |const| Returns the position of the sub-node with the specified ``name``. @@ -142,7 +142,7 @@ Returns the position of the sub-node with the specified ``name``. .. _class_AnimationNodeBlendTree_method_has_node: -- :ref:`bool` **has_node** **(** :ref:`StringName` name **)** const +- :ref:`bool` **has_node** **(** :ref:`StringName` name **)** |const| Returns ``true`` if a sub-node with specified ``name`` exists. @@ -170,3 +170,9 @@ Changes the name of a sub-node. Modifies the position of a sub-node. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodeoneshot.rst b/classes/class_animationnodeoneshot.rst index be8bd9c05..c26835e18 100644 --- a/classes/class_animationnodeoneshot.rst +++ b/classes/class_animationnodeoneshot.rst @@ -9,7 +9,7 @@ AnimationNodeOneShot ==================== -**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Plays an animation once in :ref:`AnimationNodeBlendTree`. @@ -23,6 +23,8 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `Third Person Shooter Demo `__ + Properties ---------- @@ -44,7 +46,7 @@ Methods ------- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`MixMode` | :ref:`get_mix_mode` **(** **)** const | +| :ref:`MixMode` | :ref:`get_mix_mode` **(** **)** |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_mix_mode` **(** :ref:`MixMode` mode **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ @@ -160,7 +162,7 @@ Method Descriptions .. _class_AnimationNodeOneShot_method_get_mix_mode: -- :ref:`MixMode` **get_mix_mode** **(** **)** const +- :ref:`MixMode` **get_mix_mode** **(** **)** |const| ---- @@ -168,3 +170,9 @@ Method Descriptions - void **set_mix_mode** **(** :ref:`MixMode` mode **)** +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodeoutput.rst b/classes/class_animationnodeoutput.rst index ab5c4937d..f8c46240c 100644 --- a/classes/class_animationnodeoutput.rst +++ b/classes/class_animationnodeoutput.rst @@ -9,7 +9,7 @@ AnimationNodeOutput =================== -**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Generic output node to be added to :ref:`AnimationNodeBlendTree`. @@ -18,3 +18,13 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `3D Platformer Demo `__ + +- `Third Person Shooter Demo `__ + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodestatemachine.rst b/classes/class_animationnodestatemachine.rst index 143b57eea..85532df8e 100644 --- a/classes/class_animationnodestatemachine.rst +++ b/classes/class_animationnodestatemachine.rst @@ -9,7 +9,7 @@ AnimationNodeStateMachine ========================= -**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` State machine for control of animations. @@ -20,11 +20,21 @@ Contains multiple nodes representing animation states, connected in a graph. Nod **Example:** -:: + +.. tabs:: + + .. code-tab:: gdscript var state_machine = $AnimationTree.get("parameters/playback") state_machine.travel("some_state") + .. code-tab:: csharp + + var stateMachine = GetNode("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback; + stateMachine.Travel("some_state"); + + + Tutorials --------- @@ -34,33 +44,33 @@ Methods ------- +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_node` **(** :ref:`StringName` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2( 0, 0 ) **)** | +| void | :ref:`add_node` **(** :ref:`StringName` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2(0, 0) **)** | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_transition` **(** :ref:`StringName` from, :ref:`StringName` to, :ref:`AnimationNodeStateMachineTransition` transition **)** | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_end_node` **(** **)** const | +| :ref:`String` | :ref:`get_end_node` **(** **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_graph_offset` **(** **)** const | +| :ref:`Vector2` | :ref:`get_graph_offset` **(** **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AnimationNode` | :ref:`get_node` **(** :ref:`StringName` name **)** const | +| :ref:`AnimationNode` | :ref:`get_node` **(** :ref:`StringName` name **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`get_node_name` **(** :ref:`AnimationNode` node **)** const | +| :ref:`StringName` | :ref:`get_node_name` **(** :ref:`AnimationNode` node **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_node_position` **(** :ref:`StringName` name **)** const | +| :ref:`Vector2` | :ref:`get_node_position` **(** :ref:`StringName` name **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_start_node` **(** **)** const | +| :ref:`String` | :ref:`get_start_node` **(** **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AnimationNodeStateMachineTransition` | :ref:`get_transition` **(** :ref:`int` idx **)** const | +| :ref:`AnimationNodeStateMachineTransition` | :ref:`get_transition` **(** :ref:`int` idx **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_transition_count` **(** **)** const | +| :ref:`int` | :ref:`get_transition_count` **(** **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`get_transition_from` **(** :ref:`int` idx **)** const | +| :ref:`StringName` | :ref:`get_transition_from` **(** :ref:`int` idx **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`get_transition_to` **(** :ref:`int` idx **)** const | +| :ref:`StringName` | :ref:`get_transition_to` **(** :ref:`int` idx **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_node` **(** :ref:`StringName` name **)** const | +| :ref:`bool` | :ref:`has_node` **(** :ref:`StringName` name **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_transition` **(** :ref:`StringName` from, :ref:`StringName` to **)** const | +| :ref:`bool` | :ref:`has_transition` **(** :ref:`StringName` from, :ref:`StringName` to **)** |const| | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_node` **(** :ref:`StringName` name **)** | +---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -86,7 +96,7 @@ Method Descriptions .. _class_AnimationNodeStateMachine_method_add_node: -- void **add_node** **(** :ref:`StringName` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2( 0, 0 ) **)** +- void **add_node** **(** :ref:`StringName` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2(0, 0) **)** Adds a new node to the graph. The ``position`` is used for display in the editor. @@ -102,7 +112,7 @@ Adds a transition between the given nodes. .. _class_AnimationNodeStateMachine_method_get_end_node: -- :ref:`String` **get_end_node** **(** **)** const +- :ref:`String` **get_end_node** **(** **)** |const| Returns the graph's end node. @@ -110,7 +120,7 @@ Returns the graph's end node. .. _class_AnimationNodeStateMachine_method_get_graph_offset: -- :ref:`Vector2` **get_graph_offset** **(** **)** const +- :ref:`Vector2` **get_graph_offset** **(** **)** |const| Returns the draw offset of the graph. Used for display in the editor. @@ -118,7 +128,7 @@ Returns the draw offset of the graph. Used for display in the editor. .. _class_AnimationNodeStateMachine_method_get_node: -- :ref:`AnimationNode` **get_node** **(** :ref:`StringName` name **)** const +- :ref:`AnimationNode` **get_node** **(** :ref:`StringName` name **)** |const| Returns the animation node with the given name. @@ -126,7 +136,7 @@ Returns the animation node with the given name. .. _class_AnimationNodeStateMachine_method_get_node_name: -- :ref:`StringName` **get_node_name** **(** :ref:`AnimationNode` node **)** const +- :ref:`StringName` **get_node_name** **(** :ref:`AnimationNode` node **)** |const| Returns the given animation node's name. @@ -134,7 +144,7 @@ Returns the given animation node's name. .. _class_AnimationNodeStateMachine_method_get_node_position: -- :ref:`Vector2` **get_node_position** **(** :ref:`StringName` name **)** const +- :ref:`Vector2` **get_node_position** **(** :ref:`StringName` name **)** |const| Returns the given node's coordinates. Used for display in the editor. @@ -142,7 +152,7 @@ Returns the given node's coordinates. Used for display in the editor. .. _class_AnimationNodeStateMachine_method_get_start_node: -- :ref:`String` **get_start_node** **(** **)** const +- :ref:`String` **get_start_node** **(** **)** |const| Returns the graph's end node. @@ -150,7 +160,7 @@ Returns the graph's end node. .. _class_AnimationNodeStateMachine_method_get_transition: -- :ref:`AnimationNodeStateMachineTransition` **get_transition** **(** :ref:`int` idx **)** const +- :ref:`AnimationNodeStateMachineTransition` **get_transition** **(** :ref:`int` idx **)** |const| Returns the given transition. @@ -158,7 +168,7 @@ Returns the given transition. .. _class_AnimationNodeStateMachine_method_get_transition_count: -- :ref:`int` **get_transition_count** **(** **)** const +- :ref:`int` **get_transition_count** **(** **)** |const| Returns the number of connections in the graph. @@ -166,7 +176,7 @@ Returns the number of connections in the graph. .. _class_AnimationNodeStateMachine_method_get_transition_from: -- :ref:`StringName` **get_transition_from** **(** :ref:`int` idx **)** const +- :ref:`StringName` **get_transition_from** **(** :ref:`int` idx **)** |const| Returns the given transition's start node. @@ -174,7 +184,7 @@ Returns the given transition's start node. .. _class_AnimationNodeStateMachine_method_get_transition_to: -- :ref:`StringName` **get_transition_to** **(** :ref:`int` idx **)** const +- :ref:`StringName` **get_transition_to** **(** :ref:`int` idx **)** |const| Returns the given transition's end node. @@ -182,7 +192,7 @@ Returns the given transition's end node. .. _class_AnimationNodeStateMachine_method_has_node: -- :ref:`bool` **has_node** **(** :ref:`StringName` name **)** const +- :ref:`bool` **has_node** **(** :ref:`StringName` name **)** |const| Returns ``true`` if the graph contains the given node. @@ -190,7 +200,7 @@ Returns ``true`` if the graph contains the given node. .. _class_AnimationNodeStateMachine_method_has_transition: -- :ref:`bool` **has_transition** **(** :ref:`StringName` from, :ref:`StringName` to **)** const +- :ref:`bool` **has_transition** **(** :ref:`StringName` from, :ref:`StringName` to **)** |const| Returns ``true`` if there is a transition between the given nodes. @@ -264,3 +274,9 @@ Sets the node's coordinates. Used for display in the editor. Sets the given node as the graph start point. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodestatemachineplayback.rst b/classes/class_animationnodestatemachineplayback.rst index 4017277bf..d53a390f5 100644 --- a/classes/class_animationnodestatemachineplayback.rst +++ b/classes/class_animationnodestatemachineplayback.rst @@ -9,7 +9,7 @@ AnimationNodeStateMachinePlayback ================================= -**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Playback control for :ref:`AnimationNodeStateMachine`. @@ -20,11 +20,21 @@ Allows control of :ref:`AnimationTree` state machines creat **Example:** -:: + +.. tabs:: + + .. code-tab:: gdscript var state_machine = $AnimationTree.get("parameters/playback") state_machine.travel("some_state") + .. code-tab:: csharp + + var stateMachine = GetNode("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback; + stateMachine.Travel("some_state"); + + + Tutorials --------- @@ -33,41 +43,59 @@ Tutorials Properties ---------- -+-------------------------+-------------------------+-----------------+ -| :ref:`bool` | resource_local_to_scene | **O:** ``true`` | -+-------------------------+-------------------------+-----------------+ ++-------------------------+-------------------------+------------------------------+ +| :ref:`bool` | resource_local_to_scene | ``true`` *(parent override)* | ++-------------------------+-------------------------+------------------------------+ Methods ------- -+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`get_current_node` **(** **)** const | -+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedStringArray` | :ref:`get_travel_path` **(** **)** const | -+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_playing` **(** **)** const | -+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`start` **(** :ref:`StringName` node **)** | -+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`stop` **(** **)** | -+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`travel` **(** :ref:`StringName` to_node **)** | -+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_current_length` **(** **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`StringName` | :ref:`get_current_node` **(** **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_current_play_position` **(** **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedStringArray` | :ref:`get_travel_path` **(** **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`start` **(** :ref:`StringName` node **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`travel` **(** :ref:`StringName` to_node **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- +.. _class_AnimationNodeStateMachinePlayback_method_get_current_length: + +- :ref:`float` **get_current_length** **(** **)** |const| + +---- + .. _class_AnimationNodeStateMachinePlayback_method_get_current_node: -- :ref:`StringName` **get_current_node** **(** **)** const +- :ref:`StringName` **get_current_node** **(** **)** |const| Returns the currently playing animation state. ---- +.. _class_AnimationNodeStateMachinePlayback_method_get_current_play_position: + +- :ref:`float` **get_current_play_position** **(** **)** |const| + +Returns the playback position within the current animation state. + +---- + .. _class_AnimationNodeStateMachinePlayback_method_get_travel_path: -- :ref:`PackedStringArray` **get_travel_path** **(** **)** const +- :ref:`PackedStringArray` **get_travel_path** **(** **)** |const| Returns the current travel path as computed internally by the A\* algorithm. @@ -75,7 +103,7 @@ Returns the current travel path as computed internally by the A\* algorithm. .. _class_AnimationNodeStateMachinePlayback_method_is_playing: -- :ref:`bool` **is_playing** **(** **)** const +- :ref:`bool` **is_playing** **(** **)** |const| Returns ``true`` if an animation is playing. @@ -103,3 +131,9 @@ Stops the currently playing animation. Transitions from the current state to another one, following the shortest path. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodestatemachinetransition.rst b/classes/class_animationnodestatemachinetransition.rst index 706cbf8c2..b457c2b5e 100644 --- a/classes/class_animationnodestatemachinetransition.rst +++ b/classes/class_animationnodestatemachinetransition.rst @@ -9,7 +9,7 @@ AnimationNodeStateMachineTransition =================================== -**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` @@ -22,7 +22,7 @@ Properties ---------- +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ -| :ref:`StringName` | :ref:`advance_condition` | ``@""`` | +| :ref:`StringName` | :ref:`advance_condition` | ``&""`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`auto_advance` | ``false`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ @@ -71,18 +71,27 @@ Property Descriptions - :ref:`StringName` **advance_condition** +-----------+------------------------------+ -| *Default* | ``@""`` | +| *Default* | ``&""`` | +-----------+------------------------------+ | *Setter* | set_advance_condition(value) | +-----------+------------------------------+ | *Getter* | get_advance_condition() | +-----------+------------------------------+ -Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the :ref:`AnimationTree` that can be controlled from code (see `https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html#controlling-from-code `_). For example, if :ref:`AnimationTree.tree_root` is an :ref:`AnimationNodeStateMachine` and :ref:`advance_condition` is set to ``"idle"``: +Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the :ref:`AnimationTree` that can be controlled from code (see `https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html#controlling-from-code `__). For example, if :ref:`AnimationTree.tree_root` is an :ref:`AnimationNodeStateMachine` and :ref:`advance_condition` is set to ``"idle"``: + + +.. tabs:: + + .. code-tab:: gdscript + + $animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0)) + + .. code-tab:: csharp + + GetNode("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.x == 0)); -:: - $animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0) ---- @@ -164,3 +173,9 @@ The transition type. The time to cross-fade between this state and the next. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodetimescale.rst b/classes/class_animationnodetimescale.rst index a169254cb..53241c4b5 100644 --- a/classes/class_animationnodetimescale.rst +++ b/classes/class_animationnodetimescale.rst @@ -9,7 +9,7 @@ AnimationNodeTimeScale ====================== -**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` A time-scaling animation node to be used with :ref:`AnimationTree`. @@ -23,3 +23,11 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `3D Platformer Demo `__ + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodetimeseek.rst b/classes/class_animationnodetimeseek.rst index 94ed1abac..b44c6fc3a 100644 --- a/classes/class_animationnodetimeseek.rst +++ b/classes/class_animationnodetimeseek.rst @@ -9,17 +9,48 @@ AnimationNodeTimeSeek ===================== -**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` A time-seeking animation node to be used with :ref:`AnimationTree`. Description ----------- -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. +This node can be used to cause a seek command to happen to any sub-children of the animation graph. Use this node type to play an :ref:`Animation` from the start or a certain playback position inside the :ref:`AnimationNodeBlendTree`. After setting the time and changing the animation playback, the seek node automatically goes into sleep mode on the next process frame by setting its ``seek_position`` value to ``-1.0``. + + +.. tabs:: + + .. code-tab:: gdscript + + # Play child animation from the start. + animation_tree.set("parameters/Seek/seek_position", 0.0) + # Alternative syntax (same result as above). + animation_tree["parameters/Seek/seek_position"] = 0.0 + + # Play child animation from 12 second timestamp. + animation_tree.set("parameters/Seek/seek_position", 12.0) + # Alternative syntax (same result as above). + animation_tree["parameters/Seek/seek_position"] = 12.0 + + .. code-tab:: csharp + + // Play child animation from the start. + animationTree.Set("parameters/Seek/seek_position", 0.0); + + // Play child animation from 12 second timestamp. + animationTree.Set("parameters/Seek/seek_position", 12.0); + + Tutorials --------- - :doc:`../tutorials/animation/animation_tree` +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationnodetransition.rst b/classes/class_animationnodetransition.rst index 4878bc86c..0730da3af 100644 --- a/classes/class_animationnodetransition.rst +++ b/classes/class_animationnodetransition.rst @@ -9,7 +9,7 @@ AnimationNodeTransition ======================= -**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` A generic animation transition node for :ref:`AnimationTree`. @@ -23,6 +23,10 @@ Tutorials - :doc:`../tutorials/animation/animation_tree` +- `3D Platformer Demo `__ + +- `Third Person Shooter Demo `__ + Properties ---------- @@ -36,9 +40,9 @@ Methods ------- +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_input_caption` **(** :ref:`int` input **)** const | +| :ref:`String` | :ref:`get_input_caption` **(** :ref:`int` input **)** |const| | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_input_set_as_auto_advance` **(** :ref:`int` input **)** const | +| :ref:`bool` | :ref:`is_input_set_as_auto_advance` **(** :ref:`int` input **)** |const| | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_input_as_auto_advance` **(** :ref:`int` input, :ref:`bool` enable **)** | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -83,13 +87,13 @@ Method Descriptions .. _class_AnimationNodeTransition_method_get_input_caption: -- :ref:`String` **get_input_caption** **(** :ref:`int` input **)** const +- :ref:`String` **get_input_caption** **(** :ref:`int` input **)** |const| ---- .. _class_AnimationNodeTransition_method_is_input_set_as_auto_advance: -- :ref:`bool` **is_input_set_as_auto_advance** **(** :ref:`int` input **)** const +- :ref:`bool` **is_input_set_as_auto_advance** **(** :ref:`int` input **)** |const| ---- @@ -103,3 +107,9 @@ Method Descriptions - void **set_input_caption** **(** :ref:`int` input, :ref:`String` caption **)** +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationplayer.rst b/classes/class_animationplayer.rst index a7bfbc0b8..902f2b233 100644 --- a/classes/class_animationplayer.rst +++ b/classes/class_animationplayer.rst @@ -25,34 +25,40 @@ Updating the target properties of animations occurs at process time. Tutorials --------- +- :doc:`../tutorials/2d/2d_sprite_animation` + - :doc:`../tutorials/animation/index` +- `Third Person Shooter Demo `__ + Properties ---------- -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`String` | :ref:`assigned_animation` | | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`String` | :ref:`autoplay` | ``""`` | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`String` | :ref:`current_animation` | ``""`` | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`current_animation_length` | | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`current_animation_position` | | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`AnimationMethodCallMode` | :ref:`method_call_mode` | ``0`` | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`bool` | :ref:`playback_active` | | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`playback_default_blend_time` | ``0.0`` | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`AnimationProcessMode` | :ref:`playback_process_mode` | ``1`` | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`float` | :ref:`playback_speed` | ``1.0`` | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ -| :ref:`NodePath` | :ref:`root_node` | ``NodePath("..")`` | -+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`String` | :ref:`assigned_animation` | | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`String` | :ref:`autoplay` | ``""`` | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`String` | :ref:`current_animation` | ``""`` | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`float` | :ref:`current_animation_length` | | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`float` | :ref:`current_animation_position` | | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`AnimationMethodCallMode` | :ref:`method_call_mode` | ``0`` | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`bool` | :ref:`playback_active` | | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`float` | :ref:`playback_default_blend_time` | ``0.0`` | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`AnimationProcessCallback` | :ref:`playback_process_mode` | ``1`` | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`float` | :ref:`playback_speed` | ``1.0`` | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`bool` | :ref:`reset_on_save` | ``true`` | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`NodePath` | :ref:`root_node` | ``NodePath("..")`` | ++--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ Methods ------- @@ -62,7 +68,7 @@ Methods +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`advance` **(** :ref:`float` delta **)** | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`animation_get_next` **(** :ref:`StringName` anim_from **)** const | +| :ref:`StringName` | :ref:`animation_get_next` **(** :ref:`StringName` anim_from **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`animation_set_next` **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to **)** | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -70,21 +76,21 @@ Methods +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_queue` **(** **)** | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`find_animation` **(** :ref:`Animation` animation **)** const | +| :ref:`StringName` | :ref:`find_animation` **(** :ref:`Animation` animation **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Animation` | :ref:`get_animation` **(** :ref:`StringName` name **)** const | +| :ref:`Animation` | :ref:`get_animation` **(** :ref:`StringName` name **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedStringArray` | :ref:`get_animation_list` **(** **)** const | +| :ref:`PackedStringArray` | :ref:`get_animation_list` **(** **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_blend_time` **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to **)** const | +| :ref:`float` | :ref:`get_blend_time` **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_playing_speed` **(** **)** const | +| :ref:`float` | :ref:`get_playing_speed` **(** **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`get_queue` **(** **)** | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_animation` **(** :ref:`StringName` name **)** const | +| :ref:`bool` | :ref:`has_animation` **(** :ref:`StringName` name **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_playing` **(** **)** const | +| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`play` **(** :ref:`StringName` name="", :ref:`float` custom_blend=-1, :ref:`float` custom_speed=1.0, :ref:`bool` from_end=false **)** | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -110,7 +116,9 @@ Signals - **animation_changed** **(** :ref:`StringName` old_name, :ref:`StringName` new_name **)** -If the currently being played animation changes, this signal will notify of such change. +Emitted when a queued animation plays after the previous animation was finished. See :ref:`queue`. + +**Note:** The signal is not emitted when the animation is changed via :ref:`play` or from :ref:`AnimationTree`. ---- @@ -139,7 +147,7 @@ Notifies when the caches have been cleared, either automatically, or manually vi Enumerations ------------ -.. _enum_AnimationPlayer_AnimationProcessMode: +.. _enum_AnimationPlayer_AnimationProcessCallback: .. _class_AnimationPlayer_constant_ANIMATION_PROCESS_PHYSICS: @@ -147,7 +155,7 @@ Enumerations .. _class_AnimationPlayer_constant_ANIMATION_PROCESS_MANUAL: -enum **AnimationProcessMode**: +enum **AnimationProcessCallback**: - **ANIMATION_PROCESS_PHYSICS** = **0** --- Process animation during the physics process. This is especially useful when animating physics bodies. @@ -214,7 +222,9 @@ The name of the animation to play when the scene loads. | *Getter* | get_current_animation() | +-----------+------------------------------+ -The name of the current animation, "" if not playing anything. When being set, does not restart the animation. See also :ref:`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 :ref:`play` for more information on playing animations. + +**Note:** 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 :ref:`Animation`. ---- @@ -290,15 +300,15 @@ The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 p .. _class_AnimationPlayer_property_playback_process_mode: -- :ref:`AnimationProcessMode` **playback_process_mode** +- :ref:`AnimationProcessCallback` **playback_process_mode** -+-----------+-----------------------------------+ -| *Default* | ``1`` | -+-----------+-----------------------------------+ -| *Setter* | set_animation_process_mode(value) | -+-----------+-----------------------------------+ -| *Getter* | get_animation_process_mode() | -+-----------+-----------------------------------+ ++-----------+-----------------------------+ +| *Default* | ``1`` | ++-----------+-----------------------------+ +| *Setter* | set_process_callback(value) | ++-----------+-----------------------------+ +| *Getter* | get_process_callback() | ++-----------+-----------------------------+ The process notification in which to update animations. @@ -320,6 +330,24 @@ The speed scaling ratio. For instance, if this value is 1, then the animation pl ---- +.. _class_AnimationPlayer_property_reset_on_save: + +- :ref:`bool` **reset_on_save** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_reset_on_save_enabled(value) | ++-----------+----------------------------------+ +| *Getter* | is_reset_on_save_enabled() | ++-----------+----------------------------------+ + +This is used by the editor. If set to ``true``, the scene will be saved with the effects of the reset animation applied (as if it had been seeked to time 0), then reverted after saving. + +In other words, the saved scene file will contain the "default pose", as defined by the reset animation, if any, with the editor keeping the values that the nodes had before saving. + +---- + .. _class_AnimationPlayer_property_root_node: - :ref:`NodePath` **root_node** @@ -355,7 +383,7 @@ Shifts position in the animation timeline and immediately updates the animation. .. _class_AnimationPlayer_method_animation_get_next: -- :ref:`StringName` **animation_get_next** **(** :ref:`StringName` anim_from **)** const +- :ref:`StringName` **animation_get_next** **(** :ref:`StringName` anim_from **)** |const| Returns the name of the next animation in the queue. @@ -387,7 +415,7 @@ Clears all queued, unplayed animations. .. _class_AnimationPlayer_method_find_animation: -- :ref:`StringName` **find_animation** **(** :ref:`Animation` animation **)** const +- :ref:`StringName` **find_animation** **(** :ref:`Animation` animation **)** |const| Returns the name of ``animation`` or an empty string if not found. @@ -395,7 +423,7 @@ Returns the name of ``animation`` or an empty string if not found. .. _class_AnimationPlayer_method_get_animation: -- :ref:`Animation` **get_animation** **(** :ref:`StringName` name **)** const +- :ref:`Animation` **get_animation** **(** :ref:`StringName` name **)** |const| Returns the :ref:`Animation` with key ``name`` or ``null`` if not found. @@ -403,7 +431,7 @@ Returns the :ref:`Animation` with key ``name`` or ``null`` if n .. _class_AnimationPlayer_method_get_animation_list: -- :ref:`PackedStringArray` **get_animation_list** **(** **)** const +- :ref:`PackedStringArray` **get_animation_list** **(** **)** |const| Returns the list of stored animation names. @@ -411,7 +439,7 @@ Returns the list of stored animation names. .. _class_AnimationPlayer_method_get_blend_time: -- :ref:`float` **get_blend_time** **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to **)** const +- :ref:`float` **get_blend_time** **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to **)** |const| Gets the blend time (in seconds) between two animations, referenced by their names. @@ -419,7 +447,7 @@ Gets the blend time (in seconds) between two animations, referenced by their nam .. _class_AnimationPlayer_method_get_playing_speed: -- :ref:`float` **get_playing_speed** **(** **)** const +- :ref:`float` **get_playing_speed** **(** **)** |const| Gets the actual playing speed of current animation or 0 if not playing. This speed is the :ref:`playback_speed` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play` method. @@ -435,7 +463,7 @@ Returns a list of the animation names that are currently queued to play. .. _class_AnimationPlayer_method_has_animation: -- :ref:`bool` **has_animation** **(** :ref:`StringName` name **)** const +- :ref:`bool` **has_animation** **(** :ref:`StringName` name **)** |const| Returns ``true`` if the ``AnimationPlayer`` stores an :ref:`Animation` with key ``name``. @@ -443,7 +471,7 @@ Returns ``true`` if the ``AnimationPlayer`` stores an :ref:`Animation` **is_playing** **(** **)** const +- :ref:`bool` **is_playing** **(** **)** |const| Returns ``true`` if playing an animation. @@ -521,3 +549,9 @@ Stops or pauses the currently playing animation. If ``reset`` is ``true``, the a If ``reset`` is ``false``, the :ref:`current_animation_position` will be kept and calling :ref:`play` or :ref:`play_backwards` without arguments or with the same animation name as :ref:`assigned_animation` will resume the animation. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationrootnode.rst b/classes/class_animationrootnode.rst index ece1f97a6..7a3bfbc25 100644 --- a/classes/class_animationrootnode.rst +++ b/classes/class_animationrootnode.rst @@ -9,9 +9,15 @@ AnimationRootNode ================= -**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`AnimationNodeAnimation`, :ref:`AnimationNodeBlendSpace1D`, :ref:`AnimationNodeBlendSpace2D`, :ref:`AnimationNodeBlendTree`, :ref:`AnimationNodeStateMachine` +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationtrackeditplugin.rst b/classes/class_animationtrackeditplugin.rst index aa91f849a..7d8fe5859 100644 --- a/classes/class_animationtrackeditplugin.rst +++ b/classes/class_animationtrackeditplugin.rst @@ -9,7 +9,13 @@ AnimationTrackEditPlugin ======================== -**Inherits:** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`RefCounted` **<** :ref:`Object` +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_animationtree.rst b/classes/class_animationtree.rst index a8c667683..60c311bb3 100644 --- a/classes/class_animationtree.rst +++ b/classes/class_animationtree.rst @@ -13,43 +13,50 @@ AnimationTree A node to be used for advanced animation transitions in an :ref:`AnimationPlayer`. +Description +----------- + +A node to be used for advanced animation transitions in an :ref:`AnimationPlayer`. + +**Note:** When linked with an :ref:`AnimationPlayer`, several properties and methods of the corresponding :ref:`AnimationPlayer` will not function as expected. Playback and transitions should be handled using only the ``AnimationTree`` and its constituent :ref:`AnimationNode`\ (s). The :ref:`AnimationPlayer` node should be used solely for adding, deleting, and editing animations. + Tutorials --------- - :doc:`../tutorials/animation/animation_tree` -- `https://github.com/godotengine/tps-demo `_ +- `Third Person Shooter Demo `__ Properties ---------- -+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ -| :ref:`bool` | :ref:`active` | ``false`` | -+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ -| :ref:`NodePath` | :ref:`anim_player` | ``NodePath("")`` | -+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ -| :ref:`AnimationProcessMode` | :ref:`process_mode` | ``1`` | -+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ -| :ref:`NodePath` | :ref:`root_motion_track` | ``NodePath("")`` | -+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ -| :ref:`AnimationNode` | :ref:`tree_root` | | -+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ ++------------------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`active` | ``false`` | ++------------------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`anim_player` | ``NodePath("")`` | ++------------------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ +| :ref:`AnimationProcessCallback` | :ref:`process_callback` | ``1`` | ++------------------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`root_motion_track` | ``NodePath("")`` | ++------------------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ +| :ref:`AnimationNode` | :ref:`tree_root` | | ++------------------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ Methods ------- -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`advance` **(** :ref:`float` delta **)** | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Transform` | :ref:`get_root_motion_transform` **(** **)** const | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`rename_parameter` **(** :ref:`String` old_name, :ref:`String` new_name **)** | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`advance` **(** :ref:`float` delta **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform3D` | :ref:`get_root_motion_transform` **(** **)** |const| | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_parameter` **(** :ref:`String` old_name, :ref:`String` new_name **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ Enumerations ------------ -.. _enum_AnimationTree_AnimationProcessMode: +.. _enum_AnimationTree_AnimationProcessCallback: .. _class_AnimationTree_constant_ANIMATION_PROCESS_PHYSICS: @@ -57,7 +64,7 @@ Enumerations .. _class_AnimationTree_constant_ANIMATION_PROCESS_MANUAL: -enum **AnimationProcessMode**: +enum **AnimationProcessCallback**: - **ANIMATION_PROCESS_PHYSICS** = **0** --- The animations will progress during the physics frame (i.e. :ref:`Node._physics_process`). @@ -100,19 +107,19 @@ The path to the :ref:`AnimationPlayer` used for animating ---- -.. _class_AnimationTree_property_process_mode: +.. _class_AnimationTree_property_process_callback: -- :ref:`AnimationProcessMode` **process_mode** +- :ref:`AnimationProcessCallback` **process_callback** -+-----------+-------------------------+ -| *Default* | ``1`` | -+-----------+-------------------------+ -| *Setter* | set_process_mode(value) | -+-----------+-------------------------+ -| *Getter* | get_process_mode() | -+-----------+-------------------------+ ++-----------+-----------------------------+ +| *Default* | ``1`` | ++-----------+-----------------------------+ +| *Setter* | set_process_callback(value) | ++-----------+-----------------------------+ +| *Getter* | get_process_callback() | ++-----------+-----------------------------+ -The process mode of this ``AnimationTree``. See :ref:`AnimationProcessMode` for available modes. +The process mode of this ``AnimationTree``. See :ref:`AnimationProcessCallback` for available modes. ---- @@ -128,6 +135,10 @@ The process mode of this ``AnimationTree``. See :ref:`AnimationProcessMode`, the transformation will be cancelled visually, and the animation will appear to stay in place. See also :ref:`get_root_motion_transform` and :ref:`RootMotionView`. + ---- .. _class_AnimationTree_property_tree_root: @@ -155,7 +166,9 @@ Manually advance the animations by the specified time (in seconds). .. _class_AnimationTree_method_get_root_motion_transform: -- :ref:`Transform` **get_root_motion_transform** **(** **)** const +- :ref:`Transform3D` **get_root_motion_transform** **(** **)** |const| + +Retrieve the motion of the :ref:`root_motion_track` as a :ref:`Transform3D` that can be used elsewhere. If :ref:`root_motion_track` is not a path to a track of type :ref:`Animation.TYPE_TRANSFORM3D`, returns an identity transformation. See also :ref:`root_motion_track` and :ref:`RootMotionView`. ---- @@ -163,3 +176,9 @@ Manually advance the animations by the specified time (in seconds). - void **rename_parameter** **(** :ref:`String` old_name, :ref:`String` new_name **)** +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_area.rst b/classes/class_area.rst deleted file mode 100644 index d70ee938e..000000000 --- a/classes/class_area.rst +++ /dev/null @@ -1,542 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the Area.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_Area: - -Area -==== - -**Inherits:** :ref:`CollisionObject` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` - -General-purpose area node for detection and 3D physics influence. - -Description ------------ - -3D area that detects :ref:`CollisionObject` nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping). - -Properties ----------- - -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`angular_damp` | ``0.1`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`StringName` | :ref:`audio_bus_name` | ``@"Master"`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`audio_bus_override` | ``false`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`int` | :ref:`collision_layer` | ``1`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`int` | :ref:`collision_mask` | ``1`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`gravity` | ``9.8`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`gravity_distance_scale` | ``0.0`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`gravity_point` | ``false`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`Vector3` | :ref:`gravity_vec` | ``Vector3( 0, -1, 0 )`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`linear_damp` | ``0.1`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`monitorable` | ``true`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`monitoring` | ``true`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`priority` | ``0.0`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`reverb_bus_amount` | ``0.0`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`reverb_bus_enable` | ``false`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`StringName` | :ref:`reverb_bus_name` | ``@"Master"`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`float` | :ref:`reverb_bus_uniformity` | ``0.0`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ -| :ref:`SpaceOverride` | :ref:`space_override` | ``0`` | -+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ - -Methods -------- - -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`get_collision_layer_bit` **(** :ref:`int` bit **)** const | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** const | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`get_overlapping_areas` **(** **)** const | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`get_overlapping_bodies` **(** **)** const | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`overlaps_area` **(** :ref:`Node` area **)** const | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`overlaps_body` **(** :ref:`Node` body **)** const | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_collision_layer_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | -+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ - -Signals -------- - -.. _class_Area_signal_area_entered: - -- **area_entered** **(** :ref:`Area` area **)** - -Emitted when another area enters. - ----- - -.. _class_Area_signal_area_exited: - -- **area_exited** **(** :ref:`Area` area **)** - -Emitted when another area exits. - ----- - -.. _class_Area_signal_area_shape_entered: - -- **area_shape_entered** **(** :ref:`int` area_id, :ref:`Area` area, :ref:`int` area_shape, :ref:`int` self_shape **)** - -Emitted when another area enters, reporting which areas overlapped. ``shape_owner_get_owner(shape_find_owner(shape))`` returns the parent object of the owner of the ``shape``. - ----- - -.. _class_Area_signal_area_shape_exited: - -- **area_shape_exited** **(** :ref:`int` area_id, :ref:`Area` area, :ref:`int` area_shape, :ref:`int` self_shape **)** - -Emitted when another area exits, reporting which areas were overlapping. - ----- - -.. _class_Area_signal_body_entered: - -- **body_entered** **(** :ref:`Node` body **)** - -Emitted when a physics body enters. - -The ``body`` argument can either be a :ref:`PhysicsBody` or a :ref:`GridMap` instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). - ----- - -.. _class_Area_signal_body_exited: - -- **body_exited** **(** :ref:`Node` body **)** - -Emitted when a physics body exits. - -The ``body`` argument can either be a :ref:`PhysicsBody` or a :ref:`GridMap` instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). - ----- - -.. _class_Area_signal_body_shape_entered: - -- **body_shape_entered** **(** :ref:`int` body_id, :ref:`Node` body, :ref:`int` body_shape, :ref:`int` area_shape **)** - -Emitted when a physics body enters, reporting which shapes overlapped. - -The ``body`` argument can either be a :ref:`PhysicsBody` or a :ref:`GridMap` instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). - ----- - -.. _class_Area_signal_body_shape_exited: - -- **body_shape_exited** **(** :ref:`int` body_id, :ref:`Node` body, :ref:`int` body_shape, :ref:`int` area_shape **)** - -Emitted when a physics body exits, reporting which shapes were overlapping. - -The ``body`` argument can either be a :ref:`PhysicsBody` or a :ref:`GridMap` instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). - -Enumerations ------------- - -.. _enum_Area_SpaceOverride: - -.. _class_Area_constant_SPACE_OVERRIDE_DISABLED: - -.. _class_Area_constant_SPACE_OVERRIDE_COMBINE: - -.. _class_Area_constant_SPACE_OVERRIDE_COMBINE_REPLACE: - -.. _class_Area_constant_SPACE_OVERRIDE_REPLACE: - -.. _class_Area_constant_SPACE_OVERRIDE_REPLACE_COMBINE: - -enum **SpaceOverride**: - -- **SPACE_OVERRIDE_DISABLED** = **0** --- This area does not affect gravity/damping. - -- **SPACE_OVERRIDE_COMBINE** = **1** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority` order). - -- **SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority` order), ignoring any lower priority areas. - -- **SPACE_OVERRIDE_REPLACE** = **3** --- This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas. - -- **SPACE_OVERRIDE_REPLACE_COMBINE** = **4** --- This area replaces any gravity/damping calculated so far (in :ref:`priority` order), but keeps calculating the rest of the areas. - -Property Descriptions ---------------------- - -.. _class_Area_property_angular_damp: - -- :ref:`float` **angular_damp** - -+-----------+-------------------------+ -| *Default* | ``0.1`` | -+-----------+-------------------------+ -| *Setter* | set_angular_damp(value) | -+-----------+-------------------------+ -| *Getter* | get_angular_damp() | -+-----------+-------------------------+ - -The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from ``0`` (no damping) to ``1`` (full damping). - ----- - -.. _class_Area_property_audio_bus_name: - -- :ref:`StringName` **audio_bus_name** - -+-----------+----------------------+ -| *Default* | ``@"Master"`` | -+-----------+----------------------+ -| *Setter* | set_audio_bus(value) | -+-----------+----------------------+ -| *Getter* | get_audio_bus() | -+-----------+----------------------+ - -The name of the area's audio bus. - ----- - -.. _class_Area_property_audio_bus_override: - -- :ref:`bool` **audio_bus_override** - -+-----------+-------------------------------+ -| *Default* | ``false`` | -+-----------+-------------------------------+ -| *Setter* | set_audio_bus_override(value) | -+-----------+-------------------------------+ -| *Getter* | is_overriding_audio_bus() | -+-----------+-------------------------------+ - -If ``true``, the area's audio bus overrides the default audio bus. - ----- - -.. _class_Area_property_collision_layer: - -- :ref:`int` **collision_layer** - -+-----------+----------------------------+ -| *Default* | ``1`` | -+-----------+----------------------------+ -| *Setter* | set_collision_layer(value) | -+-----------+----------------------------+ -| *Getter* | get_collision_layer() | -+-----------+----------------------------+ - -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 :ref:`collision_mask`. - ----- - -.. _class_Area_property_collision_mask: - -- :ref:`int` **collision_mask** - -+-----------+---------------------------+ -| *Default* | ``1`` | -+-----------+---------------------------+ -| *Setter* | set_collision_mask(value) | -+-----------+---------------------------+ -| *Getter* | get_collision_mask() | -+-----------+---------------------------+ - -The physics layers this area scans to determine collision detection. - ----- - -.. _class_Area_property_gravity: - -- :ref:`float` **gravity** - -+-----------+--------------------+ -| *Default* | ``9.8`` | -+-----------+--------------------+ -| *Setter* | set_gravity(value) | -+-----------+--------------------+ -| *Getter* | get_gravity() | -+-----------+--------------------+ - -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. - ----- - -.. _class_Area_property_gravity_distance_scale: - -- :ref:`float` **gravity_distance_scale** - -+-----------+-----------------------------------+ -| *Default* | ``0.0`` | -+-----------+-----------------------------------+ -| *Setter* | set_gravity_distance_scale(value) | -+-----------+-----------------------------------+ -| *Getter* | get_gravity_distance_scale() | -+-----------+-----------------------------------+ - -The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. - ----- - -.. _class_Area_property_gravity_point: - -- :ref:`bool` **gravity_point** - -+-----------+-----------------------------+ -| *Default* | ``false`` | -+-----------+-----------------------------+ -| *Setter* | set_gravity_is_point(value) | -+-----------+-----------------------------+ -| *Getter* | is_gravity_a_point() | -+-----------+-----------------------------+ - -If ``true``, gravity is calculated from a point (set via :ref:`gravity_vec`). See also :ref:`space_override`. - ----- - -.. _class_Area_property_gravity_vec: - -- :ref:`Vector3` **gravity_vec** - -+-----------+---------------------------+ -| *Default* | ``Vector3( 0, -1, 0 )`` | -+-----------+---------------------------+ -| *Setter* | set_gravity_vector(value) | -+-----------+---------------------------+ -| *Getter* | get_gravity_vector() | -+-----------+---------------------------+ - -The area's gravity vector (not normalized). If gravity is a point (see :ref:`gravity_point`), this will be the point of attraction. - ----- - -.. _class_Area_property_linear_damp: - -- :ref:`float` **linear_damp** - -+-----------+------------------------+ -| *Default* | ``0.1`` | -+-----------+------------------------+ -| *Setter* | set_linear_damp(value) | -+-----------+------------------------+ -| *Getter* | get_linear_damp() | -+-----------+------------------------+ - -The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from ``0`` (no damping) to ``1`` (full damping). - ----- - -.. _class_Area_property_monitorable: - -- :ref:`bool` **monitorable** - -+-----------+------------------------+ -| *Default* | ``true`` | -+-----------+------------------------+ -| *Setter* | set_monitorable(value) | -+-----------+------------------------+ -| *Getter* | is_monitorable() | -+-----------+------------------------+ - -If ``true``, other monitoring areas can detect this area. - ----- - -.. _class_Area_property_monitoring: - -- :ref:`bool` **monitoring** - -+-----------+-----------------------+ -| *Default* | ``true`` | -+-----------+-----------------------+ -| *Setter* | set_monitoring(value) | -+-----------+-----------------------+ -| *Getter* | is_monitoring() | -+-----------+-----------------------+ - -If ``true``, the area detects bodies or areas entering and exiting it. - ----- - -.. _class_Area_property_priority: - -- :ref:`float` **priority** - -+-----------+---------------------+ -| *Default* | ``0.0`` | -+-----------+---------------------+ -| *Setter* | set_priority(value) | -+-----------+---------------------+ -| *Getter* | get_priority() | -+-----------+---------------------+ - -The area's priority. Higher priority areas are processed first. - ----- - -.. _class_Area_property_reverb_bus_amount: - -- :ref:`float` **reverb_bus_amount** - -+-----------+--------------------------+ -| *Default* | ``0.0`` | -+-----------+--------------------------+ -| *Setter* | set_reverb_amount(value) | -+-----------+--------------------------+ -| *Getter* | get_reverb_amount() | -+-----------+--------------------------+ - -The degree to which this area applies reverb to its associated audio. Ranges from ``0`` to ``1`` with ``0.1`` precision. - ----- - -.. _class_Area_property_reverb_bus_enable: - -- :ref:`bool` **reverb_bus_enable** - -+-----------+---------------------------+ -| *Default* | ``false`` | -+-----------+---------------------------+ -| *Setter* | set_use_reverb_bus(value) | -+-----------+---------------------------+ -| *Getter* | is_using_reverb_bus() | -+-----------+---------------------------+ - -If ``true``, the area applies reverb to its associated audio. - ----- - -.. _class_Area_property_reverb_bus_name: - -- :ref:`StringName` **reverb_bus_name** - -+-----------+-----------------------+ -| *Default* | ``@"Master"`` | -+-----------+-----------------------+ -| *Setter* | set_reverb_bus(value) | -+-----------+-----------------------+ -| *Getter* | get_reverb_bus() | -+-----------+-----------------------+ - -The reverb bus name to use for this area's associated audio. - ----- - -.. _class_Area_property_reverb_bus_uniformity: - -- :ref:`float` **reverb_bus_uniformity** - -+-----------+------------------------------+ -| *Default* | ``0.0`` | -+-----------+------------------------------+ -| *Setter* | set_reverb_uniformity(value) | -+-----------+------------------------------+ -| *Getter* | get_reverb_uniformity() | -+-----------+------------------------------+ - -The degree to which this area's reverb is a uniform effect. Ranges from ``0`` to ``1`` with ``0.1`` precision. - ----- - -.. _class_Area_property_space_override: - -- :ref:`SpaceOverride` **space_override** - -+-----------+--------------------------------+ -| *Default* | ``0`` | -+-----------+--------------------------------+ -| *Setter* | set_space_override_mode(value) | -+-----------+--------------------------------+ -| *Getter* | get_space_override_mode() | -+-----------+--------------------------------+ - -Override mode for gravity and damping calculations within this area. See :ref:`SpaceOverride` for possible values. - -Method Descriptions -------------------- - -.. _class_Area_method_get_collision_layer_bit: - -- :ref:`bool` **get_collision_layer_bit** **(** :ref:`int` bit **)** const - -Returns an individual bit on the layer mask. - ----- - -.. _class_Area_method_get_collision_mask_bit: - -- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** const - -Returns an individual bit on the collision mask. - ----- - -.. _class_Area_method_get_overlapping_areas: - -- :ref:`Array` **get_overlapping_areas** **(** **)** const - -Returns a list of intersecting ``Area``\ s. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. - ----- - -.. _class_Area_method_get_overlapping_bodies: - -- :ref:`Array` **get_overlapping_bodies** **(** **)** const - -Returns a list of intersecting :ref:`PhysicsBody`\ s. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. - ----- - -.. _class_Area_method_overlaps_area: - -- :ref:`bool` **overlaps_area** **(** :ref:`Node` area **)** const - -If ``true``, the given area overlaps the Area. - -**Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. - ----- - -.. _class_Area_method_overlaps_body: - -- :ref:`bool` **overlaps_body** **(** :ref:`Node` body **)** const - -If ``true``, the given physics body overlaps the Area. - -**Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. - -The ``body`` argument can either be a :ref:`PhysicsBody` or a :ref:`GridMap` instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). - ----- - -.. _class_Area_method_set_collision_layer_bit: - -- void **set_collision_layer_bit** **(** :ref:`int` bit, :ref:`bool` value **)** - -Set/clear individual bits on the layer mask. This simplifies editing this ``Area``'s layers. - ----- - -.. _class_Area_method_set_collision_mask_bit: - -- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** - -Set/clear individual bits on the collision mask. This simplifies editing which ``Area`` layers this ``Area`` scans. - diff --git a/classes/class_area2d.rst b/classes/class_area2d.rst index 2c04f52d1..c8dd522c2 100644 --- a/classes/class_area2d.rst +++ b/classes/class_area2d.rst @@ -11,71 +11,65 @@ Area2D **Inherits:** :ref:`CollisionObject2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` -2D area for detection and 2D physics influence. +2D area for detection and physics and audio influence. Description ----------- -2D area that detects :ref:`CollisionObject2D` nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping). +2D area that detects :ref:`CollisionObject2D` nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to a custom audio bus. Tutorials --------- - :doc:`../tutorials/physics/using_area_2d` +- `2D Dodge The Creeps Demo `__ + +- `2D Pong Demo `__ + +- `2D Platformer Demo `__ + Properties ---------- -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`float` | :ref:`angular_damp` | ``1.0`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`StringName` | :ref:`audio_bus_name` | ``@"Master"`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`bool` | :ref:`audio_bus_override` | ``false`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`int` | :ref:`collision_layer` | ``1`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`int` | :ref:`collision_mask` | ``1`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`float` | :ref:`gravity` | ``98.0`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`float` | :ref:`gravity_distance_scale` | ``0.0`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`bool` | :ref:`gravity_point` | ``false`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`Vector2` | :ref:`gravity_vec` | ``Vector2( 0, 1 )`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`float` | :ref:`linear_damp` | ``0.1`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`bool` | :ref:`monitorable` | ``true`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`bool` | :ref:`monitoring` | ``true`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`float` | :ref:`priority` | ``0.0`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ -| :ref:`SpaceOverride` | :ref:`space_override` | ``0`` | -+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`angular_damp` | ``1.0`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`StringName` | :ref:`audio_bus_name` | ``&"Master"`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`audio_bus_override` | ``false`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`gravity` | ``980.0`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`gravity_distance_scale` | ``0.0`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`gravity_point` | ``false`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`Vector2` | :ref:`gravity_vec` | ``Vector2(0, 1)`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`linear_damp` | ``0.1`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`monitorable` | ``true`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`bool` | :ref:`monitoring` | ``true`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`float` | :ref:`priority` | ``0.0`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ +| :ref:`SpaceOverride` | :ref:`space_override` | ``0`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+-------------------+ Methods ------- -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`get_collision_layer_bit` **(** :ref:`int` bit **)** const | -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** const | -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`get_overlapping_areas` **(** **)** const | -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`get_overlapping_bodies` **(** **)** const | -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`overlaps_area` **(** :ref:`Node` area **)** const | -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`overlaps_body` **(** :ref:`Node` body **)** const | -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_collision_layer_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`Area2D[]` | :ref:`get_overlapping_areas` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`Node2D[]` | :ref:`get_overlapping_bodies` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`overlaps_area` **(** :ref:`Node` area **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`overlaps_body` **(** :ref:`Node` body **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------+ Signals ------- @@ -84,7 +78,9 @@ Signals - **area_entered** **(** :ref:`Area2D` area **)** -Emitted when another area enters. +Emitted when another Area2D enters this Area2D. Requires :ref:`monitoring` to be set to ``true``. + +``area`` the other Area2D. ---- @@ -92,63 +88,93 @@ Emitted when another area enters. - **area_exited** **(** :ref:`Area2D` area **)** -Emitted when another area exits. +Emitted when another Area2D exits this Area2D. Requires :ref:`monitoring` to be set to ``true``. + +``area`` the other Area2D. ---- .. _class_Area2D_signal_area_shape_entered: -- **area_shape_entered** **(** :ref:`int` area_id, :ref:`Area2D` area, :ref:`int` area_shape, :ref:`int` self_shape **)** +- **area_shape_entered** **(** :ref:`RID` area_rid, :ref:`Area2D` area, :ref:`int` area_shape, :ref:`int` local_shape **)** -Emitted when another area enters, reporting which shapes overlapped. ``shape_owner_get_owner(shape_find_owner(shape))`` returns the parent object of the owner of the ``shape``. +Emitted when one of another Area2D's :ref:`Shape2D`\ s enters one of this Area2D's :ref:`Shape2D`\ s. Requires :ref:`monitoring` to be set to ``true``. + +``area_id`` the :ref:`RID` of the other Area2D's :ref:`CollisionObject2D` used by the :ref:`PhysicsServer2D`. + +``area`` the other Area2D. + +``area_shape`` the index of the :ref:`Shape2D` of the other Area2D used by the :ref:`PhysicsServer2D`. + +``local_shape`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. ---- .. _class_Area2D_signal_area_shape_exited: -- **area_shape_exited** **(** :ref:`int` area_id, :ref:`Area2D` area, :ref:`int` area_shape, :ref:`int` self_shape **)** +- **area_shape_exited** **(** :ref:`RID` area_rid, :ref:`Area2D` area, :ref:`int` area_shape, :ref:`int` local_shape **)** -Emitted when another area exits, reporting which shapes were overlapping. +Emitted when one of another Area2D's :ref:`Shape2D`\ s exits one of this Area2D's :ref:`Shape2D`\ s. Requires :ref:`monitoring` to be set to ``true``. + +``area_id`` the :ref:`RID` of the other Area2D's :ref:`CollisionObject2D` used by the :ref:`PhysicsServer2D`. + +``area`` the other Area2D. + +``area_shape`` the index of the :ref:`Shape2D` of the other Area2D used by the :ref:`PhysicsServer2D`. + +``local_shape`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. ---- .. _class_Area2D_signal_body_entered: -- **body_entered** **(** :ref:`Node` body **)** +- **body_entered** **(** :ref:`Node2D` body **)** -Emitted when a physics body enters. +Emitted when a :ref:`PhysicsBody2D` or :ref:`TileMap` enters this Area2D. Requires :ref:`monitoring` to be set to ``true``. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. -The ``body`` argument can either be a :ref:`PhysicsBody2D` or a :ref:`TileMap` instance (while TileMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. ---- .. _class_Area2D_signal_body_exited: -- **body_exited** **(** :ref:`Node` body **)** +- **body_exited** **(** :ref:`Node2D` body **)** -Emitted when a physics body exits. +Emitted when a :ref:`PhysicsBody2D` or :ref:`TileMap` exits this Area2D. Requires :ref:`monitoring` to be set to ``true``. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. -The ``body`` argument can either be a :ref:`PhysicsBody2D` or a :ref:`TileMap` instance (while TileMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. ---- .. _class_Area2D_signal_body_shape_entered: -- **body_shape_entered** **(** :ref:`int` body_id, :ref:`Node` body, :ref:`int` body_shape, :ref:`int` area_shape **)** +- **body_shape_entered** **(** :ref:`RID` body_rid, :ref:`Node2D` body, :ref:`int` body_shape, :ref:`int` local_shape **)** -Emitted when a physics body enters, reporting which shapes overlapped. +Emitted when one of a :ref:`PhysicsBody2D` or :ref:`TileMap`'s :ref:`Shape2D`\ s enters one of this Area2D's :ref:`Shape2D`\ s. Requires :ref:`monitoring` to be set to ``true``. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. -The ``body`` argument can either be a :ref:`PhysicsBody2D` or a :ref:`TileMap` instance (while TileMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). +``body_id`` the :ref:`RID` of the :ref:`PhysicsBody2D` or :ref:`TileSet`'s :ref:`CollisionObject2D` used by the :ref:`PhysicsServer2D`. + +``body`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody2D` or :ref:`TileMap`. + +``body_shape`` the index of the :ref:`Shape2D` of the :ref:`PhysicsBody2D` or :ref:`TileMap` used by the :ref:`PhysicsServer2D`. + +``local_shape`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. ---- .. _class_Area2D_signal_body_shape_exited: -- **body_shape_exited** **(** :ref:`int` body_id, :ref:`Node` body, :ref:`int` body_shape, :ref:`int` area_shape **)** +- **body_shape_exited** **(** :ref:`RID` body_rid, :ref:`Node2D` body, :ref:`int` body_shape, :ref:`int` local_shape **)** -Emitted when a physics body exits, reporting which shapes were overlapping. +Emitted when one of a :ref:`PhysicsBody2D` or :ref:`TileMap`'s :ref:`Shape2D`\ s exits one of this Area2D's :ref:`Shape2D`\ s. Requires :ref:`monitoring` to be set to ``true``. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. -The ``body`` argument can either be a :ref:`PhysicsBody2D` or a :ref:`TileMap` instance (while TileMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). +``body_id`` the :ref:`RID` of the :ref:`PhysicsBody2D` or :ref:`TileSet`'s :ref:`CollisionObject2D` used by the :ref:`PhysicsServer2D`. + +``body`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody2D` or :ref:`TileMap`. + +``body_shape`` the index of the :ref:`Shape2D` of the :ref:`PhysicsBody2D` or :ref:`TileMap` used by the :ref:`PhysicsServer2D`. + +``local_shape`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. Enumerations ------------ @@ -192,7 +218,9 @@ Property Descriptions | *Getter* | get_angular_damp() | +-----------+-------------------------+ -The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from ``0`` (no damping) to ``1`` (full damping). +The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. + +See :ref:`ProjectSettings.physics/2d/default_angular_damp` for more details about damping. ---- @@ -201,7 +229,7 @@ The rate at which objects stop spinning in this area. Represents the angular vel - :ref:`StringName` **audio_bus_name** +-----------+---------------------------+ -| *Default* | ``@"Master"`` | +| *Default* | ``&"Master"`` | +-----------+---------------------------+ | *Setter* | set_audio_bus_name(value) | +-----------+---------------------------+ @@ -228,51 +256,19 @@ If ``true``, the area's audio bus overrides the default audio bus. ---- -.. _class_Area2D_property_collision_layer: - -- :ref:`int` **collision_layer** - -+-----------+----------------------------+ -| *Default* | ``1`` | -+-----------+----------------------------+ -| *Setter* | set_collision_layer(value) | -+-----------+----------------------------+ -| *Getter* | get_collision_layer() | -+-----------+----------------------------+ - -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 :ref:`collision_mask`. - ----- - -.. _class_Area2D_property_collision_mask: - -- :ref:`int` **collision_mask** - -+-----------+---------------------------+ -| *Default* | ``1`` | -+-----------+---------------------------+ -| *Setter* | set_collision_mask(value) | -+-----------+---------------------------+ -| *Getter* | get_collision_mask() | -+-----------+---------------------------+ - -The physics layers this area scans to determine collision detection. - ----- - .. _class_Area2D_property_gravity: - :ref:`float` **gravity** +-----------+--------------------+ -| *Default* | ``98.0`` | +| *Default* | ``980.0`` | +-----------+--------------------+ | *Setter* | set_gravity(value) | +-----------+--------------------+ | *Getter* | get_gravity() | +-----------+--------------------+ -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. +The area's gravity intensity (in pixels per second squared). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. ---- @@ -313,7 +309,7 @@ If ``true``, gravity is calculated from a point (set via :ref:`gravity_vec` **gravity_vec** +-----------+---------------------------+ -| *Default* | ``Vector2( 0, 1 )`` | +| *Default* | ``Vector2(0, 1)`` | +-----------+---------------------------+ | *Setter* | set_gravity_vector(value) | +-----------+---------------------------+ @@ -336,7 +332,9 @@ The area's gravity vector (not normalized). If gravity is a point (see :ref:`gra | *Getter* | get_linear_damp() | +-----------+------------------------+ -The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from ``0`` (no damping) to ``1`` (full damping). +The rate at which objects stop moving in this area. Represents the linear velocity lost per second. + +See :ref:`ProjectSettings.physics/2d/default_linear_damp` for more details about damping. ---- @@ -405,25 +403,9 @@ Override mode for gravity and damping calculations within this area. See :ref:`S Method Descriptions ------------------- -.. _class_Area2D_method_get_collision_layer_bit: - -- :ref:`bool` **get_collision_layer_bit** **(** :ref:`int` bit **)** const - -Returns an individual bit on the layer mask. Describes whether other areas will collide with this one on the given layer. - ----- - -.. _class_Area2D_method_get_collision_mask_bit: - -- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** const - -Returns an individual bit on the collision mask. Describes whether this area will collide with others on the given layer. - ----- - .. _class_Area2D_method_get_overlapping_areas: -- :ref:`Array` **get_overlapping_areas** **(** **)** const +- :ref:`Area2D[]` **get_overlapping_areas** **(** **)** |const| Returns a list of intersecting ``Area2D``\ s. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. @@ -431,7 +413,7 @@ Returns a list of intersecting ``Area2D``\ s. For performance reasons (collision .. _class_Area2D_method_get_overlapping_bodies: -- :ref:`Array` **get_overlapping_bodies** **(** **)** const +- :ref:`Node2D[]` **get_overlapping_bodies** **(** **)** |const| Returns a list of intersecting :ref:`PhysicsBody2D`\ s. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. @@ -439,37 +421,27 @@ Returns a list of intersecting :ref:`PhysicsBody2D`\ s. For .. _class_Area2D_method_overlaps_area: -- :ref:`bool` **overlaps_area** **(** :ref:`Node` area **)** const +- :ref:`bool` **overlaps_area** **(** :ref:`Node` area **)** |const| If ``true``, the given area overlaps the Area2D. -**Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. +**Note:** The result of this test is not immediate after moving objects. For performance, the list of overlaps is updated once per frame and before the physics step. Consider using signals instead. ---- .. _class_Area2D_method_overlaps_body: -- :ref:`bool` **overlaps_body** **(** :ref:`Node` body **)** const +- :ref:`bool` **overlaps_body** **(** :ref:`Node` body **)** |const| If ``true``, the given physics body overlaps the Area2D. **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. -The ``body`` argument can either be a :ref:`PhysicsBody2D` or a :ref:`TileMap` instance (while TileMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). - ----- - -.. _class_Area2D_method_set_collision_layer_bit: - -- void **set_collision_layer_bit** **(** :ref:`int` bit, :ref:`bool` value **)** - -Set/clear individual bits on the layer mask. This makes getting an area in/out of only one layer easier. - ----- - -.. _class_Area2D_method_set_collision_mask_bit: - -- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** - -Set/clear individual bits on the collision mask. This makes selecting the areas scanned easier. +The ``body`` argument can either be a :ref:`PhysicsBody2D` or a :ref:`TileMap` instance (while TileMaps are not physics bodies themselves, they register their tiles with collision shapes as a virtual physics body). +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_area3d.rst b/classes/class_area3d.rst new file mode 100644 index 000000000..b553b9642 --- /dev/null +++ b/classes/class_area3d.rst @@ -0,0 +1,569 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Area3D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Area3D: + +Area3D +====== + +**Inherits:** :ref:`CollisionObject3D` **<** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` + +3D area for detection and physics and audio influence. + +Description +----------- + +3D area that detects :ref:`CollisionObject3D` nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to custom audio buses. + +Tutorials +--------- + +- `3D Platformer Demo `__ + +- `GUI in 3D Demo `__ + +Properties +---------- + ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`angular_damp` | ``0.1`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`StringName` | :ref:`audio_bus_name` | ``&"Master"`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`audio_bus_override` | ``false`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`gravity` | ``9.8`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`gravity_distance_scale` | ``0.0`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`gravity_point` | ``false`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`Vector3` | :ref:`gravity_vec` | ``Vector3(0, -1, 0)`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`linear_damp` | ``0.1`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`monitorable` | ``true`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`monitoring` | ``true`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`priority` | ``0.0`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`reverb_bus_amount` | ``0.0`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`reverb_bus_enable` | ``false`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`StringName` | :ref:`reverb_bus_name` | ``&"Master"`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`reverb_bus_uniformity` | ``0.0`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`SpaceOverride` | :ref:`space_override` | ``0`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`wind_attenuation_factor` | ``0.0`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`wind_force_magnitude` | ``0.0`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ +| :ref:`NodePath` | :ref:`wind_source_path` | ``NodePath("")`` | ++-------------------------------------------------+-------------------------------------------------------------------------------+-----------------------+ + +Methods +------- + ++-------------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`Area3D[]` | :ref:`get_overlapping_areas` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`Node3D[]` | :ref:`get_overlapping_bodies` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`overlaps_area` **(** :ref:`Node` area **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`overlaps_body` **(** :ref:`Node` body **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Area3D_signal_area_entered: + +- **area_entered** **(** :ref:`Area3D` area **)** + +Emitted when another Area3D enters this Area3D. Requires :ref:`monitoring` to be set to ``true``. + +``area`` the other Area3D. + +---- + +.. _class_Area3D_signal_area_exited: + +- **area_exited** **(** :ref:`Area3D` area **)** + +Emitted when another Area3D exits this Area3D. Requires :ref:`monitoring` to be set to ``true``. + +``area`` the other Area3D. + +---- + +.. _class_Area3D_signal_area_shape_entered: + +- **area_shape_entered** **(** :ref:`RID` area_rid, :ref:`Area3D` area, :ref:`int` area_shape, :ref:`int` local_shape **)** + +Emitted when one of another Area3D's :ref:`Shape3D`\ s enters one of this Area3D's :ref:`Shape3D`\ s. Requires :ref:`monitoring` to be set to ``true``. + +``area_id`` the :ref:`RID` of the other Area3D's :ref:`CollisionObject3D` used by the :ref:`PhysicsServer3D`. + +``area`` the other Area3D. + +``area_shape`` the index of the :ref:`Shape3D` of the other Area3D used by the :ref:`PhysicsServer3D`. + +``local_shape`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. + +---- + +.. _class_Area3D_signal_area_shape_exited: + +- **area_shape_exited** **(** :ref:`RID` area_rid, :ref:`Area3D` area, :ref:`int` area_shape, :ref:`int` local_shape **)** + +Emitted when one of another Area3D's :ref:`Shape3D`\ s enters one of this Area3D's :ref:`Shape3D`\ s. Requires :ref:`monitoring` to be set to ``true``. + +``area_id`` the :ref:`RID` of the other Area3D's :ref:`CollisionObject3D` used by the :ref:`PhysicsServer3D`. + +``area`` the other Area3D. + +``area_shape`` the index of the :ref:`Shape3D` of the other Area3D used by the :ref:`PhysicsServer3D`. + +``local_shape`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. + +---- + +.. _class_Area3D_signal_body_entered: + +- **body_entered** **(** :ref:`Node3D` body **)** + +Emitted when a :ref:`PhysicsBody3D` or :ref:`GridMap` enters this Area3D. Requires :ref:`monitoring` to be set to ``true``. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape3D`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody3D` or :ref:`GridMap`. + +---- + +.. _class_Area3D_signal_body_exited: + +- **body_exited** **(** :ref:`Node3D` body **)** + +Emitted when a :ref:`PhysicsBody3D` or :ref:`GridMap` exits this Area3D. Requires :ref:`monitoring` to be set to ``true``. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape3D`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody3D` or :ref:`GridMap`. + +---- + +.. _class_Area3D_signal_body_shape_entered: + +- **body_shape_entered** **(** :ref:`RID` body_rid, :ref:`Node3D` body, :ref:`int` body_shape, :ref:`int` local_shape **)** + +Emitted when one of a :ref:`PhysicsBody3D` or :ref:`GridMap`'s :ref:`Shape3D`\ s enters one of this Area3D's :ref:`Shape3D`\ s. Requires :ref:`monitoring` to be set to ``true``. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape3D`\ s. + +``body_id`` the :ref:`RID` of the :ref:`PhysicsBody3D` or :ref:`MeshLibrary`'s :ref:`CollisionObject3D` used by the :ref:`PhysicsServer3D`. + +``body`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody3D` or :ref:`GridMap`. + +``body_shape`` the index of the :ref:`Shape3D` of the :ref:`PhysicsBody3D` or :ref:`GridMap` used by the :ref:`PhysicsServer3D`. + +``local_shape`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. + +---- + +.. _class_Area3D_signal_body_shape_exited: + +- **body_shape_exited** **(** :ref:`RID` body_rid, :ref:`Node3D` body, :ref:`int` body_shape, :ref:`int` local_shape **)** + +Emitted when one of a :ref:`PhysicsBody3D` or :ref:`GridMap`'s :ref:`Shape3D`\ s enters one of this Area3D's :ref:`Shape3D`\ s. Requires :ref:`monitoring` to be set to ``true``. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape3D`\ s. + +``body_id`` the :ref:`RID` of the :ref:`PhysicsBody3D` or :ref:`MeshLibrary`'s :ref:`CollisionObject3D` used by the :ref:`PhysicsServer3D`. + +``body`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody3D` or :ref:`GridMap`. + +``body_shape`` the index of the :ref:`Shape3D` of the :ref:`PhysicsBody3D` or :ref:`GridMap` used by the :ref:`PhysicsServer3D`. + +``local_shape`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. + +Enumerations +------------ + +.. _enum_Area3D_SpaceOverride: + +.. _class_Area3D_constant_SPACE_OVERRIDE_DISABLED: + +.. _class_Area3D_constant_SPACE_OVERRIDE_COMBINE: + +.. _class_Area3D_constant_SPACE_OVERRIDE_COMBINE_REPLACE: + +.. _class_Area3D_constant_SPACE_OVERRIDE_REPLACE: + +.. _class_Area3D_constant_SPACE_OVERRIDE_REPLACE_COMBINE: + +enum **SpaceOverride**: + +- **SPACE_OVERRIDE_DISABLED** = **0** --- This area does not affect gravity/damping. + +- **SPACE_OVERRIDE_COMBINE** = **1** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority` order). + +- **SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority` order), ignoring any lower priority areas. + +- **SPACE_OVERRIDE_REPLACE** = **3** --- This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas. + +- **SPACE_OVERRIDE_REPLACE_COMBINE** = **4** --- This area replaces any gravity/damping calculated so far (in :ref:`priority` order), but keeps calculating the rest of the areas. + +Property Descriptions +--------------------- + +.. _class_Area3D_property_angular_damp: + +- :ref:`float` **angular_damp** + ++-----------+-------------------------+ +| *Default* | ``0.1`` | ++-----------+-------------------------+ +| *Setter* | set_angular_damp(value) | ++-----------+-------------------------+ +| *Getter* | get_angular_damp() | ++-----------+-------------------------+ + +The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. + +See :ref:`ProjectSettings.physics/3d/default_angular_damp` for more details about damping. + +---- + +.. _class_Area3D_property_audio_bus_name: + +- :ref:`StringName` **audio_bus_name** + ++-----------+---------------------------+ +| *Default* | ``&"Master"`` | ++-----------+---------------------------+ +| *Setter* | set_audio_bus_name(value) | ++-----------+---------------------------+ +| *Getter* | get_audio_bus_name() | ++-----------+---------------------------+ + +The name of the area's audio bus. + +---- + +.. _class_Area3D_property_audio_bus_override: + +- :ref:`bool` **audio_bus_override** + ++-----------+-------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------+ +| *Setter* | set_audio_bus_override(value) | ++-----------+-------------------------------+ +| *Getter* | is_overriding_audio_bus() | ++-----------+-------------------------------+ + +If ``true``, the area's audio bus overrides the default audio bus. + +---- + +.. _class_Area3D_property_gravity: + +- :ref:`float` **gravity** + ++-----------+--------------------+ +| *Default* | ``9.8`` | ++-----------+--------------------+ +| *Setter* | set_gravity(value) | ++-----------+--------------------+ +| *Getter* | get_gravity() | ++-----------+--------------------+ + +The area's gravity intensity (in meters per second squared). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. + +---- + +.. _class_Area3D_property_gravity_distance_scale: + +- :ref:`float` **gravity_distance_scale** + ++-----------+-----------------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------------+ +| *Setter* | set_gravity_distance_scale(value) | ++-----------+-----------------------------------+ +| *Getter* | get_gravity_distance_scale() | ++-----------+-----------------------------------+ + +The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. + +---- + +.. _class_Area3D_property_gravity_point: + +- :ref:`bool` **gravity_point** + ++-----------+-----------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------+ +| *Setter* | set_gravity_is_point(value) | ++-----------+-----------------------------+ +| *Getter* | is_gravity_a_point() | ++-----------+-----------------------------+ + +If ``true``, gravity is calculated from a point (set via :ref:`gravity_vec`). See also :ref:`space_override`. + +---- + +.. _class_Area3D_property_gravity_vec: + +- :ref:`Vector3` **gravity_vec** + ++-----------+---------------------------+ +| *Default* | ``Vector3(0, -1, 0)`` | ++-----------+---------------------------+ +| *Setter* | set_gravity_vector(value) | ++-----------+---------------------------+ +| *Getter* | get_gravity_vector() | ++-----------+---------------------------+ + +The area's gravity vector (not normalized). If gravity is a point (see :ref:`gravity_point`), this will be the point of attraction. + +---- + +.. _class_Area3D_property_linear_damp: + +- :ref:`float` **linear_damp** + ++-----------+------------------------+ +| *Default* | ``0.1`` | ++-----------+------------------------+ +| *Setter* | set_linear_damp(value) | ++-----------+------------------------+ +| *Getter* | get_linear_damp() | ++-----------+------------------------+ + +The rate at which objects stop moving in this area. Represents the linear velocity lost per second. + +See :ref:`ProjectSettings.physics/3d/default_linear_damp` for more details about damping. + +---- + +.. _class_Area3D_property_monitorable: + +- :ref:`bool` **monitorable** + ++-----------+------------------------+ +| *Default* | ``true`` | ++-----------+------------------------+ +| *Setter* | set_monitorable(value) | ++-----------+------------------------+ +| *Getter* | is_monitorable() | ++-----------+------------------------+ + +If ``true``, other monitoring areas can detect this area. + +---- + +.. _class_Area3D_property_monitoring: + +- :ref:`bool` **monitoring** + ++-----------+-----------------------+ +| *Default* | ``true`` | ++-----------+-----------------------+ +| *Setter* | set_monitoring(value) | ++-----------+-----------------------+ +| *Getter* | is_monitoring() | ++-----------+-----------------------+ + +If ``true``, the area detects bodies or areas entering and exiting it. + +---- + +.. _class_Area3D_property_priority: + +- :ref:`float` **priority** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_priority(value) | ++-----------+---------------------+ +| *Getter* | get_priority() | ++-----------+---------------------+ + +The area's priority. Higher priority areas are processed first. + +---- + +.. _class_Area3D_property_reverb_bus_amount: + +- :ref:`float` **reverb_bus_amount** + ++-----------+--------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------+ +| *Setter* | set_reverb_amount(value) | ++-----------+--------------------------+ +| *Getter* | get_reverb_amount() | ++-----------+--------------------------+ + +The degree to which this area applies reverb to its associated audio. Ranges from ``0`` to ``1`` with ``0.1`` precision. + +---- + +.. _class_Area3D_property_reverb_bus_enable: + +- :ref:`bool` **reverb_bus_enable** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_use_reverb_bus(value) | ++-----------+---------------------------+ +| *Getter* | is_using_reverb_bus() | ++-----------+---------------------------+ + +If ``true``, the area applies reverb to its associated audio. + +---- + +.. _class_Area3D_property_reverb_bus_name: + +- :ref:`StringName` **reverb_bus_name** + ++-----------+-----------------------+ +| *Default* | ``&"Master"`` | ++-----------+-----------------------+ +| *Setter* | set_reverb_bus(value) | ++-----------+-----------------------+ +| *Getter* | get_reverb_bus() | ++-----------+-----------------------+ + +The reverb bus name to use for this area's associated audio. + +---- + +.. _class_Area3D_property_reverb_bus_uniformity: + +- :ref:`float` **reverb_bus_uniformity** + ++-----------+------------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------------+ +| *Setter* | set_reverb_uniformity(value) | ++-----------+------------------------------+ +| *Getter* | get_reverb_uniformity() | ++-----------+------------------------------+ + +The degree to which this area's reverb is a uniform effect. Ranges from ``0`` to ``1`` with ``0.1`` precision. + +---- + +.. _class_Area3D_property_space_override: + +- :ref:`SpaceOverride` **space_override** + ++-----------+--------------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------------+ +| *Setter* | set_space_override_mode(value) | ++-----------+--------------------------------+ +| *Getter* | get_space_override_mode() | ++-----------+--------------------------------+ + +Override mode for gravity and damping calculations within this area. See :ref:`SpaceOverride` for possible values. + +---- + +.. _class_Area3D_property_wind_attenuation_factor: + +- :ref:`float` **wind_attenuation_factor** + ++-----------+------------------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------------------+ +| *Setter* | set_wind_attenuation_factor(value) | ++-----------+------------------------------------+ +| *Getter* | get_wind_attenuation_factor() | ++-----------+------------------------------------+ + +The exponential rate at which wind force decreases with distance from its origin. + +---- + +.. _class_Area3D_property_wind_force_magnitude: + +- :ref:`float` **wind_force_magnitude** + ++-----------+---------------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------------+ +| *Setter* | set_wind_force_magnitude(value) | ++-----------+---------------------------------+ +| *Getter* | get_wind_force_magnitude() | ++-----------+---------------------------------+ + +The magnitude of area-specific wind force. + +---- + +.. _class_Area3D_property_wind_source_path: + +- :ref:`NodePath` **wind_source_path** + ++-----------+-----------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+-----------------------------+ +| *Setter* | set_wind_source_path(value) | ++-----------+-----------------------------+ +| *Getter* | get_wind_source_path() | ++-----------+-----------------------------+ + +The :ref:`Node3D` which is used to specify the the direction and origin of an area-specific wind force. The direction is opposite to the z-axis of the :ref:`Node3D`'s local transform, and its origin is the origin of the :ref:`Node3D`'s local transform. + +Method Descriptions +------------------- + +.. _class_Area3D_method_get_overlapping_areas: + +- :ref:`Area3D[]` **get_overlapping_areas** **(** **)** |const| + +Returns a list of intersecting ``Area3D``\ s. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + +---- + +.. _class_Area3D_method_get_overlapping_bodies: + +- :ref:`Node3D[]` **get_overlapping_bodies** **(** **)** |const| + +Returns a list of intersecting :ref:`PhysicsBody3D`\ s. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + +---- + +.. _class_Area3D_method_overlaps_area: + +- :ref:`bool` **overlaps_area** **(** :ref:`Node` area **)** |const| + +If ``true``, the given area overlaps the Area3D. + +**Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. + +---- + +.. _class_Area3D_method_overlaps_body: + +- :ref:`bool` **overlaps_body** **(** :ref:`Node` body **)** |const| + +If ``true``, the given physics body overlaps the Area3D. + +**Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. + +The ``body`` argument can either be a :ref:`PhysicsBody3D` or a :ref:`GridMap` instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_array.rst b/classes/class_array.rst index 8b8e4e230..4deec5a91 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -9,16 +9,19 @@ Array ===== -Generic array datatype. +A generic array datatype. 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.). +A generic array that 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 is the second to last, etc.). **Example:** -:: + +.. tabs:: + + .. code-tab:: gdscript var array = ["One", 2, 3, "Four"] print(array[0]) # One. @@ -27,155 +30,230 @@ Generic array which can contain several elements of any type, accessible by a nu array[2] = "Three" print(array[-2]) # Three. + .. code-tab:: 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. + + + Arrays can be concatenated using the ``+`` operator: -:: + +.. tabs:: + + .. code-tab:: gdscript var array1 = ["One", 2] var array2 = [3, "Four"] print(array1 + array2) # ["One", 2, 3, "Four"] -Arrays are always passed by reference. + .. code-tab:: 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] + + + +**Note:** Concatenating with the ``+=`` operator will create a new array, which has a cost. If you want to append another array to an existing array, :ref:`append_array` is more efficient. + +**Note:** Arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use :ref:`duplicate`. + +**Note:** When declaring an array with ``const``, the array itself can still be mutated by defining the values at individual indices or pushing/removing elements. Using ``const`` will only prevent assigning the constant with another value after it was initialized. Methods ------- -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`Array` **(** :ref:`PackedColorArray` from **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`Array` **(** :ref:`PackedVector3Array` from **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`Array` **(** :ref:`PackedVector2Array` from **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`Array` **(** :ref:`PackedStringArray` from **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`Array` **(** :ref:`PackedFloat64Array` from **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`Array` **(** :ref:`PackedFloat32Array` from **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`Array` **(** :ref:`PackedInt64Array` from **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`Array` **(** :ref:`PackedInt32Array` from **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`Array` **(** :ref:`PackedByteArray` from **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`append` **(** :ref:`Variant` value **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`back` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`bsearch` **(** :ref:`Variant` value, :ref:`bool` before=true **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`bsearch_custom` **(** :ref:`Variant` value, :ref:`Object` obj, :ref:`String` func, :ref:`bool` before=true **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`count` **(** :ref:`Variant` value **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`duplicate` **(** :ref:`bool` deep=false **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`empty` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`erase` **(** :ref:`Variant` value **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`find` **(** :ref:`Variant` what, :ref:`int` from=0 **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`find_last` **(** :ref:`Variant` value **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`front` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has` **(** :ref:`Variant` value **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`hash` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`insert` **(** :ref:`int` position, :ref:`Variant` value **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`invert` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`max` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`min` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`pop_back` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Variant` | :ref:`pop_front` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`push_back` **(** :ref:`Variant` value **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`push_front` **(** :ref:`Variant` value **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`remove` **(** :ref:`int` position **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`resize` **(** :ref:`int` size **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`rfind` **(** :ref:`Variant` what, :ref:`int` from=-1 **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`shuffle` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`size` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`slice` **(** :ref:`int` begin, :ref:`int` end, :ref:`int` step=1, :ref:`bool` deep=false **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`sort` **(** **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`sort_custom` **(** :ref:`Object` obj, :ref:`String` func **)** | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`Array` from **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PackedByteArray` from **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PackedColorArray` from **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PackedFloat32Array` from **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PackedFloat64Array` from **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PackedInt32Array` from **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PackedInt64Array` from **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PackedStringArray` from **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PackedVector2Array` from **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PackedVector3Array` from **)** |constructor| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append` **(** :ref:`Variant` value **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`Array` array **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`back` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`bsearch` **(** :ref:`Variant` value, :ref:`bool` before=true **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`bsearch_custom` **(** :ref:`Variant` value, :ref:`Callable` func, :ref:`bool` before=true **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`Variant` value **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`duplicate` **(** :ref:`bool` deep=false **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase` **(** :ref:`Variant` value **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fill` **(** :ref:`Variant` value **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`filter` **(** :ref:`Callable` method **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`Variant` what, :ref:`int` from=0 **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_last` **(** :ref:`Variant` value **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`front` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`Variant` value **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`hash` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`insert` **(** :ref:`int` position, :ref:`Variant` value **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_empty` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`map` **(** :ref:`Callable` method **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`max` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`min` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator !=** **(** **)** |operator| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator !=** **(** :ref:`Array` right **)** |operator| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | **operator +** **(** :ref:`Array` right **)** |operator| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator <** **(** :ref:`Array` right **)** |operator| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator <=** **(** :ref:`Array` right **)** |operator| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator ==** **(** **)** |operator| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator ==** **(** :ref:`Array` right **)** |operator| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator >** **(** :ref:`Array` right **)** |operator| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | **operator >=** **(** :ref:`Array` right **)** |operator| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | **operator []** **(** :ref:`int` index **)** |operator| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`pop_at` **(** :ref:`int` position **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`pop_back` **(** **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`pop_front` **(** **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_back` **(** :ref:`Variant` value **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_front` **(** :ref:`Variant` value **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`reduce` **(** :ref:`Callable` method, :ref:`Variant` accum=null **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove` **(** :ref:`int` position **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`resize` **(** :ref:`int` size **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reverse` **(** **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`Variant` what, :ref:`int` from=-1 **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shuffle` **(** **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`slice` **(** :ref:`int` begin, :ref:`int` end, :ref:`int` step=1, :ref:`bool` deep=false **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sort` **(** **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sort_custom` **(** :ref:`Callable` func **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- .. _class_Array_method_Array: -- :ref:`Array` **Array** **(** :ref:`PackedColorArray` from **)** +- :ref:`Array` **Array** **(** **)** |constructor| + +Constructs an empty ``Array``. + +---- + +- :ref:`Array` **Array** **(** :ref:`Array` from **)** |constructor| + +Constructs an ``Array`` as a copy of the given ``Array``. + +---- + +- :ref:`Array` **Array** **(** :ref:`PackedByteArray` from **)** |constructor| + +Constructs an array from a :ref:`PackedByteArray`. + +---- + +- :ref:`Array` **Array** **(** :ref:`PackedColorArray` from **)** |constructor| Constructs an array from a :ref:`PackedColorArray`. ---- -- :ref:`Array` **Array** **(** :ref:`PackedVector3Array` from **)** - -Constructs an array from a :ref:`PackedVector3Array`. - ----- - -- :ref:`Array` **Array** **(** :ref:`PackedVector2Array` from **)** - -Constructs an array from a :ref:`PackedVector2Array`. - ----- - -- :ref:`Array` **Array** **(** :ref:`PackedStringArray` from **)** - -Constructs an array from a :ref:`PackedStringArray`. - ----- - -- :ref:`Array` **Array** **(** :ref:`PackedFloat64Array` from **)** - -Constructs an array from a :ref:`PackedFloat64Array`. - ----- - -- :ref:`Array` **Array** **(** :ref:`PackedFloat32Array` from **)** +- :ref:`Array` **Array** **(** :ref:`PackedFloat32Array` from **)** |constructor| Constructs an array from a :ref:`PackedFloat32Array`. ---- -- :ref:`Array` **Array** **(** :ref:`PackedInt64Array` from **)** +- :ref:`Array` **Array** **(** :ref:`PackedFloat64Array` from **)** |constructor| -Constructs an array from a :ref:`PackedInt64Array`. +Constructs an array from a :ref:`PackedFloat64Array`. ---- -- :ref:`Array` **Array** **(** :ref:`PackedInt32Array` from **)** +- :ref:`Array` **Array** **(** :ref:`PackedInt32Array` from **)** |constructor| Constructs an array from a :ref:`PackedInt32Array`. ---- -- :ref:`Array` **Array** **(** :ref:`PackedByteArray` from **)** +- :ref:`Array` **Array** **(** :ref:`PackedInt64Array` from **)** |constructor| -Constructs an array from a :ref:`PackedByteArray`. +Constructs an array from a :ref:`PackedInt64Array`. + +---- + +- :ref:`Array` **Array** **(** :ref:`PackedStringArray` from **)** |constructor| + +Constructs an array from a :ref:`PackedStringArray`. + +---- + +- :ref:`Array` **Array** **(** :ref:`PackedVector2Array` from **)** |constructor| + +Constructs an array from a :ref:`PackedVector2Array`. + +---- + +- :ref:`Array` **Array** **(** :ref:`PackedVector3Array` from **)** |constructor| + +Constructs an array from a :ref:`PackedVector3Array`. ---- @@ -187,11 +265,28 @@ Appends an element at the end of the array (alias of :ref:`push_back` array **)** + +Appends another array at the end of this array. + +:: + + var array1 = [1, 2, 3] + var array2 = [4, 5, 6] + array1.append_array(array2) + print(array1) # Prints [1, 2, 3, 4, 5, 6]. + +---- + .. _class_Array_method_back: -- :ref:`Variant` **back** **(** **)** +- :ref:`Variant` **back** **(** **)** |const| -Returns the last element of the array, or ``null`` if the array is empty. +Returns the last element of the array. Prints an error and returns ``null`` if the array is empty. + +**Note:** Calling this function is not the same as writing ``array[-1]``. If the array is empty, accessing by index will pause project execution when running from the editor. ---- @@ -207,11 +302,11 @@ Finds the index of an existing value (or the insertion index that maintains sort .. _class_Array_method_bsearch_custom: -- :ref:`int` **bsearch_custom** **(** :ref:`Variant` value, :ref:`Object` obj, :ref:`String` func, :ref:`bool` before=true **)** +- :ref:`int` **bsearch_custom** **(** :ref:`Variant` value, :ref:`Callable` func, :ref:`bool` before=true **)** Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search and a custom comparison method. Optionally, a ``before`` specifier can be passed. If ``false``, the returned index comes after all existing entries of the value in the array. The custom method receives two arguments (an element from the array and the value searched for) and must return ``true`` if the first argument is less than the second, and return ``false`` otherwise. -**Note:** Calling :ref:`bsearch` on an unsorted array results in unexpected behavior. +**Note:** Calling :ref:`bsearch_custom` on an unsorted array results in unexpected behavior. ---- @@ -225,7 +320,7 @@ Clears the array. This is equivalent to using :ref:`resize` **count** **(** :ref:`Variant` value **)** +- :ref:`int` **count** **(** :ref:`Variant` value **)** |const| Returns the number of times an element is in the array. @@ -233,7 +328,7 @@ Returns the number of times an element is in the array. .. _class_Array_method_duplicate: -- :ref:`Array` **duplicate** **(** :ref:`bool` deep=false **)** +- :ref:`Array` **duplicate** **(** :ref:`bool` deep=false **)** |const| Returns a copy of the array. @@ -241,88 +336,193 @@ If ``deep`` is ``true``, a deep copy is performed: all nested arrays and diction ---- -.. _class_Array_method_empty: - -- :ref:`bool` **empty** **(** **)** - -Returns ``true`` if the array is empty. - ----- - .. _class_Array_method_erase: - void **erase** **(** :ref:`Variant` value **)** -Removes the first occurrence of a value from the array. +Removes the first occurrence of a value from the array. To remove an element by index, use :ref:`remove` instead. + +**Note:** This method acts in-place and doesn't return a value. + +**Note:** On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed. + +---- + +.. _class_Array_method_fill: + +- void **fill** **(** :ref:`Variant` value **)** + +Assigns the given value to all elements in the array. This can typically be used together with :ref:`resize` to create an array with a given size and initialized elements: + + +.. tabs:: + + .. code-tab:: gdscript + + var array = [] + array.resize(10) + array.fill(0) # Initialize the 10 elements to 0. + + .. code-tab:: csharp + + var array = new Godot.Collections.Array{}; + array.Resize(10); + array.Fill(0); // Initialize the 10 elements to 0. + + + +---- + +.. _class_Array_method_filter: + +- :ref:`Array` **filter** **(** :ref:`Callable` method **)** |const| + +Calls the provided :ref:`Callable` on each element in the array and returns a new array with the elements for which the method returned ``true``. + +The callable's method should take one :ref:`Variant` parameter (the current array element) and return a boolean value. + +:: + + func _ready(): + print([1, 2, 3].filter(remove_1)) # Prints [2, 3]. + print([1, 2, 3].filter(func(number): return number != 1)) # Same as above, but using lambda function. + + func remove_1(number): + return number != 1 ---- .. _class_Array_method_find: -- :ref:`int` **find** **(** :ref:`Variant` what, :ref:`int` from=0 **)** +- :ref:`int` **find** **(** :ref:`Variant` what, :ref:`int` from=0 **)** |const| -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 ``-1`` if not found. Optionally, the initial search index can be passed. ---- .. _class_Array_method_find_last: -- :ref:`int` **find_last** **(** :ref:`Variant` value **)** +- :ref:`int` **find_last** **(** :ref:`Variant` value **)** |const| -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 ``-1`` if not found. ---- .. _class_Array_method_front: -- :ref:`Variant` **front** **(** **)** +- :ref:`Variant` **front** **(** **)** |const| -Returns the first element of the array, or ``null`` if the array is empty. +Returns the first element of the array. Prints an error and returns ``null`` if the array is empty. + +**Note:** Calling this function is not the same as writing ``array[0]``. If the array is empty, accessing by index will pause project execution when running from the editor. ---- .. _class_Array_method_has: -- :ref:`bool` **has** **(** :ref:`Variant` value **)** +- :ref:`bool` **has** **(** :ref:`Variant` value **)** |const| Returns ``true`` if the array contains the given value. -:: - ["inside", 7].has("inside") == true - ["inside", 7].has("outside") == false - ["inside", 7].has(7) == true - ["inside", 7].has("7") == false +.. tabs:: + + .. code-tab:: 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 + + .. code-tab:: 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 + + + + + +**Note:** This is equivalent to using the ``in`` operator as follows: + + +.. tabs:: + + .. code-tab:: gdscript + + # Will evaluate to `true`. + if 2 in [2, 4, 6, 8]: + print("Contains!") + + .. code-tab:: 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("Contains!"); + } + + ---- .. _class_Array_method_hash: -- :ref:`int` **hash** **(** **)** +- :ref:`int` **hash** **(** **)** |const| -Returns a hashed integer value representing the array contents. +Returns a hashed integer value representing the array and its contents. + +**Note:** Arrays with equal contents can still produce different hashes. Only the exact same arrays will produce the same hashed integer value. ---- .. _class_Array_method_insert: -- void **insert** **(** :ref:`int` position, :ref:`Variant` value **)** +- :ref:`int` **insert** **(** :ref:`int` position, :ref:`Variant` value **)** Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``pos == size()``). +**Note:** This method acts in-place and doesn't return a value. + +**Note:** On large arrays, this method will be slower if the inserted element is close to the beginning of the array (index 0). This is because all elements placed after the newly inserted element have to be reindexed. + ---- -.. _class_Array_method_invert: +.. _class_Array_method_is_empty: -- void **invert** **(** **)** +- :ref:`bool` **is_empty** **(** **)** |const| -Reverses the order of the elements in the array. +Returns ``true`` if the array is empty. + +---- + +.. _class_Array_method_map: + +- :ref:`Array` **map** **(** :ref:`Callable` method **)** |const| + +Calls the provided :ref:`Callable` for each element in the array and returns a new array filled with values returned by the method. + +The callable's method should take one :ref:`Variant` parameter (the current array element) and can return any :ref:`Variant`. + +:: + + func _ready(): + print([1, 2, 3].map(negate)) # Prints [-1, -2, -3]. + print([1, 2, 3].map(func(number): return -number)) # Same as above, but using lambda function. + + func negate(number): + return -number ---- .. _class_Array_method_max: -- :ref:`Variant` **max** **(** **)** +- :ref:`Variant` **max** **(** **)** |const| Returns the maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, ``null`` is returned. @@ -330,17 +530,83 @@ Returns the maximum value contained in the array if all elements are of comparab .. _class_Array_method_min: -- :ref:`Variant` **min** **(** **)** +- :ref:`Variant` **min** **(** **)** |const| Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, ``null`` is returned. ---- +.. _class_Array_method_operator !=: + +- :ref:`bool` **operator !=** **(** **)** |operator| + +---- + +- :ref:`bool` **operator !=** **(** :ref:`Array` right **)** |operator| + +---- + +.. _class_Array_method_operator +: + +- :ref:`Array` **operator +** **(** :ref:`Array` right **)** |operator| + +---- + +.. _class_Array_method_operator <: + +- :ref:`bool` **operator <** **(** :ref:`Array` right **)** |operator| + +---- + +.. _class_Array_method_operator <=: + +- :ref:`bool` **operator <=** **(** :ref:`Array` right **)** |operator| + +---- + +.. _class_Array_method_operator ==: + +- :ref:`bool` **operator ==** **(** **)** |operator| + +---- + +- :ref:`bool` **operator ==** **(** :ref:`Array` right **)** |operator| + +---- + +.. _class_Array_method_operator >: + +- :ref:`bool` **operator >** **(** :ref:`Array` right **)** |operator| + +---- + +.. _class_Array_method_operator >=: + +- :ref:`bool` **operator >=** **(** :ref:`Array` right **)** |operator| + +---- + +.. _class_Array_method_operator []: + +- void **operator []** **(** :ref:`int` index **)** |operator| + +---- + +.. _class_Array_method_pop_at: + +- :ref:`Variant` **pop_at** **(** :ref:`int` position **)** + +Removes and returns the element of the array at index ``position``. If negative, ``position`` is considered relative to the end of the array. Leaves the array untouched and returns ``null`` if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty. + +**Note:** On large arrays, this method can be slower than :ref:`pop_back` as it will reindex the array's elements that are located after the removed element. The larger the array and the lower the index of the removed element, the slower :ref:`pop_at` will be. + +---- + .. _class_Array_method_pop_back: - :ref:`Variant` **pop_back** **(** **)** -Removes and returns the last element of the array. Returns ``null`` if the array is empty. +Removes and returns the last element of the array. Returns ``null`` if the array is empty, without printing an error message. See also :ref:`pop_front`. ---- @@ -348,7 +614,9 @@ Removes and returns the last element of the array. Returns ``null`` if the array - :ref:`Variant` **pop_front** **(** **)** -Removes and returns the first element of the array. Returns ``null`` if the array is empty. +Removes and returns the first element of the array. Returns ``null`` if the array is empty, without printing an error message. See also :ref:`pop_back`. + +**Note:** On large arrays, this method is much slower than :ref:`pop_back` as it will reindex all the array's elements every time it's called. The larger the array, the slower :ref:`pop_front` will be. ---- @@ -356,7 +624,7 @@ Removes and returns the first element of the array. Returns ``null`` if the arra - void **push_back** **(** :ref:`Variant` value **)** -Appends an element at the end of the array. +Appends an element at the end of the array. See also :ref:`push_front`. ---- @@ -364,7 +632,28 @@ Appends an element at the end of the array. - void **push_front** **(** :ref:`Variant` value **)** -Adds an element at the beginning of the array. +Adds an element at the beginning of the array. See also :ref:`push_back`. + +**Note:** On large arrays, this method is much slower than :ref:`push_back` as it will reindex all the array's elements every time it's called. The larger the array, the slower :ref:`push_front` will be. + +---- + +.. _class_Array_method_reduce: + +- :ref:`Variant` **reduce** **(** :ref:`Callable` method, :ref:`Variant` accum=null **)** |const| + +Calls the provided :ref:`Callable` for each element in array and accumulates the result in ``accum``. + +The callable's method takes two arguments: the current value of ``accum`` and the current array element. If ``accum`` is ``null`` (default value), the iteration will start from the second element, with the first one used as initial value of ``accum``. + +:: + + func _ready(): + print([1, 2, 3].reduce(sum, 10)) # Prints 16. + print([1, 2, 3].reduce(func(accum, number): return accum + number, 10)) # Same as above, but using lambda function. + + func sum(accum, number): + return accum + number ---- @@ -372,21 +661,33 @@ Adds an element at the beginning of the array. - void **remove** **(** :ref:`int` position **)** -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. To remove an element by searching for its value, use :ref:`erase` instead. + +**Note:** This method acts in-place and doesn't return a value. + +**Note:** On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed. ---- .. _class_Array_method_resize: -- void **resize** **(** :ref:`int` size **)** +- :ref:`int` **resize** **(** :ref:`int` size **)** Resizes the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are ``null``. ---- +.. _class_Array_method_reverse: + +- void **reverse** **(** **)** + +Reverses the order of the elements in the array. + +---- + .. _class_Array_method_rfind: -- :ref:`int` **rfind** **(** :ref:`Variant` what, :ref:`int` from=-1 **)** +- :ref:`int` **rfind** **(** :ref:`Variant` what, :ref:`int` from=-1 **)** |const| Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. @@ -396,13 +697,13 @@ Searches the array in reverse order. Optionally, a start search index can be pas - void **shuffle** **(** **)** -Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as :ref:`@GDScript.randi`. Call :ref:`@GDScript.randomize` to ensure that a new seed will be used each time if you want non-reproducible shuffling. +Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as :ref:`@GlobalScope.randi`. Call :ref:`@GlobalScope.randomize` to ensure that a new seed will be used each time if you want non-reproducible shuffling. ---- .. _class_Array_method_size: -- :ref:`int` **size** **(** **)** +- :ref:`int` **size** **(** **)** |const| Returns the number of elements in the array. @@ -410,9 +711,9 @@ Returns the number of elements in the array. .. _class_Array_method_slice: -- :ref:`Array` **slice** **(** :ref:`int` begin, :ref:`int` end, :ref:`int` step=1, :ref:`bool` deep=false **)** +- :ref:`Array` **slice** **(** :ref:`int` begin, :ref:`int` end, :ref:`int` step=1, :ref:`bool` deep=false **)** |const| -Duplicates the subset described in the function and returns it in an array, deeply copying the array if ``deep`` is ``true``. Lower and upper index are inclusive, with the ``step`` describing the change between indices while slicing. +Duplicates the subset described in the function and returns it in an array, deeply copying the array if ``deep`` is ``true``. Lower and upper index are inclusive, with the ``step`` describing the change between indices while slicing. Wraps around if ``begin`` or ``end`` are out of bounds or negative. Returns an empty array for invalid parameters. ---- @@ -424,23 +725,35 @@ Sorts the array. **Note:** 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: -:: + +.. tabs:: + + .. code-tab:: gdscript var strings = ["string1", "string2", "string10", "string11"] strings.sort() print(strings) # Prints [string1, string10, string11, string2] + .. code-tab:: csharp + + // There is no sort support for Godot.Collections.Array + + + ---- .. _class_Array_method_sort_custom: -- void **sort_custom** **(** :ref:`Object` obj, :ref:`String` func **)** +- void **sort_custom** **(** :ref:`Callable` func **)** -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 ``true`` or ``false``. +Sorts the array using a custom method. The custom method receives two arguments (a pair of elements from the array) and must return either ``true`` or ``false``. For two elements ``a`` and ``b``, if the given method returns ``true``, element ``b`` will be after element ``a`` in the array. -**Note:** you cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior. +**Note:** You cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior. -:: + +.. tabs:: + + .. code-tab:: gdscript class MyCustomSorter: static func sort_ascending(a, b): @@ -449,6 +762,18 @@ Sorts the array using a custom method. The arguments are an object that holds th return false var my_items = [[5, "Potato"], [9, "Rice"], [4, "Tomato"]] - my_items.sort_custom(MyCustomSorter, "sort_ascending") + my_items.sort_custom(MyCustomSorter.sort_ascending) print(my_items) # Prints [[4, Tomato], [5, Potato], [9, Rice]]. + .. code-tab:: csharp + + // There is no custom sort support for Godot.Collections.Array + + + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_arraymesh.rst b/classes/class_arraymesh.rst index ba732abb2..c5abca14e 100644 --- a/classes/class_arraymesh.rst +++ b/classes/class_arraymesh.rst @@ -9,7 +9,7 @@ ArrayMesh ========= -**Inherits:** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` :ref:`Mesh` type that provides utility for constructing a surface from arrays. @@ -20,176 +20,111 @@ The ``ArrayMesh`` is used to construct a :ref:`Mesh` by specifying t The most basic example is the creation of a single triangle: -:: + +.. tabs:: + + .. code-tab:: 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 + arrays.resize(Mesh.ARRAY_MAX) + arrays[Mesh.ARRAY_VERTEX] = vertices + # Create the Mesh. arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays) - var m = MeshInstance.new() + var m = MeshInstance3D.new() m.mesh = arr_mesh -The :ref:`MeshInstance` is ready to be added to the :ref:`SceneTree` to be shown. + .. code-tab:: csharp + + var vertices = new Godot.Collections.Array(); + 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)Mesh.ArrayType.Max); + arrays[(int)Mesh.ArrayType.Vertex] = vertices; + + // Create the Mesh. + arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, arrays); + var m = new MeshInstance(); + m.Mesh = arrMesh; + + + +The :ref:`MeshInstance3D` is ready to be added to the :ref:`SceneTree` to be shown. + +See also :ref:`ImmediateMesh`, :ref:`MeshDataTool` and :ref:`SurfaceTool` for procedural geometry generation. + +**Note:** Godot uses clockwise `winding order `__ for front faces of triangle primitive modes. Tutorials --------- -- :doc:`../tutorials/3d/procedural_geometry/arraymesh` +- :doc:`../tutorials/content/procedural_geometry/arraymesh` Properties ---------- -+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+ -| :ref:`BlendShapeMode` | :ref:`blend_shape_mode` | ``1`` | -+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+ -| :ref:`AABB` | :ref:`custom_aabb` | ``AABB( 0, 0, 0, 0, 0, 0 )`` | -+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+ ++-------------------------------------------------+--------------------------------------------------------------------+----------------------------+ +| :ref:`BlendShapeMode` | :ref:`blend_shape_mode` | ``1`` | ++-------------------------------------------------+--------------------------------------------------------------------+----------------------------+ +| :ref:`AABB` | :ref:`custom_aabb` | ``AABB(0, 0, 0, 0, 0, 0)`` | ++-------------------------------------------------+--------------------------------------------------------------------+----------------------------+ +| :ref:`ArrayMesh` | :ref:`shadow_mesh` | | ++-------------------------------------------------+--------------------------------------------------------------------+----------------------------+ Methods ------- -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_blend_shape` **(** :ref:`StringName` name **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_surface_from_arrays` **(** :ref:`PrimitiveType` primitive, :ref:`Array` arrays, :ref:`Array` blend_shapes=[ ], :ref:`Dictionary` lods={ }, :ref:`int` compress_flags=31744 **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear_blend_shapes` **(** **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear_surfaces` **(** **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_blend_shape_count` **(** **)** const | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`get_blend_shape_name` **(** :ref:`int` index **)** const | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Error` | :ref:`lightmap_unwrap` **(** :ref:`Transform` transform, :ref:`float` texel_size **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`regen_normalmaps` **(** **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`surface_find_by_name` **(** :ref:`String` name **)** const | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`surface_get_array_index_len` **(** :ref:`int` surf_idx **)** const | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`surface_get_array_len` **(** :ref:`int` surf_idx **)** const | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`surface_get_format` **(** :ref:`int` surf_idx **)** const | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`surface_get_name` **(** :ref:`int` surf_idx **)** const | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PrimitiveType` | :ref:`surface_get_primitive_type` **(** :ref:`int` surf_idx **)** const | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`surface_set_name` **(** :ref:`int` surf_idx, :ref:`String` name **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`surface_update_region` **(** :ref:`int` surf_idx, :ref:`int` offset, :ref:`PackedByteArray` data **)** | -+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - -Enumerations ------------- - -.. _enum_ArrayMesh_ArrayType: - -.. _class_ArrayMesh_constant_ARRAY_VERTEX: - -.. _class_ArrayMesh_constant_ARRAY_NORMAL: - -.. _class_ArrayMesh_constant_ARRAY_TANGENT: - -.. _class_ArrayMesh_constant_ARRAY_COLOR: - -.. _class_ArrayMesh_constant_ARRAY_TEX_UV: - -.. _class_ArrayMesh_constant_ARRAY_TEX_UV2: - -.. _class_ArrayMesh_constant_ARRAY_BONES: - -.. _class_ArrayMesh_constant_ARRAY_WEIGHTS: - -.. _class_ArrayMesh_constant_ARRAY_INDEX: - -.. _class_ArrayMesh_constant_ARRAY_MAX: - -enum **ArrayType**: - -- **ARRAY_VERTEX** = **0** --- :ref:`PackedVector3Array`, :ref:`PackedVector2Array`, or :ref:`Array` of vertex positions. - -- **ARRAY_NORMAL** = **1** --- :ref:`PackedVector3Array` of vertex normals. - -- **ARRAY_TANGENT** = **2** --- :ref:`PackedFloat32Array` of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1. - -- **ARRAY_COLOR** = **3** --- :ref:`PackedColorArray` of vertex colors. - -- **ARRAY_TEX_UV** = **4** --- :ref:`PackedVector2Array` for UV coordinates. - -- **ARRAY_TEX_UV2** = **5** --- :ref:`PackedVector2Array` for second UV coordinates. - -- **ARRAY_BONES** = **6** --- :ref:`PackedFloat32Array` or :ref:`PackedInt32Array` of bone indices. Each element in groups of 4 floats. - -- **ARRAY_WEIGHTS** = **7** --- :ref:`PackedFloat32Array` of bone weights. Each element in groups of 4 floats. - -- **ARRAY_INDEX** = **8** --- :ref:`PackedInt32Array` of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the \*i\*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices. - -For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line. - -- **ARRAY_MAX** = **9** --- Represents the size of the :ref:`ArrayType` enum. - ----- - -.. _enum_ArrayMesh_ArrayFormat: - -.. _class_ArrayMesh_constant_ARRAY_FORMAT_VERTEX: - -.. _class_ArrayMesh_constant_ARRAY_FORMAT_NORMAL: - -.. _class_ArrayMesh_constant_ARRAY_FORMAT_TANGENT: - -.. _class_ArrayMesh_constant_ARRAY_FORMAT_COLOR: - -.. _class_ArrayMesh_constant_ARRAY_FORMAT_TEX_UV: - -.. _class_ArrayMesh_constant_ARRAY_FORMAT_TEX_UV2: - -.. _class_ArrayMesh_constant_ARRAY_FORMAT_BONES: - -.. _class_ArrayMesh_constant_ARRAY_FORMAT_WEIGHTS: - -.. _class_ArrayMesh_constant_ARRAY_FORMAT_INDEX: - -enum **ArrayFormat**: - -- **ARRAY_FORMAT_VERTEX** = **1** --- Array format will include vertices (mandatory). - -- **ARRAY_FORMAT_NORMAL** = **2** --- Array format will include normals. - -- **ARRAY_FORMAT_TANGENT** = **4** --- Array format will include tangents. - -- **ARRAY_FORMAT_COLOR** = **8** --- Array format will include a color array. - -- **ARRAY_FORMAT_TEX_UV** = **16** --- Array format will include UVs. - -- **ARRAY_FORMAT_TEX_UV2** = **32** --- Array format will include another set of UVs. - -- **ARRAY_FORMAT_BONES** = **64** --- Array format will include bone indices. - -- **ARRAY_FORMAT_WEIGHTS** = **128** --- Array format will include bone weights. - -- **ARRAY_FORMAT_INDEX** = **256** --- Index array will be used. - -Constants ---------- - -.. _class_ArrayMesh_constant_NO_INDEX_ARRAY: - -.. _class_ArrayMesh_constant_ARRAY_WEIGHTS_SIZE: - -- **NO_INDEX_ARRAY** = **-1** --- Default value used for index_array_len when no indices are present. - -- **ARRAY_WEIGHTS_SIZE** = **4** --- Amount of weights/bone indices per vertex (always 4). ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_blend_shape` **(** :ref:`StringName` name **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_surface_from_arrays` **(** :ref:`PrimitiveType` primitive, :ref:`Array` arrays, :ref:`Array` blend_shapes=[], :ref:`Dictionary` lods={ }, :ref:`int` compress_flags=0 **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_blend_shapes` **(** **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_surfaces` **(** **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_blend_shape_count` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`StringName` | :ref:`get_blend_shape_name` **(** :ref:`int` index **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`lightmap_unwrap` **(** :ref:`Transform3D` transform, :ref:`float` texel_size **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`regen_normal_maps` **(** **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_blend_shape_name` **(** :ref:`int` index, :ref:`StringName` name **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`surface_find_by_name` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`surface_get_array_index_len` **(** :ref:`int` surf_idx **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`surface_get_array_len` **(** :ref:`int` surf_idx **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`surface_get_format` **(** :ref:`int` surf_idx **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`surface_get_name` **(** :ref:`int` surf_idx **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PrimitiveType` | :ref:`surface_get_primitive_type` **(** :ref:`int` surf_idx **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`surface_set_name` **(** :ref:`int` surf_idx, :ref:`String` name **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`surface_update_attribute_region` **(** :ref:`int` surf_idx, :ref:`int` offset, :ref:`PackedByteArray` data **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`surface_update_skin_region` **(** :ref:`int` surf_idx, :ref:`int` offset, :ref:`PackedByteArray` data **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`surface_update_vertex_region` **(** :ref:`int` surf_idx, :ref:`int` offset, :ref:`PackedByteArray` data **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- @@ -214,16 +149,28 @@ Sets the blend shape mode to one of :ref:`BlendShapeMode` **custom_aabb** -+-----------+------------------------------+ -| *Default* | ``AABB( 0, 0, 0, 0, 0, 0 )`` | -+-----------+------------------------------+ -| *Setter* | set_custom_aabb(value) | -+-----------+------------------------------+ -| *Getter* | get_custom_aabb() | -+-----------+------------------------------+ ++-----------+----------------------------+ +| *Default* | ``AABB(0, 0, 0, 0, 0, 0)`` | ++-----------+----------------------------+ +| *Setter* | set_custom_aabb(value) | ++-----------+----------------------------+ +| *Getter* | get_custom_aabb() | ++-----------+----------------------------+ Overrides the :ref:`AABB` with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. +---- + +.. _class_ArrayMesh_property_shadow_mesh: + +- :ref:`ArrayMesh` **shadow_mesh** + ++----------+------------------------+ +| *Setter* | set_shadow_mesh(value) | ++----------+------------------------+ +| *Getter* | get_shadow_mesh() | ++----------+------------------------+ + Method Descriptions ------------------- @@ -237,17 +184,13 @@ Adds name for a blend shape that will be added with :ref:`add_surface_from_array .. _class_ArrayMesh_method_add_surface_from_arrays: -- void **add_surface_from_arrays** **(** :ref:`PrimitiveType` primitive, :ref:`Array` arrays, :ref:`Array` blend_shapes=[ ], :ref:`Dictionary` lods={ }, :ref:`int` compress_flags=31744 **)** +- void **add_surface_from_arrays** **(** :ref:`PrimitiveType` primitive, :ref:`Array` arrays, :ref:`Array` blend_shapes=[], :ref:`Dictionary` lods={ }, :ref:`int` compress_flags=0 **)** Creates a new surface. -Surfaces are created to be rendered using a ``primitive``, which may be any of the types defined in :ref:`PrimitiveType`. (As a note, when using indices, it is recommended to only use points, lines or triangles.) :ref:`Mesh.get_surface_count` will become the ``surf_idx`` for this new surface. +Surfaces are created to be rendered using a ``primitive``, which may be any of the types defined in :ref:`PrimitiveType`. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) :ref:`Mesh.get_surface_count` will become the ``surf_idx`` for this new surface. -The ``arrays`` argument is an array of arrays. See :ref:`ArrayType` for the values used in this array. For example, ``arrays[0]`` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for :ref:`ARRAY_INDEX` if it is used. - -Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices. - -Godot uses clockwise winding order for front faces of triangle primitive modes. +The ``arrays`` argument is an array of arrays. See :ref:`ArrayType` for the values used in this array. For example, ``arrays[0]`` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for :ref:`Mesh.ARRAY_INDEX` if it is used. ---- @@ -269,7 +212,7 @@ Removes all surfaces from this ``ArrayMesh``. .. _class_ArrayMesh_method_get_blend_shape_count: -- :ref:`int` **get_blend_shape_count** **(** **)** const +- :ref:`int` **get_blend_shape_count** **(** **)** |const| Returns the number of blend shapes that the ``ArrayMesh`` holds. @@ -277,7 +220,7 @@ Returns the number of blend shapes that the ``ArrayMesh`` holds. .. _class_ArrayMesh_method_get_blend_shape_name: -- :ref:`StringName` **get_blend_shape_name** **(** :ref:`int` index **)** const +- :ref:`StringName` **get_blend_shape_name** **(** :ref:`int` index **)** |const| Returns the name of the blend shape at this index. @@ -285,23 +228,31 @@ Returns the name of the blend shape at this index. .. _class_ArrayMesh_method_lightmap_unwrap: -- :ref:`Error` **lightmap_unwrap** **(** :ref:`Transform` transform, :ref:`float` texel_size **)** +- :ref:`Error` **lightmap_unwrap** **(** :ref:`Transform3D` transform, :ref:`float` texel_size **)** Will perform a UV unwrap on the ``ArrayMesh`` to prepare the mesh for lightmapping. ---- -.. _class_ArrayMesh_method_regen_normalmaps: +.. _class_ArrayMesh_method_regen_normal_maps: -- void **regen_normalmaps** **(** **)** +- void **regen_normal_maps** **(** **)** Will regenerate normal maps for the ``ArrayMesh``. ---- +.. _class_ArrayMesh_method_set_blend_shape_name: + +- void **set_blend_shape_name** **(** :ref:`int` index, :ref:`StringName` name **)** + +Sets the name of the blend shape at this index. + +---- + .. _class_ArrayMesh_method_surface_find_by_name: -- :ref:`int` **surface_find_by_name** **(** :ref:`String` name **)** const +- :ref:`int` **surface_find_by_name** **(** :ref:`String` name **)** |const| Returns the index of the first surface with this name held within this ``ArrayMesh``. If none are found, -1 is returned. @@ -309,7 +260,7 @@ Returns the index of the first surface with this name held within this ``ArrayMe .. _class_ArrayMesh_method_surface_get_array_index_len: -- :ref:`int` **surface_get_array_index_len** **(** :ref:`int` surf_idx **)** const +- :ref:`int` **surface_get_array_index_len** **(** :ref:`int` surf_idx **)** |const| Returns the length in indices of the index array in the requested surface (see :ref:`add_surface_from_arrays`). @@ -317,7 +268,7 @@ Returns the length in indices of the index array in the requested surface (see : .. _class_ArrayMesh_method_surface_get_array_len: -- :ref:`int` **surface_get_array_len** **(** :ref:`int` surf_idx **)** const +- :ref:`int` **surface_get_array_len** **(** :ref:`int` surf_idx **)** |const| Returns the length in vertices of the vertex array in the requested surface (see :ref:`add_surface_from_arrays`). @@ -325,7 +276,7 @@ Returns the length in vertices of the vertex array in the requested surface (see .. _class_ArrayMesh_method_surface_get_format: -- :ref:`int` **surface_get_format** **(** :ref:`int` surf_idx **)** const +- :ref:`int` **surface_get_format** **(** :ref:`int` surf_idx **)** |const| Returns the format mask of the requested surface (see :ref:`add_surface_from_arrays`). @@ -333,7 +284,7 @@ Returns the format mask of the requested surface (see :ref:`add_surface_from_arr .. _class_ArrayMesh_method_surface_get_name: -- :ref:`String` **surface_get_name** **(** :ref:`int` surf_idx **)** const +- :ref:`String` **surface_get_name** **(** :ref:`int` surf_idx **)** |const| Gets the name assigned to this surface. @@ -341,7 +292,7 @@ Gets the name assigned to this surface. .. _class_ArrayMesh_method_surface_get_primitive_type: -- :ref:`PrimitiveType` **surface_get_primitive_type** **(** :ref:`int` surf_idx **)** const +- :ref:`PrimitiveType` **surface_get_primitive_type** **(** :ref:`int` surf_idx **)** |const| Returns the primitive type of the requested surface (see :ref:`add_surface_from_arrays`). @@ -355,11 +306,25 @@ Sets a name for a given surface. ---- -.. _class_ArrayMesh_method_surface_update_region: +.. _class_ArrayMesh_method_surface_update_attribute_region: -- void **surface_update_region** **(** :ref:`int` surf_idx, :ref:`int` offset, :ref:`PackedByteArray` data **)** +- void **surface_update_attribute_region** **(** :ref:`int` surf_idx, :ref:`int` offset, :ref:`PackedByteArray` data **)** -Updates a specified region of mesh arrays on the GPU. +---- -**Warning:** Only use if you know what you are doing. You can easily cause crashes by calling this function with improper arguments. +.. _class_ArrayMesh_method_surface_update_skin_region: +- void **surface_update_skin_region** **(** :ref:`int` surf_idx, :ref:`int` offset, :ref:`PackedByteArray` data **)** + +---- + +.. _class_ArrayMesh_method_surface_update_vertex_region: + +- void **surface_update_vertex_region** **(** :ref:`int` surf_idx, :ref:`int` offset, :ref:`PackedByteArray` data **)** + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_arvrcamera.rst b/classes/class_arvrcamera.rst deleted file mode 100644 index af9cef27b..000000000 --- a/classes/class_arvrcamera.rst +++ /dev/null @@ -1,27 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the ARVRCamera.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_ARVRCamera: - -ARVRCamera -========== - -**Inherits:** :ref:`Camera` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` - -A camera node with a few overrules for AR/VR applied, such as location tracking. - -Description ------------ - -This is a helper spatial node for our camera; note that, if stereoscopic rendering is applicable (VR-HMD), most of the camera properties are ignored, as the HMD information overrides them. The only properties that can be trusted are the near and far planes. - -The position and orientation of this node is automatically updated by the ARVR 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 ARVR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the ARVRCamera can lag a few milliseconds behind what is used for rendering as a result. - -Tutorials ---------- - -- :doc:`../tutorials/vr/index` - diff --git a/classes/class_arvrcontroller.rst b/classes/class_arvrcontroller.rst deleted file mode 100644 index 355539aca..000000000 --- a/classes/class_arvrcontroller.rst +++ /dev/null @@ -1,180 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the ARVRController.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_ARVRController: - -ARVRController -============== - -**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` - -A spatial node representing a spatially-tracked controller. - -Description ------------ - -This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy passthroughs to the state of buttons and such on the controllers. - -Controllers are linked by their ID. You can create controller nodes before the controllers are available. If your game always uses two controllers (one for each hand), you can predefine the controllers with ID 1 and 2; they will become active as soon as the controllers are identified. If you expect additional controllers to be used, you should react to the signals and add ARVRController nodes to your scene. - -The position of the controller node is automatically updated by the :ref:`ARVRServer`. This makes this node ideal to add child nodes to visualize the controller. - -Tutorials ---------- - -- :doc:`../tutorials/vr/index` - -Properties ----------- - -+---------------------------+-------------------------------------------------------------------+---------+ -| :ref:`int` | :ref:`controller_id` | ``1`` | -+---------------------------+-------------------------------------------------------------------+---------+ -| :ref:`float` | :ref:`rumble` | ``0.0`` | -+---------------------------+-------------------------------------------------------------------+---------+ - -Methods -------- - -+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ -| :ref:`String` | :ref:`get_controller_name` **(** **)** const | -+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ -| :ref:`TrackerHand` | :ref:`get_hand` **(** **)** const | -+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`get_is_active` **(** **)** const | -+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_joystick_axis` **(** :ref:`int` axis **)** const | -+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_joystick_id` **(** **)** const | -+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Mesh` | :ref:`get_mesh` **(** **)** const | -+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_button_pressed` **(** :ref:`int` button **)** const | -+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ - -Signals -------- - -.. _class_ARVRController_signal_button_pressed: - -- **button_pressed** **(** :ref:`int` button **)** - -Emitted when a button on this controller is pressed. - ----- - -.. _class_ARVRController_signal_button_release: - -- **button_release** **(** :ref:`int` button **)** - -Emitted when a button on this controller is released. - ----- - -.. _class_ARVRController_signal_mesh_updated: - -- **mesh_updated** **(** :ref:`Mesh` mesh **)** - -Emitted when the mesh associated with the controller changes or when one becomes available. Generally speaking this will be a static mesh after becoming available. - -Property Descriptions ---------------------- - -.. _class_ARVRController_property_controller_id: - -- :ref:`int` **controller_id** - -+-----------+--------------------------+ -| *Default* | ``1`` | -+-----------+--------------------------+ -| *Setter* | set_controller_id(value) | -+-----------+--------------------------+ -| *Getter* | get_controller_id() | -+-----------+--------------------------+ - -The controller's ID. - -A controller ID of 0 is unbound and will always result in an inactive node. Controller ID 1 is reserved for the first controller that identifies itself as the left-hand controller and ID 2 is reserved for the first controller that identifies itself as the right-hand controller. - -For any other controller that the :ref:`ARVRServer` detects, we continue with controller ID 3. - -When a controller is turned off, its slot is freed. This ensures controllers will keep the same ID even when controllers with lower IDs are turned off. - ----- - -.. _class_ARVRController_property_rumble: - -- :ref:`float` **rumble** - -+-----------+-------------------+ -| *Default* | ``0.0`` | -+-----------+-------------------+ -| *Setter* | set_rumble(value) | -+-----------+-------------------+ -| *Getter* | get_rumble() | -+-----------+-------------------+ - -The degree to which the controller vibrates. Ranges from ``0.0`` to ``1.0`` with precision ``.01``. If changed, updates :ref:`ARVRPositionalTracker.rumble` accordingly. - -This is a useful property to animate if you want the controller to vibrate for a limited duration. - -Method Descriptions -------------------- - -.. _class_ARVRController_method_get_controller_name: - -- :ref:`String` **get_controller_name** **(** **)** const - -If active, returns the name of the associated controller if provided by the AR/VR SDK used. - ----- - -.. _class_ARVRController_method_get_hand: - -- :ref:`TrackerHand` **get_hand** **(** **)** const - -Returns the hand holding this controller, if known. See :ref:`TrackerHand`. - ----- - -.. _class_ARVRController_method_get_is_active: - -- :ref:`bool` **get_is_active** **(** **)** const - -Returns ``true`` if the bound controller is active. ARVR systems attempt to track active controllers. - ----- - -.. _class_ARVRController_method_get_joystick_axis: - -- :ref:`float` **get_joystick_axis** **(** :ref:`int` axis **)** const - -Returns the value of the given axis for things like triggers, touchpads, etc. that are embedded into the controller. - ----- - -.. _class_ARVRController_method_get_joystick_id: - -- :ref:`int` **get_joystick_id** **(** **)** const - -Returns the ID of the joystick object bound to this. Every controller tracked by the :ref:`ARVRServer` that has buttons and axis will also be registered as a joystick within Godot. This means that all the normal joystick tracking and input mapping will work for buttons and axis found on the AR/VR controllers. This ID is purely offered as information so you can link up the controller with its joystick entry. - ----- - -.. _class_ARVRController_method_get_mesh: - -- :ref:`Mesh` **get_mesh** **(** **)** const - -If provided by the :ref:`ARVRInterface`, this returns a mesh associated with the controller. This can be used to visualize the controller. - ----- - -.. _class_ARVRController_method_is_button_pressed: - -- :ref:`bool` **is_button_pressed** **(** :ref:`int` button **)** const - -Returns ``true`` if the button at index ``button`` is pressed. See :ref:`JoystickList`, in particular the ``JOY_VR_*`` constants. - diff --git a/classes/class_arvrinterface.rst b/classes/class_arvrinterface.rst deleted file mode 100644 index ef54dc151..000000000 --- a/classes/class_arvrinterface.rst +++ /dev/null @@ -1,254 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the ARVRInterface.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_ARVRInterface: - -ARVRInterface -============= - -**Inherits:** :ref:`Reference` **<** :ref:`Object` - -**Inherited By:** :ref:`ARVRInterfaceGDNative`, :ref:`MobileVRInterface` - -Base class for an AR/VR interface implementation. - -Description ------------ - -This class needs to be implemented to make an AR or VR platform available to Godot and these should be implemented as C++ modules or GDNative modules (note that for GDNative the subclass ARVRScriptInterface should be used). Part of the interface is exposed to GDScript so you can detect, enable and configure an AR or VR platform. - -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 :ref:`ARVRServer`. - -Tutorials ---------- - -- :doc:`../tutorials/vr/index` - -Properties ----------- - -+-------------------------+----------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`ar_is_anchor_detection_enabled` | ``false`` | -+-------------------------+----------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`interface_is_initialized` | ``false`` | -+-------------------------+----------------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`interface_is_primary` | ``false`` | -+-------------------------+----------------------------------------------------------------------------------------------------+-----------+ - -Methods -------- - -+------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_camera_feed_id` **(** **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_capabilities` **(** **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`get_name` **(** **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_render_targetsize` **(** **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :ref:`Tracking_status` | :ref:`get_tracking_status` **(** **)** const | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`initialize` **(** **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_stereo` **(** **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| void | :ref:`uninitialize` **(** **)** | -+------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - -Enumerations ------------- - -.. _enum_ARVRInterface_Capabilities: - -.. _class_ARVRInterface_constant_ARVR_NONE: - -.. _class_ARVRInterface_constant_ARVR_MONO: - -.. _class_ARVRInterface_constant_ARVR_STEREO: - -.. _class_ARVRInterface_constant_ARVR_AR: - -.. _class_ARVRInterface_constant_ARVR_EXTERNAL: - -enum **Capabilities**: - -- **ARVR_NONE** = **0** --- No ARVR capabilities. - -- **ARVR_MONO** = **1** --- This interface can work with normal rendering output (non-HMD based AR). - -- **ARVR_STEREO** = **2** --- This interface supports stereoscopic rendering. - -- **ARVR_AR** = **4** --- This interface supports AR (video background and real world tracking). - -- **ARVR_EXTERNAL** = **8** --- This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of :ref:`get_render_targetsize`). Using a separate viewport node frees up the main viewport for other purposes. - ----- - -.. _enum_ARVRInterface_Eyes: - -.. _class_ARVRInterface_constant_EYE_MONO: - -.. _class_ARVRInterface_constant_EYE_LEFT: - -.. _class_ARVRInterface_constant_EYE_RIGHT: - -enum **Eyes**: - -- **EYE_MONO** = **0** --- Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported. - -- **EYE_LEFT** = **1** --- Left eye output, this is mostly used internally when rendering the image for the left eye and obtaining positioning and projection information. - -- **EYE_RIGHT** = **2** --- Right eye output, this is mostly used internally when rendering the image for the right eye and obtaining positioning and projection information. - ----- - -.. _enum_ARVRInterface_Tracking_status: - -.. _class_ARVRInterface_constant_ARVR_NORMAL_TRACKING: - -.. _class_ARVRInterface_constant_ARVR_EXCESSIVE_MOTION: - -.. _class_ARVRInterface_constant_ARVR_INSUFFICIENT_FEATURES: - -.. _class_ARVRInterface_constant_ARVR_UNKNOWN_TRACKING: - -.. _class_ARVRInterface_constant_ARVR_NOT_TRACKING: - -enum **Tracking_status**: - -- **ARVR_NORMAL_TRACKING** = **0** --- Tracking is behaving as expected. - -- **ARVR_EXCESSIVE_MOTION** = **1** --- Tracking is hindered by excessive motion (the player is moving faster than tracking can keep up). - -- **ARVR_INSUFFICIENT_FEATURES** = **2** --- Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), player is blocked, etc. - -- **ARVR_UNKNOWN_TRACKING** = **3** --- We don't know the status of the tracking or this interface does not provide feedback. - -- **ARVR_NOT_TRACKING** = **4** --- Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.). - -Property Descriptions ---------------------- - -.. _class_ARVRInterface_property_ar_is_anchor_detection_enabled: - -- :ref:`bool` **ar_is_anchor_detection_enabled** - -+-----------+----------------------------------------+ -| *Default* | ``false`` | -+-----------+----------------------------------------+ -| *Setter* | set_anchor_detection_is_enabled(value) | -+-----------+----------------------------------------+ -| *Getter* | get_anchor_detection_is_enabled() | -+-----------+----------------------------------------+ - -On an AR interface, ``true`` if anchor detection is enabled. - ----- - -.. _class_ARVRInterface_property_interface_is_initialized: - -- :ref:`bool` **interface_is_initialized** - -+-----------+---------------------------+ -| *Default* | ``false`` | -+-----------+---------------------------+ -| *Setter* | set_is_initialized(value) | -+-----------+---------------------------+ -| *Getter* | is_initialized() | -+-----------+---------------------------+ - -``true`` if this interface been initialized. - ----- - -.. _class_ARVRInterface_property_interface_is_primary: - -- :ref:`bool` **interface_is_primary** - -+-----------+-----------------------+ -| *Default* | ``false`` | -+-----------+-----------------------+ -| *Setter* | set_is_primary(value) | -+-----------+-----------------------+ -| *Getter* | is_primary() | -+-----------+-----------------------+ - -``true`` if this is the primary interface. - -Method Descriptions -------------------- - -.. _class_ARVRInterface_method_get_camera_feed_id: - -- :ref:`int` **get_camera_feed_id** **(** **)** - -If this is an AR interface that requires displaying a camera feed as the background, this method returns the feed ID in the :ref:`CameraServer` for this interface. - ----- - -.. _class_ARVRInterface_method_get_capabilities: - -- :ref:`int` **get_capabilities** **(** **)** const - -Returns a combination of :ref:`Capabilities` flags providing information about the capabilities of this interface. - ----- - -.. _class_ARVRInterface_method_get_name: - -- :ref:`StringName` **get_name** **(** **)** const - -Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc). - ----- - -.. _class_ARVRInterface_method_get_render_targetsize: - -- :ref:`Vector2` **get_render_targetsize** **(** **)** - -Returns the resolution at which we should render our intermediate results before things like lens distortion are applied by the VR platform. - ----- - -.. _class_ARVRInterface_method_get_tracking_status: - -- :ref:`Tracking_status` **get_tracking_status** **(** **)** const - -If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking. - ----- - -.. _class_ARVRInterface_method_initialize: - -- :ref:`bool` **initialize** **(** **)** - -Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output. - -After initializing the interface you want to use you then need to enable the AR/VR mode of a viewport and rendering should commence. - -**Note:** You must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR. - -If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport. It will be used to output to the HMD, leaving you free to do anything you like in the main window, such as using a separate camera as a spectator camera or rendering something completely different. - -While currently not used, you can activate additional interfaces. You may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD. - ----- - -.. _class_ARVRInterface_method_is_stereo: - -- :ref:`bool` **is_stereo** **(** **)** - -Returns ``true`` if the current output of this interface is in stereo. - ----- - -.. _class_ARVRInterface_method_uninitialize: - -- void **uninitialize** **(** **)** - -Turns the interface off. - diff --git a/classes/class_arvrinterfacegdnative.rst b/classes/class_arvrinterfacegdnative.rst deleted file mode 100644 index 9a58256b2..000000000 --- a/classes/class_arvrinterfacegdnative.rst +++ /dev/null @@ -1,20 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the ARVRInterfaceGDNative.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_ARVRInterfaceGDNative: - -ARVRInterfaceGDNative -===================== - -**Inherits:** :ref:`ARVRInterface` **<** :ref:`Reference` **<** :ref:`Object` - -GDNative wrapper for an ARVR interface. - -Description ------------ - -This is a wrapper class for GDNative implementations of the ARVR interface. To use a GDNative ARVR interface, simply instantiate this object and set your GDNative library containing the ARVR interface implementation. - diff --git a/classes/class_arvrpositionaltracker.rst b/classes/class_arvrpositionaltracker.rst deleted file mode 100644 index 62f1e5a75..000000000 --- a/classes/class_arvrpositionaltracker.rst +++ /dev/null @@ -1,188 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the ARVRPositionalTracker.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_ARVRPositionalTracker: - -ARVRPositionalTracker -===================== - -**Inherits:** :ref:`Object` - -A tracked object. - -Description ------------ - -An instance of this object represents a device that is tracked, such as a controller or anchor point. HMDs aren't represented here as they are handled internally. - -As controllers are turned on and the AR/VR interface detects them, instances of this object are automatically added to this list of active tracking objects accessible through the :ref:`ARVRServer`. - -The :ref:`ARVRController` and :ref:`ARVRAnchor` 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. - -Tutorials ---------- - -- :doc:`../tutorials/vr/index` - -Properties ----------- - -+---------------------------+------------------------------------------------------------+---------+ -| :ref:`float` | :ref:`rumble` | ``0.0`` | -+---------------------------+------------------------------------------------------------+---------+ - -Methods -------- - -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`TrackerHand` | :ref:`get_hand` **(** **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_joy_id` **(** **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Mesh` | :ref:`get_mesh` **(** **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`StringName` | :ref:`get_name` **(** **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Basis` | :ref:`get_orientation` **(** **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`get_position` **(** **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_tracker_id` **(** **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`get_tracks_orientation` **(** **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`get_tracks_position` **(** **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Transform` | :ref:`get_transform` **(** :ref:`bool` adjust_by_reference_frame **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`TrackerType` | :ref:`get_type` **(** **)** const | -+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ - -Enumerations ------------- - -.. _enum_ARVRPositionalTracker_TrackerHand: - -.. _class_ARVRPositionalTracker_constant_TRACKER_HAND_UNKNOWN: - -.. _class_ARVRPositionalTracker_constant_TRACKER_LEFT_HAND: - -.. _class_ARVRPositionalTracker_constant_TRACKER_RIGHT_HAND: - -enum **TrackerHand**: - -- **TRACKER_HAND_UNKNOWN** = **0** --- The hand this tracker is held in is unknown or not applicable. - -- **TRACKER_LEFT_HAND** = **1** --- This tracker is the left hand controller. - -- **TRACKER_RIGHT_HAND** = **2** --- This tracker is the right hand controller. - -Property Descriptions ---------------------- - -.. _class_ARVRPositionalTracker_property_rumble: - -- :ref:`float` **rumble** - -+-----------+-------------------+ -| *Default* | ``0.0`` | -+-----------+-------------------+ -| *Setter* | set_rumble(value) | -+-----------+-------------------+ -| *Getter* | get_rumble() | -+-----------+-------------------+ - -The degree to which the tracker rumbles. Ranges from ``0.0`` to ``1.0`` with precision ``.01``. - -Method Descriptions -------------------- - -.. _class_ARVRPositionalTracker_method_get_hand: - -- :ref:`TrackerHand` **get_hand** **(** **)** const - -Returns the hand holding this tracker, if known. See :ref:`TrackerHand` constants. - ----- - -.. _class_ARVRPositionalTracker_method_get_joy_id: - -- :ref:`int` **get_joy_id** **(** **)** const - -If this is a controller that is being tracked, the controller will also be represented by a joystick entry with this ID. - ----- - -.. _class_ARVRPositionalTracker_method_get_mesh: - -- :ref:`Mesh` **get_mesh** **(** **)** const - -Returns the mesh related to a controller or anchor point if one is available. - ----- - -.. _class_ARVRPositionalTracker_method_get_name: - -- :ref:`StringName` **get_name** **(** **)** const - -Returns the controller or anchor point's name if available. - ----- - -.. _class_ARVRPositionalTracker_method_get_orientation: - -- :ref:`Basis` **get_orientation** **(** **)** const - -Returns the controller's orientation matrix. - ----- - -.. _class_ARVRPositionalTracker_method_get_position: - -- :ref:`Vector3` **get_position** **(** **)** const - -Returns the world-space controller position. - ----- - -.. _class_ARVRPositionalTracker_method_get_tracker_id: - -- :ref:`int` **get_tracker_id** **(** **)** const - -Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the :ref:`ARVRController` and :ref:`ARVRAnchor` nodes. - ----- - -.. _class_ARVRPositionalTracker_method_get_tracks_orientation: - -- :ref:`bool` **get_tracks_orientation** **(** **)** const - -Returns ``true`` if this device tracks orientation. - ----- - -.. _class_ARVRPositionalTracker_method_get_tracks_position: - -- :ref:`bool` **get_tracks_position** **(** **)** const - -Returns ``true`` if this device tracks position. - ----- - -.. _class_ARVRPositionalTracker_method_get_transform: - -- :ref:`Transform` **get_transform** **(** :ref:`bool` adjust_by_reference_frame **)** const - -Returns the transform combining this device's orientation and position. - ----- - -.. _class_ARVRPositionalTracker_method_get_type: - -- :ref:`TrackerType` **get_type** **(** **)** const - -Returns the tracker's type. - diff --git a/classes/class_arvrserver.rst b/classes/class_arvrserver.rst deleted file mode 100644 index a3ff58bad..000000000 --- a/classes/class_arvrserver.rst +++ /dev/null @@ -1,283 +0,0 @@ -:github_url: hide - -.. Generated automatically by doc/tools/makerst.py in Godot's source tree. -.. DO NOT EDIT THIS FILE, but the ARVRServer.xml source instead. -.. The source is found in doc/classes or modules//doc_classes. - -.. _class_ARVRServer: - -ARVRServer -========== - -**Inherits:** :ref:`Object` - -Server for AR and VR features. - -Description ------------ - -The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing. - -Tutorials ---------- - -- :doc:`../tutorials/vr/index` - -Properties ----------- - -+-------------------------------------------+-----------------------------------------------------------------------+---------+ -| :ref:`ARVRInterface` | :ref:`primary_interface` | | -+-------------------------------------------+-----------------------------------------------------------------------+---------+ -| :ref:`float` | :ref:`world_scale` | ``1.0`` | -+-------------------------------------------+-----------------------------------------------------------------------+---------+ - -Methods -------- - -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`center_on_hmd` **(** :ref:`RotationMode` rotation_mode, :ref:`bool` keep_height **)** | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`ARVRInterface` | :ref:`find_interface` **(** :ref:`String` name **)** const | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Transform` | :ref:`get_hmd_transform` **(** **)** | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`ARVRInterface` | :ref:`get_interface` **(** :ref:`int` idx **)** const | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_interface_count` **(** **)** const | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`get_interfaces` **(** **)** const | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_last_commit_usec` **(** **)** | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_last_frame_usec` **(** **)** | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_last_process_usec` **(** **)** | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Transform` | :ref:`get_reference_frame` **(** **)** const | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`ARVRPositionalTracker` | :ref:`get_tracker` **(** :ref:`int` idx **)** const | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_tracker_count` **(** **)** const | -+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - -Signals -------- - -.. _class_ARVRServer_signal_interface_added: - -- **interface_added** **(** :ref:`StringName` interface_name **)** - -Emitted when a new interface has been added. - ----- - -.. _class_ARVRServer_signal_interface_removed: - -- **interface_removed** **(** :ref:`StringName` interface_name **)** - -Emitted when an interface is removed. - ----- - -.. _class_ARVRServer_signal_tracker_added: - -- **tracker_added** **(** :ref:`StringName` tracker_name, :ref:`int` type, :ref:`int` id **)** - -Emitted when a new tracker has been added. If you don't use a fixed number of controllers or if you're using :ref:`ARVRAnchor`\ s for an AR solution, it is important to react to this signal to add the appropriate :ref:`ARVRController` or :ref:`ARVRAnchor` nodes related to this new tracker. - ----- - -.. _class_ARVRServer_signal_tracker_removed: - -- **tracker_removed** **(** :ref:`StringName` tracker_name, :ref:`int` type, :ref:`int` id **)** - -Emitted when a tracker is removed. You should remove any :ref:`ARVRController` or :ref:`ARVRAnchor` points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one). - -Enumerations ------------- - -.. _enum_ARVRServer_TrackerType: - -.. _class_ARVRServer_constant_TRACKER_CONTROLLER: - -.. _class_ARVRServer_constant_TRACKER_BASESTATION: - -.. _class_ARVRServer_constant_TRACKER_ANCHOR: - -.. _class_ARVRServer_constant_TRACKER_ANY_KNOWN: - -.. _class_ARVRServer_constant_TRACKER_UNKNOWN: - -.. _class_ARVRServer_constant_TRACKER_ANY: - -enum **TrackerType**: - -- **TRACKER_CONTROLLER** = **1** --- The tracker tracks the location of a controller. - -- **TRACKER_BASESTATION** = **2** --- The tracker tracks the location of a base station. - -- **TRACKER_ANCHOR** = **4** --- The tracker tracks the location and size of an AR anchor. - -- **TRACKER_ANY_KNOWN** = **127** --- Used internally to filter trackers of any known type. - -- **TRACKER_UNKNOWN** = **128** --- Used internally if we haven't set the tracker type yet. - -- **TRACKER_ANY** = **255** --- Used internally to select all trackers. - ----- - -.. _enum_ARVRServer_RotationMode: - -.. _class_ARVRServer_constant_RESET_FULL_ROTATION: - -.. _class_ARVRServer_constant_RESET_BUT_KEEP_TILT: - -.. _class_ARVRServer_constant_DONT_RESET_ROTATION: - -enum **RotationMode**: - -- **RESET_FULL_ROTATION** = **0** --- Fully reset the orientation of the HMD. Regardless of what direction the user is looking to in the real world. The user will look dead ahead in the virtual world. - -- **RESET_BUT_KEEP_TILT** = **1** --- Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep looking down but heading will be reset. - -- **DONT_RESET_ROTATION** = **2** --- Does not reset the orientation of the HMD, only the position of the player gets centered. - -Property Descriptions ---------------------- - -.. _class_ARVRServer_property_primary_interface: - -- :ref:`ARVRInterface` **primary_interface** - -+----------+------------------------------+ -| *Setter* | set_primary_interface(value) | -+----------+------------------------------+ -| *Getter* | get_primary_interface() | -+----------+------------------------------+ - -The primary :ref:`ARVRInterface` currently bound to the ``ARVRServer``. - ----- - -.. _class_ARVRServer_property_world_scale: - -- :ref:`float` **world_scale** - -+-----------+------------------------+ -| *Default* | ``1.0`` | -+-----------+------------------------+ -| *Setter* | set_world_scale(value) | -+-----------+------------------------+ -| *Getter* | get_world_scale() | -+-----------+------------------------+ - -Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter. - -Method Descriptions -------------------- - -.. _class_ARVRServer_method_center_on_hmd: - -- void **center_on_hmd** **(** :ref:`RotationMode` rotation_mode, :ref:`bool` keep_height **)** - -This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently. - -For platforms that do not offer spatial tracking, our origin point (0,0,0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. - -For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera. - -This method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world. - -For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game. - -You should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. - ----- - -.. _class_ARVRServer_method_find_interface: - -- :ref:`ARVRInterface` **find_interface** **(** :ref:`String` name **)** const - -Finds an interface by its name. For instance, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. - ----- - -.. _class_ARVRServer_method_get_hmd_transform: - -- :ref:`Transform` **get_hmd_transform** **(** **)** - -Returns the primary interface's transformation. - ----- - -.. _class_ARVRServer_method_get_interface: - -- :ref:`ARVRInterface` **get_interface** **(** :ref:`int` idx **)** const - -Returns the interface registered at a given index in our list of interfaces. - ----- - -.. _class_ARVRServer_method_get_interface_count: - -- :ref:`int` **get_interface_count** **(** **)** const - -Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns ``true``. - ----- - -.. _class_ARVRServer_method_get_interfaces: - -- :ref:`Array` **get_interfaces** **(** **)** const - -Returns a list of available interfaces the ID and name of each interface. - ----- - -.. _class_ARVRServer_method_get_last_commit_usec: - -- :ref:`int` **get_last_commit_usec** **(** **)** - -Returns the absolute timestamp (in μs) of the last ``ARVRServer`` commit of the AR/VR eyes to :ref:`VisualServer`. The value comes from an internal call to :ref:`OS.get_ticks_usec`. - ----- - -.. _class_ARVRServer_method_get_last_frame_usec: - -- :ref:`int` **get_last_frame_usec** **(** **)** - -Returns the duration (in μs) of the last frame. This is computed as the difference between :ref:`get_last_commit_usec` and :ref:`get_last_process_usec` when committing. - ----- - -.. _class_ARVRServer_method_get_last_process_usec: - -- :ref:`int` **get_last_process_usec** **(** **)** - -Returns the absolute timestamp (in μs) of the last ``ARVRServer`` process callback. The value comes from an internal call to :ref:`OS.get_ticks_usec`. - ----- - -.. _class_ARVRServer_method_get_reference_frame: - -- :ref:`Transform` **get_reference_frame** **(** **)** const - -Returns the reference frame transform. Mostly used internally and exposed for GDNative build interfaces. - ----- - -.. _class_ARVRServer_method_get_tracker: - -- :ref:`ARVRPositionalTracker` **get_tracker** **(** :ref:`int` idx **)** const - -Returns the positional tracker at the given ID. - ----- - -.. _class_ARVRServer_method_get_tracker_count: - -- :ref:`int` **get_tracker_count** **(** **)** const - -Returns the number of trackers currently registered. - diff --git a/classes/class_aspectratiocontainer.rst b/classes/class_aspectratiocontainer.rst new file mode 100644 index 000000000..b7c2bfd4f --- /dev/null +++ b/classes/class_aspectratiocontainer.rst @@ -0,0 +1,147 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AspectRatioContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AspectRatioContainer: + +AspectRatioContainer +==================== + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Container that preserves its child controls' aspect ratio. + +Description +----------- + +Arranges child controls in a way to preserve their aspect ratio automatically whenever the container is resized. Solves the problem where the container size is dynamic and the contents' size needs to adjust accordingly without losing proportions. + +Properties +---------- + ++-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`AlignMode` | :ref:`alignment_horizontal` | ``1`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`AlignMode` | :ref:`alignment_vertical` | ``1`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`ratio` | ``1.0`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`StretchMode` | :ref:`stretch_mode` | ``2`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ + +Enumerations +------------ + +.. _enum_AspectRatioContainer_StretchMode: + +.. _class_AspectRatioContainer_constant_STRETCH_WIDTH_CONTROLS_HEIGHT: + +.. _class_AspectRatioContainer_constant_STRETCH_HEIGHT_CONTROLS_WIDTH: + +.. _class_AspectRatioContainer_constant_STRETCH_FIT: + +.. _class_AspectRatioContainer_constant_STRETCH_COVER: + +enum **StretchMode**: + +- **STRETCH_WIDTH_CONTROLS_HEIGHT** = **0** --- The height of child controls is automatically adjusted based on the width of the container. + +- **STRETCH_HEIGHT_CONTROLS_WIDTH** = **1** --- The width of child controls is automatically adjusted based on the height of the container. + +- **STRETCH_FIT** = **2** --- The bounding rectangle of child controls is automatically adjusted to fit inside the container while keeping the aspect ratio. + +- **STRETCH_COVER** = **3** --- The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio. + +When the bounding rectangle of child controls exceed the container's size and :ref:`Control.rect_clip_content` is enabled, this allows to show only the container's area restricted by its own bounding rectangle. + +---- + +.. _enum_AspectRatioContainer_AlignMode: + +.. _class_AspectRatioContainer_constant_ALIGN_BEGIN: + +.. _class_AspectRatioContainer_constant_ALIGN_CENTER: + +.. _class_AspectRatioContainer_constant_ALIGN_END: + +enum **AlignMode**: + +- **ALIGN_BEGIN** = **0** --- Aligns child controls with the beginning (left or top) of the container. + +- **ALIGN_CENTER** = **1** --- Aligns child controls with the center of the container. + +- **ALIGN_END** = **2** --- Aligns child controls with the end (right or bottom) of the container. + +Property Descriptions +--------------------- + +.. _class_AspectRatioContainer_property_alignment_horizontal: + +- :ref:`AlignMode` **alignment_horizontal** + ++-----------+---------------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------------+ +| *Setter* | set_alignment_horizontal(value) | ++-----------+---------------------------------+ +| *Getter* | get_alignment_horizontal() | ++-----------+---------------------------------+ + +Specifies the horizontal relative position of child controls. + +---- + +.. _class_AspectRatioContainer_property_alignment_vertical: + +- :ref:`AlignMode` **alignment_vertical** + ++-----------+-------------------------------+ +| *Default* | ``1`` | ++-----------+-------------------------------+ +| *Setter* | set_alignment_vertical(value) | ++-----------+-------------------------------+ +| *Getter* | get_alignment_vertical() | ++-----------+-------------------------------+ + +Specifies the vertical relative position of child controls. + +---- + +.. _class_AspectRatioContainer_property_ratio: + +- :ref:`float` **ratio** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_ratio(value) | ++-----------+------------------+ +| *Getter* | get_ratio() | ++-----------+------------------+ + +The aspect ratio to enforce on child controls. This is the width divided by the height. The ratio depends on the :ref:`stretch_mode`. + +---- + +.. _class_AspectRatioContainer_property_stretch_mode: + +- :ref:`StretchMode` **stretch_mode** + ++-----------+-------------------------+ +| *Default* | ``2`` | ++-----------+-------------------------+ +| *Setter* | set_stretch_mode(value) | ++-----------+-------------------------+ +| *Getter* | get_stretch_mode() | ++-----------+-------------------------+ + +The stretch mode used to align child controls. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_astar.rst b/classes/class_astar.rst index f7bd4c333..888743bdc 100644 --- a/classes/class_astar.rst +++ b/classes/class_astar.rst @@ -9,9 +9,9 @@ AStar ===== -**Inherits:** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`RefCounted` **<** :ref:`Object` -An implementation of A\* to find shortest paths among connected points in space. +An implementation of A\* to find the shortest paths among connected points in space. Description ----------- @@ -22,7 +22,10 @@ You must add points manually with :ref:`add_point` It is also possible to use non-Euclidean distances. To do so, create a class that extends ``AStar`` and override methods :ref:`_compute_cost` and :ref:`_estimate_cost`. Both take two indices and return a length, as is shown in the following example. -:: + +.. tabs:: + + .. code-tab:: gdscript class MyAStar: extends AStar @@ -33,69 +36,87 @@ It is also possible to use non-Euclidean distances. To do so, create a class tha func _estimate_cost(u, v): return min(0, abs(u - v) - 1) + .. code-tab:: 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); + } + } + + + :ref:`_estimate_cost` should return a lower bound of the distance, i.e. ``_estimate_cost(u, v) <= _compute_cost(u, v)``. This serves as a hint to the algorithm because the custom ``_compute_cost`` might be computation-heavy. If this is not the case, make :ref:`_estimate_cost` return the same value as :ref:`_compute_cost` to provide the algorithm with the most accurate information. +If the default :ref:`_estimate_cost` and :ref:`_compute_cost` methods are used, or if the supplied :ref:`_estimate_cost` method returns a lower bound of the cost, then the paths returned by A\* will be the lowest-cost paths. Here, the cost of a path equals the sum of the :ref:`_compute_cost` results of all segments in the path multiplied by the ``weight_scale``\ s of the endpoints of the respective segments. If the default methods are used and the ``weight_scale``\ s of all points are set to ``1.0``, then this equals the sum of Euclidean distances of all segments in the path. + Methods ------- -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`_compute_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** virtual | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`_estimate_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** virtual | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_point` **(** :ref:`int` id, :ref:`Vector3` position, :ref:`float` weight_scale=1.0 **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`are_points_connected` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear` **(** **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`connect_points` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`disconnect_points` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_available_point_id` **(** **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_closest_point` **(** :ref:`Vector3` to_position, :ref:`bool` include_disabled=false **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`get_closest_position_in_segment` **(** :ref:`Vector3` to_position **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedInt32Array` | :ref:`get_id_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_point_capacity` **(** **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedInt32Array` | :ref:`get_point_connections` **(** :ref:`int` id **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_point_count` **(** **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedVector3Array` | :ref:`get_point_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`get_point_position` **(** :ref:`int` id **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_point_weight_scale` **(** :ref:`int` id **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`get_points` **(** **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_point` **(** :ref:`int` id **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_point_disabled` **(** :ref:`int` id **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`remove_point` **(** :ref:`int` id **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`reserve_space` **(** :ref:`int` num_nodes **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_point_disabled` **(** :ref:`int` id, :ref:`bool` disabled=true **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_point_position` **(** :ref:`int` id, :ref:`Vector3` position **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_point_weight_scale` **(** :ref:`int` id, :ref:`float` weight_scale **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`_compute_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`_estimate_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_point` **(** :ref:`int` id, :ref:`Vector3` position, :ref:`float` weight_scale=1.0 **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`are_points_connected` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`connect_points` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_points` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_available_point_id` **(** **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_closest_point` **(** :ref:`Vector3` to_position, :ref:`bool` include_disabled=false **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_closest_position_in_segment` **(** :ref:`Vector3` to_position **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedInt32Array` | :ref:`get_id_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_capacity` **(** **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedInt32Array` | :ref:`get_point_connections` **(** :ref:`int` id **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_count` **(** **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedVector3Array` | :ref:`get_point_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_point_position` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_point_weight_scale` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_points` **(** **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_point` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_point_disabled` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_point` **(** :ref:`int` id **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reserve_space` **(** :ref:`int` num_nodes **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_disabled` **(** :ref:`int` id, :ref:`bool` disabled=true **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_position` **(** :ref:`int` id, :ref:`Vector3` position **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_weight_scale` **(** :ref:`int` id, :ref:`float` weight_scale **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- .. _class_AStar_method__compute_cost: -- :ref:`float` **_compute_cost** **(** :ref:`int` from_id, :ref:`int` to_id **)** virtual +- :ref:`float` **_compute_cost** **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| |const| Called when computing the cost between two connected points. @@ -105,7 +126,7 @@ Note that this function is hidden in the default ``AStar`` class. .. _class_AStar_method__estimate_cost: -- :ref:`float` **_estimate_cost** **(** :ref:`int` from_id, :ref:`int` to_id **)** virtual +- :ref:`float` **_estimate_cost** **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| |const| Called when estimating the cost between a point and the path's ending point. @@ -117,20 +138,32 @@ Note that this function is hidden in the default ``AStar`` class. - void **add_point** **(** :ref:`int` id, :ref:`Vector3` position, :ref:`float` weight_scale=1.0 **)** -Adds a new point at the given position with the given identifier. The algorithm prefers points with lower ``weight_scale`` to form a path. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 1 or larger. +Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 1 or larger. -:: +The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower ``weight_scale``\ s to form a path. + + +.. tabs:: + + .. code-tab:: 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 + .. code-tab:: 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 + + + If there already exists a point for the given ``id``, its position and weight scale are updated to the given values. ---- .. _class_AStar_method_are_points_connected: -- :ref:`bool` **are_points_connected** **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** const +- :ref:`bool` **are_points_connected** **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** |const| Returns whether the two given points are directly connected by a segment. If ``bidirectional`` is ``false``, returns whether movement from ``id`` to ``to_id`` is possible through this segment. @@ -150,13 +183,25 @@ Clears all the points and segments. Creates a segment between the given points. If ``bidirectional`` is ``false``, only movement from ``id`` to ``to_id`` is allowed, not the reverse direction. -:: + +.. tabs:: + + .. code-tab:: 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) + .. code-tab:: 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); + + + ---- .. _class_AStar_method_disconnect_points: @@ -169,7 +214,7 @@ Deletes the segment between the given points. If ``bidirectional`` is ``false``, .. _class_AStar_method_get_available_point_id: -- :ref:`int` **get_available_point_id** **(** **)** const +- :ref:`int` **get_available_point_id** **(** **)** |const| Returns the next available point ID with no point associated to it. @@ -177,19 +222,24 @@ Returns the next available point ID with no point associated to it. .. _class_AStar_method_get_closest_point: -- :ref:`int` **get_closest_point** **(** :ref:`Vector3` to_position, :ref:`bool` include_disabled=false **)** const +- :ref:`int` **get_closest_point** **(** :ref:`Vector3` to_position, :ref:`bool` include_disabled=false **)** |const| -Returns the ID of the closest point to ``to_position``, 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 ``to_position``, optionally taking disabled points into account. Returns ``-1`` if there are no points in the points pool. + +**Note:** If several points are the closest to ``to_position``, the one with the smallest ID will be returned, ensuring a deterministic result. ---- .. _class_AStar_method_get_closest_position_in_segment: -- :ref:`Vector3` **get_closest_position_in_segment** **(** :ref:`Vector3` to_position **)** const +- :ref:`Vector3` **get_closest_position_in_segment** **(** :ref:`Vector3` to_position **)** |const| Returns the closest position to ``to_position`` that resides inside a segment between two connected points. -:: + +.. tabs:: + + .. code-tab:: gdscript var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) @@ -197,6 +247,16 @@ Returns the closest position to ``to_position`` that resides inside a segment be astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0) + .. code-tab:: 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) + + + The result is in the segment that goes from ``y = 0`` to ``y = 5``. It's the closest position in the segment to the given point. ---- @@ -207,7 +267,10 @@ The result is in the segment that goes from ``y = 0`` to ``y = 5``. It's the clo 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. -:: + +.. tabs:: + + .. code-tab:: gdscript var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) @@ -222,13 +285,28 @@ Returns an array with the IDs of the points that form the path found by AStar be var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] + .. code-tab:: 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] + + + If you change the 2nd point's weight to 3, then the result will be ``[1, 4, 3]`` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. ---- .. _class_AStar_method_get_point_capacity: -- :ref:`int` **get_point_capacity** **(** **)** const +- :ref:`int` **get_point_capacity** **(** **)** |const| Returns the capacity of the structure backing the points, useful in conjunction with ``reserve_space``. @@ -240,7 +318,10 @@ Returns the capacity of the structure backing the points, useful in conjunction Returns an array with the IDs of the points that form the connection with the given point. -:: + +.. tabs:: + + .. code-tab:: gdscript var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) @@ -253,11 +334,25 @@ Returns an array with the IDs of the points that form the connection with the gi var neighbors = astar.get_point_connections(1) # Returns [2, 3] + .. code-tab:: 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] + + + ---- .. _class_AStar_method_get_point_count: -- :ref:`int` **get_point_count** **(** **)** const +- :ref:`int` **get_point_count** **(** **)** |const| Returns the number of points currently in the points pool. @@ -269,11 +364,13 @@ Returns the number of points currently in the points pool. Returns an array with the points that are in the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. +**Note:** This method is not thread-safe. If called from a :ref:`Thread`, it will return an empty :ref:`PackedVector3Array` and will print an error message. + ---- .. _class_AStar_method_get_point_position: -- :ref:`Vector3` **get_point_position** **(** :ref:`int` id **)** const +- :ref:`Vector3` **get_point_position** **(** :ref:`int` id **)** |const| Returns the position of the point associated with the given ``id``. @@ -281,7 +378,7 @@ Returns the position of the point associated with the given ``id``. .. _class_AStar_method_get_point_weight_scale: -- :ref:`float` **get_point_weight_scale** **(** :ref:`int` id **)** const +- :ref:`float` **get_point_weight_scale** **(** :ref:`int` id **)** |const| Returns the weight scale of the point associated with the given ``id``. @@ -297,7 +394,7 @@ Returns an array of all points. .. _class_AStar_method_has_point: -- :ref:`bool` **has_point** **(** :ref:`int` id **)** const +- :ref:`bool` **has_point** **(** :ref:`int` id **)** |const| Returns whether a point associated with the given ``id`` exists. @@ -305,7 +402,7 @@ Returns whether a point associated with the given ``id`` exists. .. _class_AStar_method_is_point_disabled: -- :ref:`bool` **is_point_disabled** **(** :ref:`int` id **)** const +- :ref:`bool` **is_point_disabled** **(** :ref:`int` id **)** |const| Returns whether a point is disabled or not for pathfinding. By default, all points are enabled. @@ -347,5 +444,11 @@ Sets the ``position`` for the point with the given ``id``. - void **set_point_weight_scale** **(** :ref:`int` id, :ref:`float` weight_scale **)** -Sets the ``weight_scale`` for the point with the given ``id``. +Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_astar2d.rst b/classes/class_astar2d.rst index 7f5d0aa0e..b293255e4 100644 --- a/classes/class_astar2d.rst +++ b/classes/class_astar2d.rst @@ -9,7 +9,7 @@ AStar2D ======= -**Inherits:** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`RefCounted` **<** :ref:`Object` AStar class representation that uses 2D vectors as edges. @@ -21,64 +21,64 @@ This is a wrapper for the :ref:`AStar` class which uses 2D vectors Methods ------- -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`_compute_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** virtual | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`_estimate_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** virtual | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`add_point` **(** :ref:`int` id, :ref:`Vector2` position, :ref:`float` weight_scale=1.0 **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`are_points_connected` **(** :ref:`int` id, :ref:`int` to_id **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`clear` **(** **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`connect_points` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`disconnect_points` **(** :ref:`int` id, :ref:`int` to_id **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_available_point_id` **(** **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_closest_point` **(** :ref:`Vector2` to_position, :ref:`bool` include_disabled=false **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_closest_position_in_segment` **(** :ref:`Vector2` to_position **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedInt32Array` | :ref:`get_id_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_point_capacity` **(** **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedInt32Array` | :ref:`get_point_connections` **(** :ref:`int` id **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_point_count` **(** **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`PackedVector2Array` | :ref:`get_point_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`get_point_position` **(** :ref:`int` id **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_point_weight_scale` **(** :ref:`int` id **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Array` | :ref:`get_points` **(** **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`has_point` **(** :ref:`int` id **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_point_disabled` **(** :ref:`int` id **)** const | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`remove_point` **(** :ref:`int` id **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`reserve_space` **(** :ref:`int` num_nodes **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_point_disabled` **(** :ref:`int` id, :ref:`bool` disabled=true **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_point_position` **(** :ref:`int` id, :ref:`Vector2` position **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_point_weight_scale` **(** :ref:`int` id, :ref:`float` weight_scale **)** | -+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`_compute_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`_estimate_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_point` **(** :ref:`int` id, :ref:`Vector2` position, :ref:`float` weight_scale=1.0 **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`are_points_connected` **(** :ref:`int` id, :ref:`int` to_id **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`connect_points` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_points` **(** :ref:`int` id, :ref:`int` to_id **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_available_point_id` **(** **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_closest_point` **(** :ref:`Vector2` to_position, :ref:`bool` include_disabled=false **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_closest_position_in_segment` **(** :ref:`Vector2` to_position **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedInt32Array` | :ref:`get_id_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_capacity` **(** **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedInt32Array` | :ref:`get_point_connections` **(** :ref:`int` id **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_count` **(** **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedVector2Array` | :ref:`get_point_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_point_position` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_point_weight_scale` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_points` **(** **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_point` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_point_disabled` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_point` **(** :ref:`int` id **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reserve_space` **(** :ref:`int` num_nodes **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_disabled` **(** :ref:`int` id, :ref:`bool` disabled=true **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_position` **(** :ref:`int` id, :ref:`Vector2` position **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_weight_scale` **(** :ref:`int` id, :ref:`float` weight_scale **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- .. _class_AStar2D_method__compute_cost: -- :ref:`float` **_compute_cost** **(** :ref:`int` from_id, :ref:`int` to_id **)** virtual +- :ref:`float` **_compute_cost** **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| |const| Called when computing the cost between two connected points. @@ -88,7 +88,7 @@ Note that this function is hidden in the default ``AStar2D`` class. .. _class_AStar2D_method__estimate_cost: -- :ref:`float` **_estimate_cost** **(** :ref:`int` from_id, :ref:`int` to_id **)** virtual +- :ref:`float` **_estimate_cost** **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| |const| Called when estimating the cost between a point and the path's ending point. @@ -100,20 +100,32 @@ Note that this function is hidden in the default ``AStar2D`` class. - void **add_point** **(** :ref:`int` id, :ref:`Vector2` position, :ref:`float` weight_scale=1.0 **)** -Adds a new point at the given position with the given identifier. The algorithm prefers points with lower ``weight_scale`` to form a path. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 1 or larger. +Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 1 or larger. -:: +The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower ``weight_scale``\ s to form a path. + + +.. tabs:: + + .. code-tab:: 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 + .. code-tab:: 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 + + + If there already exists a point for the given ``id``, its position and weight scale are updated to the given values. ---- .. _class_AStar2D_method_are_points_connected: -- :ref:`bool` **are_points_connected** **(** :ref:`int` id, :ref:`int` to_id **)** const +- :ref:`bool` **are_points_connected** **(** :ref:`int` id, :ref:`int` to_id **)** |const| Returns whether there is a connection/segment between the given points. @@ -133,13 +145,25 @@ Clears all the points and segments. Creates a segment between the given points. If ``bidirectional`` is ``false``, only movement from ``id`` to ``to_id`` is allowed, not the reverse direction. -:: + +.. tabs:: + + .. code-tab:: 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) + .. code-tab:: csharp + + var astar = new AStar2D(); + astar.AddPoint(1, new Vector2(1, 1)); + astar.AddPoint(2, new Vector2(0, 5)); + astar.ConnectPoints(1, 2, false); + + + ---- .. _class_AStar2D_method_disconnect_points: @@ -152,7 +176,7 @@ Deletes the segment between the given points. .. _class_AStar2D_method_get_available_point_id: -- :ref:`int` **get_available_point_id** **(** **)** const +- :ref:`int` **get_available_point_id** **(** **)** |const| Returns the next available point ID with no point associated to it. @@ -160,19 +184,24 @@ Returns the next available point ID with no point associated to it. .. _class_AStar2D_method_get_closest_point: -- :ref:`int` **get_closest_point** **(** :ref:`Vector2` to_position, :ref:`bool` include_disabled=false **)** const +- :ref:`int` **get_closest_point** **(** :ref:`Vector2` to_position, :ref:`bool` include_disabled=false **)** |const| -Returns the ID of the closest point to ``to_position``, 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 ``to_position``, optionally taking disabled points into account. Returns ``-1`` if there are no points in the points pool. + +**Note:** If several points are the closest to ``to_position``, the one with the smallest ID will be returned, ensuring a deterministic result. ---- .. _class_AStar2D_method_get_closest_position_in_segment: -- :ref:`Vector2` **get_closest_position_in_segment** **(** :ref:`Vector2` to_position **)** const +- :ref:`Vector2` **get_closest_position_in_segment** **(** :ref:`Vector2` to_position **)** |const| Returns the closest position to ``to_position`` that resides inside a segment between two connected points. -:: + +.. tabs:: + + .. code-tab:: gdscript var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) @@ -180,6 +209,16 @@ Returns the closest position to ``to_position`` that resides inside a segment be astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3) + .. code-tab:: 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) + + + The result is in the segment that goes from ``y = 0`` to ``y = 5``. It's the closest position in the segment to the given point. ---- @@ -190,7 +229,10 @@ The result is in the segment that goes from ``y = 0`` to ``y = 5``. It's the clo 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. -:: + +.. tabs:: + + .. code-tab:: gdscript var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) @@ -205,13 +247,29 @@ Returns an array with the IDs of the points that form the path found by AStar2D var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] + .. code-tab:: 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] + + + If you change the 2nd point's weight to 3, then the result will be ``[1, 4, 3]`` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. ---- .. _class_AStar2D_method_get_point_capacity: -- :ref:`int` **get_point_capacity** **(** **)** const +- :ref:`int` **get_point_capacity** **(** **)** |const| Returns the capacity of the structure backing the points, useful in conjunction with ``reserve_space``. @@ -223,7 +281,10 @@ Returns the capacity of the structure backing the points, useful in conjunction Returns an array with the IDs of the points that form the connection with the given point. -:: + +.. tabs:: + + .. code-tab:: gdscript var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) @@ -236,11 +297,26 @@ Returns an array with the IDs of the points that form the connection with the gi var neighbors = astar.get_point_connections(1) # Returns [2, 3] + .. code-tab:: 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] + + + ---- .. _class_AStar2D_method_get_point_count: -- :ref:`int` **get_point_count** **(** **)** const +- :ref:`int` **get_point_count** **(** **)** |const| Returns the number of points currently in the points pool. @@ -252,11 +328,13 @@ Returns the number of points currently in the points pool. Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. +**Note:** This method is not thread-safe. If called from a :ref:`Thread`, it will return an empty :ref:`PackedVector2Array` and will print an error message. + ---- .. _class_AStar2D_method_get_point_position: -- :ref:`Vector2` **get_point_position** **(** :ref:`int` id **)** const +- :ref:`Vector2` **get_point_position** **(** :ref:`int` id **)** |const| Returns the position of the point associated with the given ``id``. @@ -264,7 +342,7 @@ Returns the position of the point associated with the given ``id``. .. _class_AStar2D_method_get_point_weight_scale: -- :ref:`float` **get_point_weight_scale** **(** :ref:`int` id **)** const +- :ref:`float` **get_point_weight_scale** **(** :ref:`int` id **)** |const| Returns the weight scale of the point associated with the given ``id``. @@ -280,7 +358,7 @@ Returns an array of all points. .. _class_AStar2D_method_has_point: -- :ref:`bool` **has_point** **(** :ref:`int` id **)** const +- :ref:`bool` **has_point** **(** :ref:`int` id **)** |const| Returns whether a point associated with the given ``id`` exists. @@ -288,7 +366,7 @@ Returns whether a point associated with the given ``id`` exists. .. _class_AStar2D_method_is_point_disabled: -- :ref:`bool` **is_point_disabled** **(** :ref:`int` id **)** const +- :ref:`bool` **is_point_disabled** **(** :ref:`int` id **)** |const| Returns whether a point is disabled or not for pathfinding. By default, all points are enabled. @@ -330,5 +408,11 @@ Sets the ``position`` for the point with the given ``id``. - void **set_point_weight_scale** **(** :ref:`int` id, :ref:`float` weight_scale **)** -Sets the ``weight_scale`` for the point with the given ``id``. +Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost` when determining the overall cost of traveling across a segment from a neighboring point to this point. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_atlastexture.rst b/classes/class_atlastexture.rst index 1420ac512..1244fe022 100644 --- a/classes/class_atlastexture.rst +++ b/classes/class_atlastexture.rst @@ -9,27 +9,29 @@ AtlasTexture ============ -**Inherits:** :ref:`Texture2D` **<** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`Texture2D` **<** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Packs multiple small textures in a single, bigger one. Helps to optimize video memory costs and render calls. +Crops out one part of a texture, such as a texture from a texture atlas. Description ----------- -:ref:`Texture2D` resource aimed at managing big textures files that pack multiple smaller textures. Consists of a :ref:`Texture2D`, a margin that defines the border width, and a region that defines the actual area of the AtlasTexture. +:ref:`Texture2D` resource that crops out one part of the :ref:`atlas` texture, defined by :ref:`region`. The main use case is cropping out textures from a texture atlas, which is a big texture file that packs multiple smaller textures. Consists of a :ref:`Texture2D` for the :ref:`atlas`, a :ref:`region` that defines the area of :ref:`atlas` to use, and a :ref:`margin` that defines the border width. + +``AtlasTexture`` cannot be used in an :ref:`AnimatedTexture`, cannot be tiled in nodes such as :ref:`TextureRect`, and does not work properly if used inside of other ``AtlasTexture`` resources. Multiple ``AtlasTexture`` resources can be used to crop multiple textures from the atlas. Using a texture atlas helps to optimize video memory costs and render calls compared to using multiple small files. Properties ---------- -+-----------------------------------+-------------------------------------------------------------+-------------------------+ -| :ref:`Texture2D` | :ref:`atlas` | | -+-----------------------------------+-------------------------------------------------------------+-------------------------+ -| :ref:`bool` | :ref:`filter_clip` | ``false`` | -+-----------------------------------+-------------------------------------------------------------+-------------------------+ -| :ref:`Rect2` | :ref:`margin` | ``Rect2( 0, 0, 0, 0 )`` | -+-----------------------------------+-------------------------------------------------------------+-------------------------+ -| :ref:`Rect2` | :ref:`region` | ``Rect2( 0, 0, 0, 0 )`` | -+-----------------------------------+-------------------------------------------------------------+-------------------------+ ++-----------------------------------+-------------------------------------------------------------+-----------------------+ +| :ref:`Texture2D` | :ref:`atlas` | | ++-----------------------------------+-------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`filter_clip` | ``false`` | ++-----------------------------------+-------------------------------------------------------------+-----------------------+ +| :ref:`Rect2` | :ref:`margin` | ``Rect2(0, 0, 0, 0)`` | ++-----------------------------------+-------------------------------------------------------------+-----------------------+ +| :ref:`Rect2` | :ref:`region` | ``Rect2(0, 0, 0, 0)`` | ++-----------------------------------+-------------------------------------------------------------+-----------------------+ Property Descriptions --------------------- @@ -68,13 +70,13 @@ If ``true``, clips the area outside of the region to avoid bleeding of the surro - :ref:`Rect2` **margin** -+-----------+-------------------------+ -| *Default* | ``Rect2( 0, 0, 0, 0 )`` | -+-----------+-------------------------+ -| *Setter* | set_margin(value) | -+-----------+-------------------------+ -| *Getter* | get_margin() | -+-----------+-------------------------+ ++-----------+-----------------------+ +| *Default* | ``Rect2(0, 0, 0, 0)`` | ++-----------+-----------------------+ +| *Setter* | set_margin(value) | ++-----------+-----------------------+ +| *Getter* | get_margin() | ++-----------+-----------------------+ The margin around the region. The :ref:`Rect2`'s :ref:`Rect2.size` parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin. @@ -84,13 +86,19 @@ The margin around the region. The :ref:`Rect2`'s :ref:`Rect2.size` **region** -+-----------+-------------------------+ -| *Default* | ``Rect2( 0, 0, 0, 0 )`` | -+-----------+-------------------------+ -| *Setter* | set_region(value) | -+-----------+-------------------------+ -| *Getter* | get_region() | -+-----------+-------------------------+ ++-----------+-----------------------+ +| *Default* | ``Rect2(0, 0, 0, 0)`` | ++-----------+-----------------------+ +| *Setter* | set_region(value) | ++-----------+-----------------------+ +| *Getter* | get_region() | ++-----------+-----------------------+ The AtlasTexture's used region. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audiobuslayout.rst b/classes/class_audiobuslayout.rst index b692b32ee..743924365 100644 --- a/classes/class_audiobuslayout.rst +++ b/classes/class_audiobuslayout.rst @@ -9,7 +9,7 @@ AudioBusLayout ============== -**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Stores information about the audio buses. @@ -18,3 +18,9 @@ Description Stores position, muting, solo, bypass, effects, effect position, volume, and the connections between buses. See :ref:`AudioServer` for usage. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffect.rst b/classes/class_audioeffect.rst index 10b6c3115..eb1bc0ec1 100644 --- a/classes/class_audioeffect.rst +++ b/classes/class_audioeffect.rst @@ -9,9 +9,9 @@ AudioEffect =========== -**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -**Inherited By:** :ref:`AudioEffectAmplify`, :ref:`AudioEffectChorus`, :ref:`AudioEffectCompressor`, :ref:`AudioEffectDelay`, :ref:`AudioEffectDistortion`, :ref:`AudioEffectEQ`, :ref:`AudioEffectFilter`, :ref:`AudioEffectLimiter`, :ref:`AudioEffectPanner`, :ref:`AudioEffectPhaser`, :ref:`AudioEffectPitchShift`, :ref:`AudioEffectRecord`, :ref:`AudioEffectReverb`, :ref:`AudioEffectSpectrumAnalyzer`, :ref:`AudioEffectStereoEnhance` +**Inherited By:** :ref:`AudioEffectAmplify`, :ref:`AudioEffectCapture`, :ref:`AudioEffectChorus`, :ref:`AudioEffectCompressor`, :ref:`AudioEffectDelay`, :ref:`AudioEffectDistortion`, :ref:`AudioEffectEQ`, :ref:`AudioEffectFilter`, :ref:`AudioEffectLimiter`, :ref:`AudioEffectPanner`, :ref:`AudioEffectPhaser`, :ref:`AudioEffectPitchShift`, :ref:`AudioEffectRecord`, :ref:`AudioEffectReverb`, :ref:`AudioEffectSpectrumAnalyzer`, :ref:`AudioEffectStereoEnhance` Audio effect for audio. @@ -20,3 +20,14 @@ Description Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on. +Tutorials +--------- + +- `Audio Mic Record Demo `__ + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectamplify.rst b/classes/class_audioeffectamplify.rst index 4ba61f794..ba84fcddb 100644 --- a/classes/class_audioeffectamplify.rst +++ b/classes/class_audioeffectamplify.rst @@ -9,7 +9,7 @@ AudioEffectAmplify ================== -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds an amplifying audio effect to an audio bus. @@ -44,3 +44,9 @@ Property Descriptions Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectbandlimitfilter.rst b/classes/class_audioeffectbandlimitfilter.rst index 251edfe1e..1bc226ffd 100644 --- a/classes/class_audioeffectbandlimitfilter.rst +++ b/classes/class_audioeffectbandlimitfilter.rst @@ -9,7 +9,7 @@ AudioEffectBandLimitFilter ========================== -**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a band limit filter to the audio bus. @@ -18,3 +18,9 @@ Description Limits the frequencies in a range around the :ref:`AudioEffectFilter.cutoff_hz` and allows frequencies outside of this range to pass. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectbandpassfilter.rst b/classes/class_audioeffectbandpassfilter.rst index c07d1c4d3..3c4e55e45 100644 --- a/classes/class_audioeffectbandpassfilter.rst +++ b/classes/class_audioeffectbandpassfilter.rst @@ -9,7 +9,7 @@ AudioEffectBandPassFilter ========================= -**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a band pass filter to the audio bus. @@ -18,3 +18,9 @@ Description Attenuates the frequencies inside of a range around the :ref:`AudioEffectFilter.cutoff_hz` and cuts frequencies outside of this band. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectcapture.rst b/classes/class_audioeffectcapture.rst new file mode 100644 index 000000000..a26f5475f --- /dev/null +++ b/classes/class_audioeffectcapture.rst @@ -0,0 +1,130 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioEffectCapture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectCapture: + +AudioEffectCapture +================== + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` + +Captures audio from an audio bus in real-time. + +Description +----------- + +AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect bus into its internal ring buffer. + +Application code should consume these audio frames from this ring buffer using :ref:`get_buffer` and process it as needed, for example to capture data from a microphone, implement application defined effects, or to transmit audio over the network. + +Properties +---------- + ++---------------------------+-----------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`buffer_length` | ``0.1`` | ++---------------------------+-----------------------------------------------------------------------+---------+ + +Methods +------- + ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_get_buffer` **(** :ref:`int` frames **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_buffer` **(** **)** | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedVector2Array` | :ref:`get_buffer` **(** :ref:`int` frames **)** | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_buffer_length_frames` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_discarded_frames` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_frames_available` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_pushed_frames` **(** **)** |const| | ++-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectCapture_property_buffer_length: + +- :ref:`float` **buffer_length** + ++-----------+--------------------------+ +| *Default* | ``0.1`` | ++-----------+--------------------------+ +| *Setter* | set_buffer_length(value) | ++-----------+--------------------------+ +| *Getter* | get_buffer_length() | ++-----------+--------------------------+ + +Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized. + +Method Descriptions +------------------- + +.. _class_AudioEffectCapture_method_can_get_buffer: + +- :ref:`bool` **can_get_buffer** **(** :ref:`int` frames **)** |const| + +Returns ``true`` if at least ``frames`` audio frames are available to read in the internal ring buffer. + +---- + +.. _class_AudioEffectCapture_method_clear_buffer: + +- void **clear_buffer** **(** **)** + +Clears the internal ring buffer. + +---- + +.. _class_AudioEffectCapture_method_get_buffer: + +- :ref:`PackedVector2Array` **get_buffer** **(** :ref:`int` frames **)** + +Gets the next ``frames`` audio samples from the internal ring buffer. + +Returns a :ref:`PackedVector2Array` containing exactly ``frames`` audio samples if available, or an empty :ref:`PackedVector2Array` if insufficient data was available. + +---- + +.. _class_AudioEffectCapture_method_get_buffer_length_frames: + +- :ref:`int` **get_buffer_length_frames** **(** **)** |const| + +Returns the total size of the internal ring buffer in frames. + +---- + +.. _class_AudioEffectCapture_method_get_discarded_frames: + +- :ref:`int` **get_discarded_frames** **(** **)** |const| + +Returns the number of audio frames discarded from the audio bus due to full buffer. + +---- + +.. _class_AudioEffectCapture_method_get_frames_available: + +- :ref:`int` **get_frames_available** **(** **)** |const| + +Returns the number of frames available to read using :ref:`get_buffer`. + +---- + +.. _class_AudioEffectCapture_method_get_pushed_frames: + +- :ref:`int` **get_pushed_frames** **(** **)** |const| + +Returns the number of audio frames inserted from the audio bus. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectchorus.rst b/classes/class_audioeffectchorus.rst index 150767232..ebceb564e 100644 --- a/classes/class_audioeffectchorus.rst +++ b/classes/class_audioeffectchorus.rst @@ -9,7 +9,7 @@ AudioEffectChorus ================= -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a chorus audio effect. @@ -81,17 +81,17 @@ Methods ------- +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_voice_cutoff_hz` **(** :ref:`int` voice_idx **)** const | +| :ref:`float` | :ref:`get_voice_cutoff_hz` **(** :ref:`int` voice_idx **)** |const| | +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_voice_delay_ms` **(** :ref:`int` voice_idx **)** const | +| :ref:`float` | :ref:`get_voice_delay_ms` **(** :ref:`int` voice_idx **)** |const| | +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_voice_depth_ms` **(** :ref:`int` voice_idx **)** const | +| :ref:`float` | :ref:`get_voice_depth_ms` **(** :ref:`int` voice_idx **)** |const| | +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_voice_level_db` **(** :ref:`int` voice_idx **)** const | +| :ref:`float` | :ref:`get_voice_level_db` **(** :ref:`int` voice_idx **)** |const| | +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_voice_pan` **(** :ref:`int` voice_idx **)** const | +| :ref:`float` | :ref:`get_voice_pan` **(** :ref:`int` voice_idx **)** |const| | +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_voice_rate_hz` **(** :ref:`int` voice_idx **)** const | +| :ref:`float` | :ref:`get_voice_rate_hz` **(** :ref:`int` voice_idx **)** |const| | +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_voice_cutoff_hz` **(** :ref:`int` voice_idx, :ref:`float` cutoff_hz **)** | +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -520,37 +520,37 @@ Method Descriptions .. _class_AudioEffectChorus_method_get_voice_cutoff_hz: -- :ref:`float` **get_voice_cutoff_hz** **(** :ref:`int` voice_idx **)** const +- :ref:`float` **get_voice_cutoff_hz** **(** :ref:`int` voice_idx **)** |const| ---- .. _class_AudioEffectChorus_method_get_voice_delay_ms: -- :ref:`float` **get_voice_delay_ms** **(** :ref:`int` voice_idx **)** const +- :ref:`float` **get_voice_delay_ms** **(** :ref:`int` voice_idx **)** |const| ---- .. _class_AudioEffectChorus_method_get_voice_depth_ms: -- :ref:`float` **get_voice_depth_ms** **(** :ref:`int` voice_idx **)** const +- :ref:`float` **get_voice_depth_ms** **(** :ref:`int` voice_idx **)** |const| ---- .. _class_AudioEffectChorus_method_get_voice_level_db: -- :ref:`float` **get_voice_level_db** **(** :ref:`int` voice_idx **)** const +- :ref:`float` **get_voice_level_db** **(** :ref:`int` voice_idx **)** |const| ---- .. _class_AudioEffectChorus_method_get_voice_pan: -- :ref:`float` **get_voice_pan** **(** :ref:`int` voice_idx **)** const +- :ref:`float` **get_voice_pan** **(** :ref:`int` voice_idx **)** |const| ---- .. _class_AudioEffectChorus_method_get_voice_rate_hz: -- :ref:`float` **get_voice_rate_hz** **(** :ref:`int` voice_idx **)** const +- :ref:`float` **get_voice_rate_hz** **(** :ref:`int` voice_idx **)** |const| ---- @@ -588,3 +588,9 @@ Method Descriptions - void **set_voice_rate_hz** **(** :ref:`int` voice_idx, :ref:`float` rate_hz **)** +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectcompressor.rst b/classes/class_audioeffectcompressor.rst index be2b6c765..ee624b94e 100644 --- a/classes/class_audioeffectcompressor.rst +++ b/classes/class_audioeffectcompressor.rst @@ -9,7 +9,7 @@ AudioEffectCompressor ===================== -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a compressor audio effect to an audio bus. @@ -44,7 +44,7 @@ Properties +-------------------------------------+--------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`release_ms` | ``250.0`` | +-------------------------------------+--------------------------------------------------------------------+-----------+ -| :ref:`StringName` | :ref:`sidechain` | ``@""`` | +| :ref:`StringName` | :ref:`sidechain` | ``&""`` | +-------------------------------------+--------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`threshold` | ``0.0`` | +-------------------------------------+--------------------------------------------------------------------+-----------+ @@ -137,7 +137,7 @@ Compressor's delay time to stop reducing the signal after the signal level falls - :ref:`StringName` **sidechain** +-----------+----------------------+ -| *Default* | ``@""`` | +| *Default* | ``&""`` | +-----------+----------------------+ | *Setter* | set_sidechain(value) | +-----------+----------------------+ @@ -162,3 +162,9 @@ Reduce the sound level using another audio bus for threshold detection. The level above which compression is applied to the audio. Value can range from -60 to 0. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectdelay.rst b/classes/class_audioeffectdelay.rst index 35d41b3da..5ebe8924d 100644 --- a/classes/class_audioeffectdelay.rst +++ b/classes/class_audioeffectdelay.rst @@ -9,7 +9,7 @@ AudioEffectDelay ================ -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a delay audio effect to an audio bus. Plays input signal back after a period of time. @@ -260,3 +260,9 @@ Sound level for ``tap2``. Pan position for ``tap2``. Value can range from -1 (fully left) to 1 (fully right). +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectdistortion.rst b/classes/class_audioeffectdistortion.rst index a46c87e37..1e977c8c3 100644 --- a/classes/class_audioeffectdistortion.rst +++ b/classes/class_audioeffectdistortion.rst @@ -9,19 +9,24 @@ AudioEffectDistortion ===================== -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a distortion audio effect to an Audio bus. -Modify the sound to make it dirty. +Modify the sound to make it distorted. 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. +Tutorials +--------- + +- :doc:`../tutorials/audio/audio_buses` + Properties ---------- @@ -145,3 +150,9 @@ Increases or decreases the volume after the effect. Value can range from -80 to Increases or decreases the volume before the effect. Value can range from -60 to 60. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffecteq.rst b/classes/class_audioeffecteq.rst index 1ca800425..e10f4ae17 100644 --- a/classes/class_audioeffecteq.rst +++ b/classes/class_audioeffecteq.rst @@ -9,7 +9,7 @@ AudioEffectEQ ============= -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`AudioEffectEQ10`, :ref:`AudioEffectEQ21`, :ref:`AudioEffectEQ6` @@ -26,9 +26,9 @@ Methods ------- +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`get_band_count` **(** **)** const | +| :ref:`int` | :ref:`get_band_count` **(** **)** |const| | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`get_band_gain_db` **(** :ref:`int` band_idx **)** const | +| :ref:`float` | :ref:`get_band_gain_db` **(** :ref:`int` band_idx **)** |const| | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_band_gain_db` **(** :ref:`int` band_idx, :ref:`float` volume_db **)** | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -38,7 +38,7 @@ Method Descriptions .. _class_AudioEffectEQ_method_get_band_count: -- :ref:`int` **get_band_count** **(** **)** const +- :ref:`int` **get_band_count** **(** **)** |const| Returns the number of bands of the equalizer. @@ -46,7 +46,7 @@ Returns the number of bands of the equalizer. .. _class_AudioEffectEQ_method_get_band_gain_db: -- :ref:`float` **get_band_gain_db** **(** :ref:`int` band_idx **)** const +- :ref:`float` **get_band_gain_db** **(** :ref:`int` band_idx **)** |const| Returns the band's gain at the specified index, in dB. @@ -58,3 +58,9 @@ Returns the band's gain at the specified index, in dB. Sets band's gain at the specified index, in dB. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffecteq10.rst b/classes/class_audioeffecteq10.rst index 5148d9316..4f7e3313d 100644 --- a/classes/class_audioeffecteq10.rst +++ b/classes/class_audioeffecteq10.rst @@ -9,7 +9,7 @@ AudioEffectEQ10 =============== -**Inherits:** :ref:`AudioEffectEQ` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffectEQ` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a 10-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 31 Hz to 16000 Hz. @@ -42,3 +42,9 @@ Band 10: 16000 Hz See also :ref:`AudioEffectEQ`, :ref:`AudioEffectEQ6`, :ref:`AudioEffectEQ21`. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffecteq21.rst b/classes/class_audioeffecteq21.rst index 501575136..52ff84233 100644 --- a/classes/class_audioeffecteq21.rst +++ b/classes/class_audioeffecteq21.rst @@ -9,7 +9,7 @@ AudioEffectEQ21 =============== -**Inherits:** :ref:`AudioEffectEQ` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffectEQ` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a 21-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 22 Hz to 22000 Hz. @@ -64,3 +64,9 @@ Band 21: 22000 Hz See also :ref:`AudioEffectEQ`, :ref:`AudioEffectEQ6`, :ref:`AudioEffectEQ10`. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffecteq6.rst b/classes/class_audioeffecteq6.rst index e4677ee64..bfee2aba2 100644 --- a/classes/class_audioeffecteq6.rst +++ b/classes/class_audioeffecteq6.rst @@ -9,7 +9,7 @@ AudioEffectEQ6 ============== -**Inherits:** :ref:`AudioEffectEQ` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffectEQ` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a 6-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 32 Hz to 10000 Hz. @@ -34,3 +34,9 @@ Band 6: 10000 Hz See also :ref:`AudioEffectEQ`, :ref:`AudioEffectEQ10`, :ref:`AudioEffectEQ21`. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectfilter.rst b/classes/class_audioeffectfilter.rst index 01ab714f6..3d7d5327e 100644 --- a/classes/class_audioeffectfilter.rst +++ b/classes/class_audioeffectfilter.rst @@ -9,7 +9,7 @@ AudioEffectFilter ================= -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`AudioEffectBandLimitFilter`, :ref:`AudioEffectBandPassFilter`, :ref:`AudioEffectHighPassFilter`, :ref:`AudioEffectHighShelfFilter`, :ref:`AudioEffectLowPassFilter`, :ref:`AudioEffectLowShelfFilter`, :ref:`AudioEffectNotchFilter` @@ -20,6 +20,11 @@ Description Allows frequencies other than the :ref:`cutoff_hz` to pass. +Tutorials +--------- + +- :doc:`../tutorials/audio/audio_buses` + Properties ---------- @@ -117,5 +122,11 @@ Gain amount of the frequencies after the filter. | *Getter* | get_resonance() | +-----------+----------------------+ -Amount of boost in the overtones near the cutoff frequency. +Amount of boost in the frequency range near the cutoff frequency. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffecthighpassfilter.rst b/classes/class_audioeffecthighpassfilter.rst index c5a37b83f..5500293a3 100644 --- a/classes/class_audioeffecthighpassfilter.rst +++ b/classes/class_audioeffecthighpassfilter.rst @@ -9,7 +9,7 @@ AudioEffectHighPassFilter ========================= -**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a high-pass filter to the Audio Bus. @@ -18,3 +18,9 @@ Description Cuts frequencies lower than the :ref:`AudioEffectFilter.cutoff_hz` and allows higher frequencies to pass. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffecthighshelffilter.rst b/classes/class_audioeffecthighshelffilter.rst index 1e24a4f49..19fcde178 100644 --- a/classes/class_audioeffecthighshelffilter.rst +++ b/classes/class_audioeffecthighshelffilter.rst @@ -9,7 +9,18 @@ AudioEffectHighShelfFilter ========================== -**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` +Reduces all frequencies above the :ref:`AudioEffectFilter.cutoff_hz`. +Tutorials +--------- +- :doc:`../tutorials/audio/audio_buses` + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectinstance.rst b/classes/class_audioeffectinstance.rst index 5cc23c220..01e2593f3 100644 --- a/classes/class_audioeffectinstance.rst +++ b/classes/class_audioeffectinstance.rst @@ -9,9 +9,15 @@ AudioEffectInstance =================== -**Inherits:** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`AudioEffectSpectrumAnalyzerInstance` +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectlimiter.rst b/classes/class_audioeffectlimiter.rst index 8ac78d527..7265577ee 100644 --- a/classes/class_audioeffectlimiter.rst +++ b/classes/class_audioeffectlimiter.rst @@ -9,7 +9,7 @@ AudioEffectLimiter ================== -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a soft-clip limiter audio effect to an Audio bus. @@ -96,3 +96,9 @@ Applies a gain to the limited waves, in decibels. Value can range from 0 to 6. Threshold from which the limiter begins to be active, in decibels. Value can range from -30 to 0. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectlowpassfilter.rst b/classes/class_audioeffectlowpassfilter.rst index 53a9d49d1..b2f91ee0d 100644 --- a/classes/class_audioeffectlowpassfilter.rst +++ b/classes/class_audioeffectlowpassfilter.rst @@ -9,7 +9,7 @@ AudioEffectLowPassFilter ======================== -**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a low-pass filter to the Audio bus. @@ -18,3 +18,9 @@ Description Cuts frequencies higher than the :ref:`AudioEffectFilter.cutoff_hz` and allows lower frequencies to pass. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectlowshelffilter.rst b/classes/class_audioeffectlowshelffilter.rst index aa0265432..4819f8335 100644 --- a/classes/class_audioeffectlowshelffilter.rst +++ b/classes/class_audioeffectlowshelffilter.rst @@ -9,7 +9,18 @@ AudioEffectLowShelfFilter ========================= -**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` +Reduces all frequencies below the :ref:`AudioEffectFilter.cutoff_hz`. +Tutorials +--------- +- :doc:`../tutorials/audio/audio_buses` + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectnotchfilter.rst b/classes/class_audioeffectnotchfilter.rst index 92adb4be8..9784a4bff 100644 --- a/classes/class_audioeffectnotchfilter.rst +++ b/classes/class_audioeffectnotchfilter.rst @@ -9,7 +9,7 @@ AudioEffectNotchFilter ====================== -**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a notch filter to the Audio bus. @@ -18,3 +18,9 @@ Description Attenuates frequencies in a narrow band around the :ref:`AudioEffectFilter.cutoff_hz` and cuts frequencies outside of this range. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectpanner.rst b/classes/class_audioeffectpanner.rst index 1e947be1d..2516ebe63 100644 --- a/classes/class_audioeffectpanner.rst +++ b/classes/class_audioeffectpanner.rst @@ -9,7 +9,7 @@ AudioEffectPanner ================= -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a panner audio effect to an Audio bus. Pans sound left or right. @@ -42,3 +42,9 @@ Property Descriptions Pan position. Value can range from -1 (fully left) to 1 (fully right). +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectphaser.rst b/classes/class_audioeffectphaser.rst index 617e2f146..e3592bd4b 100644 --- a/classes/class_audioeffectphaser.rst +++ b/classes/class_audioeffectphaser.rst @@ -9,7 +9,7 @@ AudioEffectPhaser ================= -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a phaser audio effect to an Audio bus. @@ -116,3 +116,9 @@ Determines the minimum frequency affected by the LFO modulations, in Hz. Value c Adjusts the rate in Hz at which the effect sweeps up and down across the frequency range. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectpitchshift.rst b/classes/class_audioeffectpitchshift.rst index 91339af5a..7f3e4ef89 100644 --- a/classes/class_audioeffectpitchshift.rst +++ b/classes/class_audioeffectpitchshift.rst @@ -9,7 +9,7 @@ AudioEffectPitchShift ===================== -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a pitch-shifting audio effect to an Audio bus. @@ -23,18 +23,18 @@ Allows modulation of pitch independently of tempo. All frequencies can be increa Properties ---------- -+------------------------------------------------------+------------------------------------------------------------------------+---------+ -| :ref:`FFT_Size` | :ref:`fft_size` | ``3`` | -+------------------------------------------------------+------------------------------------------------------------------------+---------+ -| :ref:`int` | :ref:`oversampling` | ``4`` | -+------------------------------------------------------+------------------------------------------------------------------------+---------+ -| :ref:`float` | :ref:`pitch_scale` | ``1.0`` | -+------------------------------------------------------+------------------------------------------------------------------------+---------+ ++----------------------------------------------------+------------------------------------------------------------------------+---------+ +| :ref:`FFTSize` | :ref:`fft_size` | ``3`` | ++----------------------------------------------------+------------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`oversampling` | ``4`` | ++----------------------------------------------------+------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`pitch_scale` | ``1.0`` | ++----------------------------------------------------+------------------------------------------------------------------------+---------+ Enumerations ------------ -.. _enum_AudioEffectPitchShift_FFT_Size: +.. _enum_AudioEffectPitchShift_FFTSize: .. _class_AudioEffectPitchShift_constant_FFT_SIZE_256: @@ -48,26 +48,26 @@ Enumerations .. _class_AudioEffectPitchShift_constant_FFT_SIZE_MAX: -enum **FFT_Size**: +enum **FFTSize**: -- **FFT_SIZE_256** = **0** +- **FFT_SIZE_256** = **0** --- Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time. -- **FFT_SIZE_512** = **1** +- **FFT_SIZE_512** = **1** --- Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time. -- **FFT_SIZE_1024** = **2** +- **FFT_SIZE_1024** = **2** --- Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time. -- **FFT_SIZE_2048** = **3** +- **FFT_SIZE_2048** = **3** --- Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time. -- **FFT_SIZE_4096** = **4** +- **FFT_SIZE_4096** = **4** --- Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time. -- **FFT_SIZE_MAX** = **5** --- Represents the size of the :ref:`FFT_Size` enum. +- **FFT_SIZE_MAX** = **5** --- Represents the size of the :ref:`FFTSize` enum. Property Descriptions --------------------- .. _class_AudioEffectPitchShift_property_fft_size: -- :ref:`FFT_Size` **fft_size** +- :ref:`FFTSize` **fft_size** +-----------+---------------------+ | *Default* | ``3`` | @@ -77,6 +77,8 @@ Property Descriptions | *Getter* | get_fft_size() | +-----------+---------------------+ +The size of the `Fast Fourier transform `__ buffer. Higher values smooth out the effect over time, but have greater latency. The effects of this higher latency are especially noticeable on sounds that have sudden amplitude changes. + ---- .. _class_AudioEffectPitchShift_property_oversampling: @@ -91,6 +93,8 @@ Property Descriptions | *Getter* | get_oversampling() | +-----------+-------------------------+ +The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up. + ---- .. _class_AudioEffectPitchShift_property_pitch_scale: @@ -105,5 +109,11 @@ Property Descriptions | *Getter* | get_pitch_scale() | +-----------+------------------------+ -Pitch value. Can range from 0 (-1 octave) to 16 (+16 octaves). +The pitch scale to use. ``1.0`` is the default pitch and plays sounds unaltered. :ref:`pitch_scale` can range from ``0.0`` (infinitely low pitch, inaudible) to ``16`` (16 times higher than the initial pitch). +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectrecord.rst b/classes/class_audioeffectrecord.rst index 366d6d231..72ecf9031 100644 --- a/classes/class_audioeffectrecord.rst +++ b/classes/class_audioeffectrecord.rst @@ -9,15 +9,22 @@ AudioEffectRecord ================= -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Audio effect used for recording sound from a microphone. +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. + Tutorials --------- - :doc:`../tutorials/audio/recording_with_microphone` +- `Audio Mic Record Demo `__ + Properties ---------- @@ -29,9 +36,9 @@ Methods ------- +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ -| :ref:`AudioStreamSample` | :ref:`get_recording` **(** **)** const | +| :ref:`AudioStreamSample` | :ref:`get_recording` **(** **)** |const| | +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_recording_active` **(** **)** const | +| :ref:`bool` | :ref:`is_recording_active` **(** **)** |const| | +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_recording_active` **(** :ref:`bool` record **)** | +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ @@ -58,7 +65,7 @@ Method Descriptions .. _class_AudioEffectRecord_method_get_recording: -- :ref:`AudioStreamSample` **get_recording** **(** **)** const +- :ref:`AudioStreamSample` **get_recording** **(** **)** |const| Returns the recorded sample. @@ -66,7 +73,7 @@ Returns the recorded sample. .. _class_AudioEffectRecord_method_is_recording_active: -- :ref:`bool` **is_recording_active** **(** **)** const +- :ref:`bool` **is_recording_active** **(** **)** |const| Returns whether the recording is active or not. @@ -78,3 +85,9 @@ Returns whether the recording is active or not. If ``true``, the sound will be recorded. Note that restarting the recording will remove the previously recorded sample. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectreverb.rst b/classes/class_audioeffectreverb.rst index b0ea1157a..7f6596698 100644 --- a/classes/class_audioeffectreverb.rst +++ b/classes/class_audioeffectreverb.rst @@ -9,7 +9,7 @@ AudioEffectReverb ================= -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Adds a reverberation audio effect to an Audio bus. @@ -20,6 +20,11 @@ Description Simulates rooms of different sizes. Its parameters can be adjusted to simulate the sound of a specific room. +Tutorials +--------- + +- `Third Person Shooter Demo `__ + Properties ---------- @@ -170,3 +175,9 @@ Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Val Output percent of modified sound. At 0, only original sound is outputted. Value can range from 0 to 1. +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audioeffectspectrumanalyzer.rst b/classes/class_audioeffectspectrumanalyzer.rst index 565fc7287..d39290b38 100644 --- a/classes/class_audioeffectspectrumanalyzer.rst +++ b/classes/class_audioeffectspectrumanalyzer.rst @@ -9,25 +9,39 @@ AudioEffectSpectrumAnalyzer =========================== -**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` +Audio effect that can be used for real-time audio visualizations. +Description +----------- + +This audio effect does not affect sound output, but can be used for real-time audio visualizations. + +See also :ref:`AudioStreamGenerator` for procedurally generating sounds. + +Tutorials +--------- + +- `https://godotengine.org/asset-library/asset/528