From 551ab512ca48b95eb5297aaf43d9ae571bb46336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 1 Feb 2022 16:35:13 +0100 Subject: [PATCH] classref: Sync with latest 4.0-alpha --- classes/class_@gdscript.rst | 35 +- classes/class_@globalscope.rst | 258 ++- classes/class_aabb.rst | 16 +- classes/class_acceptdialog.rst | 40 +- classes/class_aescontext.rst | 4 +- classes/class_animatedsprite2d.rst | 32 +- classes/class_animatedtexture.rst | 4 +- classes/class_animation.rst | 6 +- classes/class_animationnodeoneshot.rst | 64 +- classes/class_animationnodestatemachine.rst | 2 +- ...lass_animationnodestatemachineplayback.rst | 8 +- classes/class_animationplayer.rst | 10 +- classes/class_animationtree.rst | 2 +- classes/class_area2d.rst | 44 +- classes/class_area3d.rst | 44 +- classes/class_array.rst | 214 +- classes/class_arraymesh.rst | 82 +- classes/class_aspectratiocontainer.rst | 38 +- classes/class_astar.rst | 26 +- classes/class_astar2d.rst | 24 +- classes/class_atlastexture.rst | 2 +- classes/class_audioeffectrecord.rst | 8 +- classes/class_audioeffectspectrumanalyzer.rst | 4 +- classes/class_audiolistener3d.rst | 2 +- classes/class_audioserver.rst | 2 +- classes/class_audiostreamgenerator.rst | 4 +- .../class_audiostreamgeneratorplayback.rst | 2 +- classes/class_audiostreamplayer2d.rst | 2 +- classes/class_audiostreamplayer3d.rst | 2 +- classes/class_audiostreamsample.rst | 4 +- classes/class_backbuffercopy.rst | 2 +- classes/class_basebutton.rst | 88 +- classes/class_basematerial3d.rst | 42 +- classes/class_basis.rst | 4 +- classes/class_bitmap.rst | 22 +- classes/class_bone2d.rst | 4 +- classes/class_bool.rst | 2 +- classes/class_boxcontainer.rst | 26 +- classes/class_boxmesh.rst | 2 +- classes/class_button.rst | 317 ++- classes/class_buttongroup.rst | 10 +- classes/class_callable.rst | 2 +- classes/class_callbacktweener.rst | 2 +- classes/class_camera2d.rst | 28 +- classes/class_camera3d.rst | 8 +- classes/class_camerafeed.rst | 2 +- classes/class_cameraserver.rst | 2 +- classes/class_cameratexture.rst | 2 +- classes/class_canvasitem.rst | 240 +- classes/class_canvasitemmaterial.rst | 6 +- classes/class_characterbody2d.rst | 64 +- classes/class_characterbody3d.rst | 26 +- classes/class_charfxtransform.rst | 2 +- classes/class_checkbox.rst | 294 +-- classes/class_checkbutton.rst | 258 +-- classes/class_classdb.rst | 2 +- classes/class_codeedit.rst | 670 +++--- classes/class_codehighlighter.rst | 6 +- classes/class_collisionobject2d.rst | 6 +- classes/class_collisionobject3d.rst | 6 +- classes/class_collisionpolygon3d.rst | 2 +- classes/class_color.rst | 28 +- classes/class_colorpicker.rst | 138 +- classes/class_colorpickerbutton.rst | 156 +- classes/class_concavepolygonshape3d.rst | 2 +- classes/class_configfile.rst | 2 +- classes/class_confirmationdialog.rst | 16 +- classes/class_container.rst | 8 +- classes/class_control.rst | 90 +- classes/class_convexpolygonshape2d.rst | 2 +- classes/class_cpuparticles2d.rst | 16 + classes/class_cpuparticles3d.rst | 22 +- classes/class_crypto.rst | 6 +- classes/class_cryptokey.rst | 8 +- classes/class_csgmesh3d.rst | 4 +- classes/class_csgpolygon3d.rst | 10 +- classes/class_cubemap.rst | 2 +- classes/class_curve2d.rst | 8 +- classes/class_curve3d.rst | 8 +- classes/class_curvetexture.rst | 16 +- classes/class_curvexyztexture.rst | 20 +- classes/class_dictionary.rst | 12 +- classes/class_directionallight3d.rst | 42 +- classes/class_directory.rst | 168 +- classes/class_displayserver.rst | 166 +- classes/class_dtlsserver.rst | 2 +- classes/class_editorcommandpalette.rst | 8 +- classes/class_editorexportplugin.rst | 20 +- classes/class_editorfiledialog.rst | 44 +- classes/class_editorfilesystem.rst | 2 +- classes/class_editorimportplugin.rst | 2 +- classes/class_editorinspector.rst | 22 +- classes/class_editorinterface.rst | 168 +- classes/class_editornode3dgizmo.rst | 38 +- classes/class_editornode3dgizmoplugin.rst | 122 +- classes/class_editorpaths.rst | 12 +- classes/class_editorplugin.rst | 14 +- classes/class_editorresourcepicker.rst | 8 +- classes/class_editorresourcepreview.rst | 6 +- classes/class_editorsceneformatimporter.rst | 46 +- classes/class_editorscript.rst | 8 +- classes/class_editorscriptpicker.rst | 2 +- classes/class_editorselection.rst | 4 +- classes/class_editorsettings.rst | 6 +- classes/class_editorspinslider.rst | 22 +- .../class_editortranslationparserplugin.rst | 2 +- classes/class_enetconnection.rst | 16 +- classes/class_enetmultiplayerpeer.rst | 6 +- classes/class_enetpacketpeer.rst | 2 +- classes/class_engine.rst | 48 +- classes/class_enginedebugger.rst | 6 +- classes/class_environment.rst | 160 +- classes/class_file.rst | 34 +- classes/class_filedialog.rst | 116 +- classes/class_float.rst | 24 +- classes/class_flowcontainer.rst | 46 + classes/class_font.rst | 128 +- classes/class_fontdata.rst | 502 +++-- classes/class_gdnativelibrary.rst | 4 +- classes/class_gdscript.rst | 2 +- classes/class_geometry2d.rst | 4 +- classes/class_geometryinstance3d.rst | 40 +- classes/class_gltfdocument.rst | 57 +- classes/class_godotsharp.rst | 4 +- classes/class_gpuparticles2d.rst | 64 +- classes/class_gpuparticles3d.rst | 12 +- classes/class_gpuparticlesattractor3d.rst | 2 +- ...t => class_gpuparticlesattractorbox3d.rst} | 16 +- ...> class_gpuparticlesattractorsphere3d.rst} | 16 +- ...ss_gpuparticlesattractorvectorfield3d.rst} | 22 +- classes/class_gpuparticlescollision3d.rst | 2 +- ...t => class_gpuparticlescollisionbox3d.rst} | 16 +- ...ss_gpuparticlescollisionheightfield3d.rst} | 66 +- ...t => class_gpuparticlescollisionsdf3d.rst} | 52 +- ...> class_gpuparticlescollisionsphere3d.rst} | 16 +- classes/class_gradienttexture1d.rst | 4 +- classes/class_graphedit.rst | 351 +-- classes/class_graphnode.rst | 342 ++- classes/class_gridcontainer.rst | 2 +- classes/class_gridmap.rst | 70 +- classes/class_hashingcontext.rst | 2 +- classes/class_hflowcontainer.rst | 60 + classes/class_hmaccontext.rst | 6 +- classes/class_hscrollbar.rst | 60 +- classes/class_hslider.rst | 58 +- classes/class_hsplitcontainer.rst | 26 +- classes/class_httpclient.rst | 46 +- classes/class_httprequest.rst | 40 +- classes/class_image.rst | 110 +- classes/class_imagetexture.rst | 8 +- classes/class_importermesh.rst | 104 +- classes/class_input.rst | 76 +- classes/class_inputevent.rst | 6 +- classes/class_inputeventmidi.rst | 97 + classes/class_inputeventmouse.rst | 4 +- classes/class_inputeventmousemotion.rst | 42 +- classes/class_inputeventscreendrag.rst | 22 +- classes/class_inputeventscreentouch.rst | 2 +- classes/class_instanceplaceholder.rst | 2 +- classes/class_int.rst | 34 +- classes/class_intervaltweener.rst | 2 +- classes/class_itemlist.rst | 238 +- classes/class_javascript.rst | 8 +- classes/class_javascriptobject.rst | 2 +- classes/class_joint2d.rst | 2 + classes/class_json.rst | 56 +- classes/class_jsonrpc.rst | 2 +- classes/class_label.rst | 276 +-- classes/class_light2d.rst | 2 +- classes/class_light3d.rst | 22 +- classes/class_lightmapgi.rst | 4 +- classes/class_line2d.rst | 4 +- classes/class_lineedit.rst | 412 ++-- classes/class_linkbutton.rst | 134 +- classes/class_margincontainer.rst | 2 +- classes/class_marshalls.rst | 2 +- classes/class_material.rst | 6 +- classes/class_menubutton.rst | 200 +- classes/class_mesh.rst | 4 +- classes/class_meshdatatool.rst | 6 +- classes/class_meshinstance2d.rst | 2 +- classes/class_methodtweener.rst | 2 +- classes/class_mobilevrinterface.rst | 34 +- classes/class_multimeshinstance2d.rst | 2 +- classes/class_multiplayerapi.rst | 10 +- classes/class_multiplayerpeer.rst | 6 +- classes/class_multiplayerreplicator.rst | 14 +- classes/class_mutex.rst | 6 +- classes/class_nativescript.rst | 2 +- classes/class_navigationagent2d.rst | 2 +- classes/class_navigationmesh.rst | 12 +- classes/class_navigationregion2d.rst | 2 +- classes/class_navigationserver2d.rst | 2 +- classes/class_navigationserver3d.rst | 4 +- classes/class_ninepatchrect.rst | 46 +- classes/class_node.rst | 90 +- classes/class_node2d.rst | 2 +- classes/class_node3d.rst | 26 +- classes/class_nodepath.rst | 2 +- classes/class_noisetexture.rst | 2 +- classes/class_object.rst | 32 +- classes/class_occluderpolygon2d.rst | 2 +- classes/class_opensimplexnoise.rst | 6 +- classes/class_optionbutton.rst | 306 +-- classes/class_os.rst | 394 ++-- classes/class_packedbytearray.rst | 36 +- classes/class_packedcolorarray.rst | 96 +- classes/class_packedfloat32array.rst | 96 +- classes/class_packedfloat64array.rst | 96 +- classes/class_packedint32array.rst | 98 +- classes/class_packedint64array.rst | 98 +- classes/class_packedscene.rst | 26 +- classes/class_packedstringarray.rst | 32 +- classes/class_packedvector2array.rst | 32 +- classes/class_packedvector3array.rst | 32 +- classes/class_packetpeer.rst | 4 +- classes/class_packetpeerdtls.rst | 4 +- classes/class_packetpeerstream.rst | 2 +- classes/class_packetpeerudp.rst | 12 +- classes/class_panelcontainer.rst | 6 +- classes/class_panoramaskymaterial.rst | 24 +- classes/class_parallaxbackground.rst | 30 +- classes/class_parallaxlayer.rst | 2 +- classes/class_particlesmaterial.rst | 34 +- classes/class_path2d.rst | 2 +- classes/class_performance.rst | 12 +- classes/class_physicalbone2d.rst | 6 +- classes/class_physicalskymaterial.rst | 8 +- classes/class_physicsbody2d.rst | 46 +- classes/class_physicsbody3d.rst | 50 +- classes/class_physicsdirectbodystate2d.rst | 202 +- classes/class_physicsdirectbodystate3d.rst | 208 +- classes/class_physicsdirectspacestate2d.rst | 46 +- classes/class_physicsdirectspacestate3d.rst | 48 +- classes/class_physicsserver2d.rst | 172 +- classes/class_physicsserver3d.rst | 182 +- classes/class_physicstestmotionresult2d.rst | 20 +- classes/class_physicstestmotionresult3d.rst | 20 +- classes/class_plane.rst | 4 +- classes/class_planemesh.rst | 2 +- classes/class_polygon2d.rst | 2 +- classes/class_popup.rst | 26 +- classes/class_popupmenu.rst | 496 ++--- classes/class_primitivemesh.rst | 2 +- classes/class_progressbar.rst | 96 +- classes/class_projectsettings.rst | 692 ++++-- classes/class_propertytweener.rst | 2 +- classes/class_proximitygroup3d.rst | 116 - classes/class_quaternion.rst | 8 +- classes/class_randomnumbergenerator.rst | 10 +- classes/class_raycast2d.rst | 16 +- classes/class_raycast3d.rst | 26 +- classes/class_rdtextureview.rst | 4 +- classes/class_rdvertexattribute.rst | 4 +- classes/class_rect2.rst | 10 +- classes/class_rect2i.rst | 6 +- classes/class_refcounted.rst | 2 +- classes/class_referencerect.rst | 2 +- classes/class_reflectionprobe.rst | 72 +- classes/class_regex.rst | 6 +- classes/class_renderingdevice.rst | 74 +- classes/class_renderingserver.rst | 1944 +++++++++-------- classes/class_resource.rst | 10 +- classes/class_resourceformatloader.rst | 8 +- classes/class_richtexteffect.rst | 4 +- classes/class_richtextlabel.rst | 506 +++-- classes/class_rigiddynamicbody2d.rst | 218 +- classes/class_rigiddynamicbody3d.rst | 190 +- classes/class_rootmotionview.rst | 2 +- classes/class_scenestate.rst | 16 +- classes/class_scenetree.rst | 14 +- classes/class_scenetreetimer.rst | 4 +- classes/class_script.rst | 2 + classes/class_scriptcreatedialog.rst | 10 +- classes/class_scripteditor.rst | 4 +- classes/class_scrollbar.rst | 14 +- classes/class_scrollcontainer.rst | 165 +- classes/class_shader.rst | 10 +- classes/class_shadermaterial.rst | 2 +- classes/class_shape2d.rst | 4 +- classes/class_shape3d.rst | 26 +- classes/class_shapecast2d.rst | 18 +- classes/class_skeleton2d.rst | 4 +- classes/class_skeleton3d.rst | 14 +- classes/class_skeletonmodification2d.rst | 2 +- classes/class_skeletonmodification2dccdik.rst | 2 +- .../class_skeletonmodification2dfabrik.rst | 4 +- .../class_skeletonmodification2djiggle.rst | 2 +- ...ss_skeletonmodification2dphysicalbones.rst | 2 +- ...lass_skeletonmodification2dstackholder.rst | 2 +- classes/class_skeletonmodification3d.rst | 2 +- classes/class_skeletonmodification3dccdik.rst | 4 +- .../class_skeletonmodification3dfabrik.rst | 12 +- .../class_skeletonmodification3djiggle.rst | 6 +- ...lass_skeletonmodification3dstackholder.rst | 2 +- .../class_skeletonmodification3dtwoboneik.rst | 4 +- classes/class_skeletonmodificationstack2d.rst | 2 +- classes/class_skeletonmodificationstack3d.rst | 4 +- classes/class_skin.rst | 50 +- classes/class_sky.rst | 4 +- classes/class_slider.rst | 45 +- classes/class_softdynamicbody3d.rst | 6 +- classes/class_spheremesh.rst | 2 +- classes/class_spinbox.rst | 52 +- classes/class_spotlight3d.rst | 22 +- classes/class_sprite2d.rst | 2 +- classes/class_sprite3d.rst | 8 + classes/class_spritebase3d.rst | 22 +- classes/class_spriteframes.rst | 6 +- classes/class_staticbody2d.rst | 4 +- classes/class_staticbody3d.rst | 4 +- classes/class_streampeer.rst | 10 +- classes/class_streampeerssl.rst | 4 +- classes/class_streampeertcp.rst | 4 +- classes/class_string.rst | 63 +- classes/class_stylebox.rst | 4 +- classes/class_styleboxflat.rst | 2 +- classes/class_subviewport.rst | 2 +- classes/class_subviewportcontainer.rst | 4 +- classes/class_surfacetool.rst | 8 +- classes/class_syntaxhighlighter.rst | 6 +- classes/class_tabbar.rst | 394 ++-- classes/class_tabcontainer.rst | 272 +-- classes/class_tcpserver.rst | 2 +- classes/class_textedit.rst | 498 +++-- classes/class_textline.rst | 134 +- classes/class_textparagraph.rst | 208 +- classes/class_textserver.rst | 144 +- classes/class_textserverextension.rst | 118 +- classes/class_textservermanager.rst | 2 +- classes/class_texture2d.rst | 4 +- classes/class_texturebutton.rst | 2 +- classes/class_textureprogressbar.rst | 70 +- classes/class_texturerect.rst | 76 +- classes/class_theme.rst | 4 +- classes/class_thread.rst | 4 +- classes/class_tilemap.rst | 26 +- classes/class_tileset.rst | 4 +- classes/class_tilesetatlassource.rst | 6 +- .../class_tilesetscenescollectionsource.rst | 6 +- classes/class_time.rst | 6 +- classes/class_timer.rst | 10 +- classes/class_touchscreenbutton.rst | 66 +- classes/class_transform2d.rst | 20 +- classes/class_transform3d.rst | 76 +- classes/class_translationserver.rst | 132 +- classes/class_tree.rst | 806 +++---- classes/class_treeitem.rst | 396 ++-- classes/class_tween.rst | 64 +- classes/class_undoredo.rst | 4 +- classes/class_upnp.rst | 2 +- classes/class_variant.rst | 2 +- classes/class_vector2.rst | 86 +- classes/class_vector2i.rst | 52 +- classes/class_vector3.rst | 90 +- classes/class_vector3i.rst | 46 +- classes/class_vehiclebody3d.rst | 24 +- classes/class_vehiclewheel3d.rst | 30 +- classes/class_vflowcontainer.rst | 60 + classes/class_videostream.rst | 2 +- ...player.rst => class_videostreamplayer.rst} | 114 +- classes/class_videostreamtheora.rst | 2 +- classes/class_viewport.rst | 176 +- classes/class_viewporttexture.rst | 10 +- classes/class_visibleonscreenenabler3d.rst | 4 +- classes/class_visibleonscreennotifier2d.rst | 2 +- classes/class_visibleonscreennotifier3d.rst | 4 +- classes/class_visualscript.rst | 2 +- classes/class_visualscriptbuiltinfunc.rst | 78 +- classes/class_visualscriptclassconstant.rst | 4 +- classes/class_visualscriptcondition.rst | 12 +- classes/class_visualscriptconstant.rst | 4 +- classes/class_visualscriptcustomnode.rst | 38 +- classes/class_visualscriptemitsignal.rst | 6 +- classes/class_visualscriptiterator.rst | 12 +- classes/class_visualscriptlocalvar.rst | 4 +- classes/class_visualscriptlocalvarset.rst | 6 +- classes/class_visualscriptmathconstant.rst | 4 +- classes/class_visualscriptoperator.rst | 8 +- classes/class_visualscriptpreload.rst | 4 +- classes/class_visualscriptreturn.rst | 4 +- classes/class_visualscriptscenenode.rst | 4 +- classes/class_visualscriptselect.rst | 10 +- classes/class_visualscriptself.rst | 4 +- classes/class_visualscriptsequence.rst | 8 +- classes/class_visualscriptswitch.rst | 10 +- classes/class_visualscriptvariableget.rst | 4 +- classes/class_visualscriptvariableset.rst | 6 +- classes/class_visualscriptwhile.rst | 10 +- classes/class_visualshader.rst | 2 +- classes/class_visualshadernode.rst | 2 +- classes/class_visualshadernodecustom.rst | 56 +- .../class_visualshadernodederivativefunc.rst | 109 + classes/class_visualshadernodeintfunc.rst | 6 +- classes/class_visualshadernodeintop.rst | 22 +- ...s_visualshadernodescalarderivativefunc.rst | 73 - .../class_visualshadernodetextureuniform.rst | 110 +- ...s_visualshadernodevectorderivativefunc.rst | 73 - classes/class_voxelgi.rst | 10 +- classes/class_voxelgidata.rst | 29 +- classes/class_vscrollbar.rst | 70 +- classes/class_vslider.rst | 68 +- classes/class_vsplitcontainer.rst | 26 +- classes/class_webrtcmultiplayerpeer.rst | 6 +- classes/class_webrtcpeerconnection.rst | 14 +- classes/class_websocketclient.rst | 16 +- classes/class_websocketmultiplayerpeer.rst | 6 +- classes/class_websocketpeer.rst | 10 +- classes/class_websocketserver.rst | 6 +- classes/class_webxrinterface.rst | 12 +- classes/class_window.rst | 172 +- classes/class_x509certificate.rst | 2 +- classes/class_xrinterface.rst | 6 +- classes/class_xrinterfaceextension.rst | 86 +- classes/class_xrnode3d.rst | 2 +- classes/class_xrorigin3d.rst | 2 +- classes/class_xrpose.rst | 59 +- classes/class_xrpositionaltracker.rst | 30 +- classes/class_xrserver.rst | 30 - 419 files changed, 12867 insertions(+), 9872 deletions(-) create mode 100644 classes/class_flowcontainer.rst rename classes/{class_gpuparticlesattractorbox.rst => class_gpuparticlesattractorbox3d.rst} (80%) rename classes/{class_gpuparticlesattractorsphere.rst => class_gpuparticlesattractorsphere3d.rst} (81%) rename classes/{class_gpuparticlesattractorvectorfield.rst => class_gpuparticlesattractorvectorfield3d.rst} (76%) rename classes/{class_gpuparticlescollisionbox.rst => class_gpuparticlescollisionbox3d.rst} (80%) rename classes/{class_gpuparticlescollisionheightfield.rst => class_gpuparticlescollisionheightfield3d.rst} (55%) rename classes/{class_gpuparticlescollisionsdf.rst => class_gpuparticlescollisionsdf3d.rst} (51%) rename classes/{class_gpuparticlescollisionsphere.rst => class_gpuparticlescollisionsphere3d.rst} (81%) create mode 100644 classes/class_hflowcontainer.rst delete mode 100644 classes/class_proximitygroup3d.rst create mode 100644 classes/class_vflowcontainer.rst rename classes/{class_videoplayer.rst => class_videostreamplayer.rst} (66%) create mode 100644 classes/class_visualshadernodederivativefunc.rst delete mode 100644 classes/class_visualshadernodescalarderivativefunc.rst delete mode 100644 classes/class_visualshadernodevectorderivativefunc.rst diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index 9751c18dc..741629bf2 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -14,12 +14,9 @@ Built-in GDScript functions. 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.) +A list of GDScript-specific utility functions accessed in any script. -Tutorials ---------- - -- :doc:`Random number generation <../tutorials/math/random_number_generation>` +For the list of the global functions and constants see :ref:`@GlobalScope`. Methods ------- @@ -73,11 +70,11 @@ Constants - **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``). -**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. +\ **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. - **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. +\ **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 ------------------- @@ -88,13 +85,13 @@ Method Descriptions Returns a color constructed from integer red, green, blue, and alpha channels. Each channel should have 8 bits of information ranging from 0 to 255. -``r8`` red channel +\ ``r8`` red channel -``g8`` green channel +\ ``g8`` green channel -``b8`` blue channel +\ ``b8`` blue channel -``a8`` alpha channel +\ ``a8`` alpha channel :: @@ -108,7 +105,7 @@ Returns a color constructed from integer red, green, blue, and alpha channels. E 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. +\ **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. @@ -185,7 +182,7 @@ would print [{function:bar, line:12, source:res://script.gd}, {function:foo, line:9, source:res://script.gd}, {function:_ready, line:6, source:res://script.gd}] -**Note:** Not supported for calling from threads. Instead, this will return an empty array. +\ **Note:** Not supported for calling from threads. Instead, this will return an empty array. ---- @@ -218,7 +215,7 @@ Prints out: Returns length of Variant ``var``. Length is the character count of String, element count of Array, size of Dictionary, etc. -**Note:** Generates a fatal error if Variant can not provide a length. +\ **Note:** Generates a fatal error if Variant can not provide a length. :: @@ -233,14 +230,14 @@ Returns length of Variant ``var``. Length is the character count of String, elem 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" or by dragging the file from the FileSystem dock into the script. +\ **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 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``. +\ **Important:** The path must be absolute, a local path will just return ``null``. This method is a simplified version of :ref:`ResourceLoader.load`, which can be used for more advanced scenarios. @@ -252,7 +249,7 @@ This method is a simplified version of :ref:`ResourceLoader.load` 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" or by dragging the file from the FileSystem dock into the script. +\ **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. :: @@ -274,7 +271,7 @@ Output in the console would look something like this: Test print At: res://test.gd:15:_process() -**Note:** Not supported for calling from threads. Instead of the stack frame, this will print the thread ID. +\ **Note:** Not supported for calling from threads. Instead of the stack frame, this will print the thread ID. ---- @@ -290,7 +287,7 @@ Output in the console would look something like this: Frame 0 - res://test.gd:16 in function '_process' -**Note:** Not supported for calling from threads. Instead of the stack trace, this will print the thread ID. +\ **Note:** Not supported for calling from threads. Instead of the stack trace, this will print the thread ID. ---- diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index 1f295bcbf..6376f0082 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -9,15 +9,22 @@ @GlobalScope ============ -Global scope constants and variables. +Global scope constants and functions. Description ----------- -Global scope constants and variables. This is all that resides in the globals, constants regarding error codes, keycodes, property hints, etc. +A list of global scope enumerated constants and built-in functions. This is all that resides in the globals, constants regarding error codes, keycodes, property hints, etc. Singletons are also documented here, since they can be accessed from anywhere. +For the entries related to GDScript which can be accessed in any script see :ref:`@GDScript`. + +Tutorials +--------- + +- :doc:`Random number generation <../tutorials/math/random_number_generation>` + Properties ---------- @@ -347,89 +354,93 @@ enum **ClockDirection**: ---- -.. _enum_@GlobalScope_HAlign: +.. _enum_@GlobalScope_HorizontalAlignment: -.. _class_@GlobalScope_constant_HALIGN_LEFT: +.. _class_@GlobalScope_constant_HORIZONTAL_ALIGNMENT_LEFT: -.. _class_@GlobalScope_constant_HALIGN_CENTER: +.. _class_@GlobalScope_constant_HORIZONTAL_ALIGNMENT_CENTER: -.. _class_@GlobalScope_constant_HALIGN_RIGHT: +.. _class_@GlobalScope_constant_HORIZONTAL_ALIGNMENT_RIGHT: -.. _class_@GlobalScope_constant_HALIGN_FILL: +.. _class_@GlobalScope_constant_HORIZONTAL_ALIGNMENT_FILL: -enum **HAlign**: +enum **HorizontalAlignment**: -- **HALIGN_LEFT** = **0** --- Horizontal left alignment, usually for text-derived classes. +- **HORIZONTAL_ALIGNMENT_LEFT** = **0** --- Horizontal left alignment, usually for text-derived classes. -- **HALIGN_CENTER** = **1** --- Horizontal center alignment, usually for text-derived classes. +- **HORIZONTAL_ALIGNMENT_CENTER** = **1** --- Horizontal center alignment, usually for text-derived classes. -- **HALIGN_RIGHT** = **2** --- Horizontal right alignment, usually for text-derived classes. +- **HORIZONTAL_ALIGNMENT_RIGHT** = **2** --- Horizontal right alignment, usually for text-derived classes. -- **HALIGN_FILL** = **3** --- Expand row to fit width, usually for text-derived classes. +- **HORIZONTAL_ALIGNMENT_FILL** = **3** --- Expand row to fit width, usually for text-derived classes. ---- -.. _enum_@GlobalScope_VAlign: +.. _enum_@GlobalScope_VerticalAlignment: -.. _class_@GlobalScope_constant_VALIGN_TOP: +.. _class_@GlobalScope_constant_VERTICAL_ALIGNMENT_TOP: -.. _class_@GlobalScope_constant_VALIGN_CENTER: +.. _class_@GlobalScope_constant_VERTICAL_ALIGNMENT_CENTER: -.. _class_@GlobalScope_constant_VALIGN_BOTTOM: +.. _class_@GlobalScope_constant_VERTICAL_ALIGNMENT_BOTTOM: -enum **VAlign**: +.. _class_@GlobalScope_constant_VERTICAL_ALIGNMENT_FILL: -- **VALIGN_TOP** = **0** --- Vertical top alignment, usually for text-derived classes. +enum **VerticalAlignment**: -- **VALIGN_CENTER** = **1** --- Vertical center alignment, usually for text-derived classes. +- **VERTICAL_ALIGNMENT_TOP** = **0** --- Vertical top alignment, usually for text-derived classes. -- **VALIGN_BOTTOM** = **2** --- Vertical bottom alignment, usually for text-derived classes. +- **VERTICAL_ALIGNMENT_CENTER** = **1** --- Vertical center alignment, usually for text-derived classes. + +- **VERTICAL_ALIGNMENT_BOTTOM** = **2** --- Vertical bottom alignment, usually for text-derived classes. + +- **VERTICAL_ALIGNMENT_FILL** = **3** --- Expand rows to fit height, usually for text-derived classes. ---- -.. _enum_@GlobalScope_InlineAlign: +.. _enum_@GlobalScope_InlineAlignment: -.. _class_@GlobalScope_constant_INLINE_ALIGN_TOP_TO: +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TOP_TO: -.. _class_@GlobalScope_constant_INLINE_ALIGN_CENTER_TO: +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_CENTER_TO: -.. _class_@GlobalScope_constant_INLINE_ALIGN_BOTTOM_TO: +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_BOTTOM_TO: -.. _class_@GlobalScope_constant_INLINE_ALIGN_TO_TOP: +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TO_TOP: -.. _class_@GlobalScope_constant_INLINE_ALIGN_TO_CENTER: +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TO_CENTER: -.. _class_@GlobalScope_constant_INLINE_ALIGN_TO_BASELINE: +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TO_BASELINE: -.. _class_@GlobalScope_constant_INLINE_ALIGN_TO_BOTTOM: +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TO_BOTTOM: -.. _class_@GlobalScope_constant_INLINE_ALIGN_TOP: +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TOP: -.. _class_@GlobalScope_constant_INLINE_ALIGN_CENTER: +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_CENTER: -.. _class_@GlobalScope_constant_INLINE_ALIGN_BOTTOM: +.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_BOTTOM: -enum **InlineAlign**: +enum **InlineAlignment**: -- **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_ALIGNMENT_TOP_TO** = **0** --- Aligns the top of the inline object (e.g. image, table) to the position of the text specified by ``INLINE_ALIGNMENT_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_ALIGNMENT_CENTER_TO** = **1** --- Aligns the center of the inline object (e.g. image, table) to the position of the text specified by ``INLINE_ALIGNMENT_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_ALIGNMENT_BOTTOM_TO** = **2** --- Aligns the bottom of the inline object (e.g. image, table) to the position of the text specified by ``INLINE_ALIGNMENT_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_ALIGNMENT_TO_TOP** = **0** --- Aligns the position of the inline object (e.g. image, table) specified by ``INLINE_ALIGNMENT_*_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_ALIGNMENT_TO_CENTER** = **4** --- Aligns the position of the inline object (e.g. image, table) specified by ``INLINE_ALIGNMENT_*_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_ALIGNMENT_TO_BASELINE** = **8** --- Aligns the position of the inline object (e.g. image, table) specified by ``INLINE_ALIGNMENT_*_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_ALIGNMENT_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_ALIGNMENT_TOP** = **0** --- Aligns top of the inline object (e.g. image, table) to the top of the text. Equivalent to ``INLINE_ALIGNMENT_TOP_TO | INLINE_ALIGNMENT_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_ALIGNMENT_CENTER** = **5** --- Aligns center of the inline object (e.g. image, table) to the center of the text. Equivalent to ``INLINE_ALIGNMENT_CENTER_TO | INLINE_ALIGNMENT_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``. +- **INLINE_ALIGNMENT_BOTTOM** = **14** --- Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equivalent to ``INLINE_ALIGNMENT_BOTTOM_TO | INLINE_ALIGNMENT_TO_BOTTOM``. ---- @@ -1613,7 +1624,13 @@ enum **JoyButton**: - **JOY_BUTTON_SDL_MAX** = **21** --- The number of SDL game controller buttons. -- **JOY_BUTTON_MAX** = **36** --- The maximum number of game controller buttons: Android supports up to 36 buttons. +- **JOY_BUTTON_MAX** = **128** --- The maximum number of game controller buttons supported by the engine. The actual limit may be lower on specific platforms: + +- Android: Up to 36 buttons. + +- Linux: Up to 80 buttons. + +- Windows and macOS: Up to 128 buttons. ---- @@ -1675,21 +1692,65 @@ enum **JoyAxis**: .. _class_@GlobalScope_constant_MIDI_MESSAGE_PITCH_BEND: +.. _class_@GlobalScope_constant_MIDI_MESSAGE_SYSTEM_EXCLUSIVE: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_QUARTER_FRAME: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_SONG_POSITION_POINTER: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_SONG_SELECT: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_TUNE_REQUEST: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_TIMING_CLOCK: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_START: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_CONTINUE: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_STOP: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_ACTIVE_SENSING: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_SYSTEM_RESET: + enum **MIDIMessage**: -- **MIDI_MESSAGE_NOTE_OFF** = **8** --- MIDI note OFF message. +- **MIDI_MESSAGE_NOTE_OFF** = **8** --- MIDI note OFF message. See the documentation of :ref:`InputEventMIDI` for information of how to use MIDI inputs. -- **MIDI_MESSAGE_NOTE_ON** = **9** --- MIDI note ON message. +- **MIDI_MESSAGE_NOTE_ON** = **9** --- MIDI note ON message. See the documentation of :ref:`InputEventMIDI` for information of how to use MIDI inputs. -- **MIDI_MESSAGE_AFTERTOUCH** = **10** --- MIDI aftertouch message. +- **MIDI_MESSAGE_AFTERTOUCH** = **10** --- MIDI aftertouch message. This message is most often sent by pressing down on the key after it "bottoms out". -- **MIDI_MESSAGE_CONTROL_CHANGE** = **11** --- MIDI control change message. +- **MIDI_MESSAGE_CONTROL_CHANGE** = **11** --- MIDI control change message. This message is sent when a controller value changes. Controllers include devices such as pedals and levers. -- **MIDI_MESSAGE_PROGRAM_CHANGE** = **12** --- MIDI program change message. +- **MIDI_MESSAGE_PROGRAM_CHANGE** = **12** --- MIDI program change message. This message sent when the program patch number changes. -- **MIDI_MESSAGE_CHANNEL_PRESSURE** = **13** --- MIDI channel pressure message. +- **MIDI_MESSAGE_CHANNEL_PRESSURE** = **13** --- MIDI channel pressure message. This message is most often sent by pressing down on the key after it "bottoms out". This message is different from polyphonic after-touch as it indicates the highest pressure across all keys. -- **MIDI_MESSAGE_PITCH_BEND** = **14** --- MIDI pitch bend message. +- **MIDI_MESSAGE_PITCH_BEND** = **14** --- MIDI pitch bend message. This message is sent to indicate a change in the pitch bender (wheel or lever, typically). + +- **MIDI_MESSAGE_SYSTEM_EXCLUSIVE** = **240** --- MIDI system exclusive message. This has behavior exclusive to the device you're receiving input from. Getting this data is not implemented in Godot. + +- **MIDI_MESSAGE_QUARTER_FRAME** = **241** --- MIDI quarter frame message. Contains timing information that is used to synchronize MIDI devices. Getting this data is not implemented in Godot. + +- **MIDI_MESSAGE_SONG_POSITION_POINTER** = **242** --- MIDI song position pointer message. Gives the number of 16th notes since the start of the song. Getting this data is not implemented in Godot. + +- **MIDI_MESSAGE_SONG_SELECT** = **243** --- MIDI song select message. Specifies which sequence or song is to be played. Getting this data is not implemented in Godot. + +- **MIDI_MESSAGE_TUNE_REQUEST** = **246** --- MIDI tune request message. Upon receiving a tune request, all analog synthesizers should tune their oscillators. + +- **MIDI_MESSAGE_TIMING_CLOCK** = **248** --- MIDI timing clock message. Sent 24 times per quarter note when synchronization is required. + +- **MIDI_MESSAGE_START** = **250** --- MIDI start message. Start the current sequence playing. This message will be followed with Timing Clocks. + +- **MIDI_MESSAGE_CONTINUE** = **251** --- MIDI continue message. Continue at the point the sequence was stopped. + +- **MIDI_MESSAGE_STOP** = **252** --- MIDI stop message. Stop the current sequence. + +- **MIDI_MESSAGE_ACTIVE_SENSING** = **254** --- MIDI active sensing message. This message is intended to be sent repeatedly to tell the receiver that a connection is alive. + +- **MIDI_MESSAGE_SYSTEM_RESET** = **255** --- MIDI system reset message. Reset all receivers in the system to power-up status. It should not be sent on power-up itself. ---- @@ -1990,6 +2051,8 @@ Since :ref:`OK` has value 0, and all other failu .. _class_@GlobalScope_constant_PROPERTY_HINT_ARRAY_TYPE: +.. _class_@GlobalScope_constant_PROPERTY_HINT_LOCALE_ID: + .. _class_@GlobalScope_constant_PROPERTY_HINT_MAX: enum **PropertyHint**: @@ -2057,7 +2120,7 @@ Unlike :ref:`PROPERTY_HINT_ENUM` 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. +\ **Note:** The final colon is required to specify for properly detecting built-in types. - **PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE** = **26** @@ -2089,7 +2152,9 @@ Unlike :ref:`PROPERTY_HINT_ENUM` - **PROPERTY_HINT_ARRAY_TYPE** = **39** -- **PROPERTY_HINT_MAX** = **41** +- **PROPERTY_HINT_LOCALE_ID** = **41** --- Hints that a string property is a locale code. Editing it will show a locale dialog for picking language and country. + +- **PROPERTY_HINT_MAX** = **42** ---- @@ -2367,23 +2432,23 @@ enum **TransferMode**: .. _class_@GlobalScope_constant_TYPE_ARRAY: -.. _class_@GlobalScope_constant_TYPE_RAW_ARRAY: +.. _class_@GlobalScope_constant_TYPE_PACKED_BYTE_ARRAY: -.. _class_@GlobalScope_constant_TYPE_INT32_ARRAY: +.. _class_@GlobalScope_constant_TYPE_PACKED_INT32_ARRAY: -.. _class_@GlobalScope_constant_TYPE_INT64_ARRAY: +.. _class_@GlobalScope_constant_TYPE_PACKED_INT64_ARRAY: -.. _class_@GlobalScope_constant_TYPE_FLOAT32_ARRAY: +.. _class_@GlobalScope_constant_TYPE_PACKED_FLOAT32_ARRAY: -.. _class_@GlobalScope_constant_TYPE_FLOAT64_ARRAY: +.. _class_@GlobalScope_constant_TYPE_PACKED_FLOAT64_ARRAY: -.. _class_@GlobalScope_constant_TYPE_STRING_ARRAY: +.. _class_@GlobalScope_constant_TYPE_PACKED_STRING_ARRAY: -.. _class_@GlobalScope_constant_TYPE_VECTOR2_ARRAY: +.. _class_@GlobalScope_constant_TYPE_PACKED_VECTOR2_ARRAY: -.. _class_@GlobalScope_constant_TYPE_VECTOR3_ARRAY: +.. _class_@GlobalScope_constant_TYPE_PACKED_VECTOR3_ARRAY: -.. _class_@GlobalScope_constant_TYPE_COLOR_ARRAY: +.. _class_@GlobalScope_constant_TYPE_PACKED_COLOR_ARRAY: .. _class_@GlobalScope_constant_TYPE_MAX: @@ -2441,23 +2506,23 @@ enum **Variant.Type**: - **TYPE_ARRAY** = **25** --- Variable is of type :ref:`Array`. -- **TYPE_RAW_ARRAY** = **26** --- Variable is of type :ref:`PackedByteArray`. +- **TYPE_PACKED_BYTE_ARRAY** = **26** --- Variable is of type :ref:`PackedByteArray`. -- **TYPE_INT32_ARRAY** = **27** --- Variable is of type :ref:`PackedInt32Array`. +- **TYPE_PACKED_INT32_ARRAY** = **27** --- Variable is of type :ref:`PackedInt32Array`. -- **TYPE_INT64_ARRAY** = **28** --- Variable is of type :ref:`PackedInt64Array`. +- **TYPE_PACKED_INT64_ARRAY** = **28** --- Variable is of type :ref:`PackedInt64Array`. -- **TYPE_FLOAT32_ARRAY** = **29** --- Variable is of type :ref:`PackedFloat32Array`. +- **TYPE_PACKED_FLOAT32_ARRAY** = **29** --- Variable is of type :ref:`PackedFloat32Array`. -- **TYPE_FLOAT64_ARRAY** = **30** --- Variable is of type :ref:`PackedFloat64Array`. +- **TYPE_PACKED_FLOAT64_ARRAY** = **30** --- Variable is of type :ref:`PackedFloat64Array`. -- **TYPE_STRING_ARRAY** = **31** --- Variable is of type :ref:`PackedStringArray`. +- **TYPE_PACKED_STRING_ARRAY** = **31** --- Variable is of type :ref:`PackedStringArray`. -- **TYPE_VECTOR2_ARRAY** = **32** --- Variable is of type :ref:`PackedVector2Array`. +- **TYPE_PACKED_VECTOR2_ARRAY** = **32** --- Variable is of type :ref:`PackedVector2Array`. -- **TYPE_VECTOR3_ARRAY** = **33** --- Variable is of type :ref:`PackedVector3Array`. +- **TYPE_PACKED_VECTOR3_ARRAY** = **33** --- Variable is of type :ref:`PackedVector3Array`. -- **TYPE_COLOR_ARRAY** = **34** --- Variable is of type :ref:`PackedColorArray`. +- **TYPE_PACKED_COLOR_ARRAY** = **34** --- Variable is of type :ref:`PackedColorArray`. - **TYPE_MAX** = **35** --- Represents the size of the :ref:`Variant.Type` enum. @@ -2672,7 +2737,7 @@ The :ref:`InputMap` singleton. The :ref:`JavaClassWrapper` singleton. -**Note:** Only implemented on Android. +\ **Note:** Only implemented on Android. ---- @@ -2682,7 +2747,7 @@ The :ref:`JavaClassWrapper` singleton. The :ref:`JavaScript` singleton. -**Note:** Only implemented on HTML5. +\ **Note:** Only implemented on HTML5. ---- @@ -2951,7 +3016,7 @@ Important note: The Y coordinate comes first, by convention. Decodes a byte array back to a :ref:`Variant` value, without decoding objects. -**Note:** If you need object deserialization, see :ref:`bytes2var_with_objects`. +\ **Note:** If you need object deserialization, see :ref:`bytes2var_with_objects`. ---- @@ -2961,7 +3026,7 @@ Decodes a byte array back to a :ref:`Variant` value, without deco 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). +\ **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). ---- @@ -3104,11 +3169,11 @@ Returns an "eased" value of ``x`` based on an easing function defined with ``cur - 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 + - Between 0.0 to 1.0 (exclusive): Ease out - 1.0: Linear - - Greater than 1.0 (exclusive): Ease out + - Greater than 1.0 (exclusive): Ease in -`ease() curve values cheatsheet `__ +\ `ease() curve values cheatsheet `__\ See also :ref:`smoothstep`. If you need to perform more advanced transitions, use :ref:`Tween` or :ref:`AnimationPlayer`. @@ -3128,7 +3193,7 @@ Returns a human-readable name for the given error code. 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)``. +\ **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`. @@ -3153,7 +3218,7 @@ Rounds ``x`` downward (towards negative infinity), returning the largest whole n 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. +\ **Note:** This method returns a float. If you need an integer, you can use ``int(x)`` directly. ---- @@ -3230,16 +3295,19 @@ Returns the Object that corresponds to ``instance_id``. All Objects have a uniqu - :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`. +Returns an interpolation or extrapolation factor considering the range specified in ``from`` and ``to``, and the interpolated value specified in ``weight``. The returned value will be between ``0.0`` and ``1.0`` if ``weight`` is between ``from`` and ``to`` (inclusive). If ``weight`` is located outside this range, then an extrapolation factor will be returned (return value lower than ``0.0`` or greater than ``1.0``). :: + # The interpolation ratio in the `lerp()` call below is 0.75. 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. +See also :ref:`lerp` which performs the reverse of this operation. + ---- .. _class_@GlobalScope_method_is_equal_approx: @@ -3300,12 +3368,14 @@ This method is faster than using :ref:`is_equal_approx` **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`. +Linearly interpolates between two values by the factor defined in ``weight``. To perform interpolation, ``weight`` should be between ``0.0`` and ``1.0`` (inclusive). However, values outside this range are allowed and can be used to perform *extrapolation*. :: lerp(0, 4, 0.75) # Returns 3.0 +See also :ref:`inverse_lerp` which performs the reverse of this operation. To perform eased interpolation with :ref:`lerp`, combine it with :ref:`ease` or :ref:`smoothstep`. + ---- .. _class_@GlobalScope_method_lerp_angle: @@ -3314,7 +3384,7 @@ Linearly interpolates between two values by a normalized value. This is the oppo 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`. +Similar to :ref:`lerp`, but interpolates correctly when the angles wrap around :ref:`@GDScript.TAU`. To perform eased interpolation with :ref:`lerp_angle`, combine it with :ref:`ease` or :ref:`smoothstep`. :: @@ -3349,13 +3419,13 @@ Converts from linear energy to decibels (audio). This can be used to implement v 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. +\ **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``. +\ **Note:** The logarithm of ``0`` returns ``-inf``, while negative values return ``-nan``. ---- @@ -3468,7 +3538,7 @@ In other words, returns the smallest value ``a`` where ``a = pow(2, n)`` such th 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). +\ **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). ---- @@ -3541,7 +3611,7 @@ Converts one or more arguments of any type to string in the best way possible an 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. +\ **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. ---- @@ -3577,7 +3647,7 @@ Prints one or more arguments to strings in the best way possible to console. No 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`. +\ **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`. ---- @@ -3615,7 +3685,7 @@ 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. +\ **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. ---- @@ -3717,7 +3787,7 @@ Returns a random signed 32-bit integer between ``from`` and ``to`` (inclusive). 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. +\ **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. ---- @@ -3871,7 +3941,7 @@ This S-shaped curve is the cubic Hermite interpolator, given by ``f(y) = 3*y^2 - 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 `__ +\ `Comparison between smoothstep() and ease(x, -1.6521) return values `__ ---- @@ -3900,7 +3970,7 @@ 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#. +\ **Note:** Negative values of ``x`` return NaN. If you need negative inputs, use ``System.Numerics.Complex`` in C#. ---- @@ -3992,7 +4062,7 @@ Returns the internal type of the given Variant object, using the :ref:`Variant.T 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`. +\ **Note:** If you need object serialization, see :ref:`var2bytes_with_objects`. ---- @@ -4059,9 +4129,9 @@ Usable for creating loop-alike behavior or infinite surfaces. # 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. +\ **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. +\ ``wrapf`` is more flexible than using the :ref:`fposmod` approach by giving the user control over the minimum value. ---- diff --git a/classes/class_aabb.rst b/classes/class_aabb.rst index 9993b31b2..d81614377 100644 --- a/classes/class_aabb.rst +++ b/classes/class_aabb.rst @@ -18,7 +18,9 @@ Description 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. +Negative values for :ref:`size` are not supported and will not work for most methods. Use :ref:`abs` to get an AABB with a positive size. + +\ **Note:** Unlike :ref:`Rect2`, ``AABB`` does not have a variant that uses integer coordinates. Tutorials --------- @@ -204,7 +206,7 @@ Returns ``true`` if this ``AABB`` completely encloses another one. Returns a copy of this ``AABB`` expanded to include a given point. -**Example:** +\ **Example:**\ .. tabs:: @@ -335,7 +337,9 @@ Returns ``true`` if the ``AABB`` is flat or empty. - :ref:`bool` **has_point** **(** :ref:`Vector3` point **)** |const| -Returns ``true`` if the ``AABB`` contains a point. +Returns ``true`` if the ``AABB`` contains a point. Points on the faces of the AABB are considered included, though float-point precision errors may impact the accuracy of such checks. + +\ **Note:** This method is not reliable for ``AABB`` with a *negative size*. Use :ref:`abs` to get a positive sized equivalent ``AABB`` to check for contained points. ---- @@ -343,7 +347,7 @@ Returns ``true`` if the ``AABB`` contains a point. - :ref:`AABB` **intersection** **(** :ref:`AABB` with **)** |const| -Returns the intersection between two ``AABB``. An empty AABB (size 0,0,0) is returned on failure. +Returns the intersection between two ``AABB``. An empty AABB (size ``(0, 0, 0)``) is returned on failure. ---- @@ -404,7 +408,7 @@ Operator Descriptions Returns ``true`` if the vectors are not equal. -**Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. +\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. ---- @@ -426,7 +430,7 @@ Inversely transforms (multiplies) the ``AABB`` by the given :ref:`Transform3D` instead, which is more reliable. +\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. .. |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.)` diff --git a/classes/class_acceptdialog.rst b/classes/class_acceptdialog.rst index cd7dbac09..69df7f3ff 100644 --- a/classes/class_acceptdialog.rst +++ b/classes/class_acceptdialog.rst @@ -23,23 +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:`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)* | -+-----------------------------+-------------------------------------------------------------------------+----------------------------------+ ++-----------------------------+-------------------------------------------------------------------------+-------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`dialog_autowrap` | ``false`` | ++-----------------------------+-------------------------------------------------------------------------+-------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`dialog_hide_on_ok` | ``true`` | ++-----------------------------+-------------------------------------------------------------------------+-------------------------------------------------------------------------+ +| :ref:`String` | :ref:`dialog_text` | ``""`` | ++-----------------------------+-------------------------------------------------------------------------+-------------------------------------------------------------------------+ +| :ref:`bool` | exclusive | ``true`` (overrides :ref:`Window`) | ++-----------------------------+-------------------------------------------------------------------------+-------------------------------------------------------------------------+ +| :ref:`String` | title | ``"Alert!"`` (overrides :ref:`Window`) | ++-----------------------------+-------------------------------------------------------------------------+-------------------------------------------------------------------------+ +| :ref:`bool` | transient | ``true`` (overrides :ref:`Window`) | ++-----------------------------+-------------------------------------------------------------------------+-------------------------------------------------------------------------+ +| :ref:`bool` | visible | ``false`` (overrides :ref:`Window`) | ++-----------------------------+-------------------------------------------------------------------------+-------------------------------------------------------------------------+ +| :ref:`bool` | wrap_controls | ``true`` (overrides :ref:`Window`) | ++-----------------------------+-------------------------------------------------------------------------+-------------------------------------------------------------------------+ Methods ------- @@ -123,7 +123,7 @@ Sets autowrapping for the text in the dialog. If ``true``, the dialog is hidden when the OK button is pressed. You can set it to ``false`` if you want to do e.g. input validation when receiving the :ref:`confirmed` signal, and handle hiding the dialog in your own logic. -**Note:** Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example :ref:`FileDialog` defaults to ``false``, and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such, this property can't be used in :ref:`FileDialog` to disable hiding the dialog when pressing OK. +\ **Note:** Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example :ref:`FileDialog` defaults to ``false``, and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such, this property can't be used in :ref:`FileDialog` to disable hiding the dialog when pressing OK. ---- @@ -172,7 +172,7 @@ You can use :ref:`remove_button` method Returns the label used for built-in text. -**Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible` property. +\ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible` property. ---- @@ -182,7 +182,7 @@ Returns the label used for built-in text. Returns the OK :ref:`Button` instance. -**Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible` property. +\ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible` property. ---- diff --git a/classes/class_aescontext.rst b/classes/class_aescontext.rst index b2e8bccaf..144be2d6e 100644 --- a/classes/class_aescontext.rst +++ b/classes/class_aescontext.rst @@ -150,7 +150,7 @@ Close this AES context so it can be started again. See :ref:`start`). 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`. +\ **Note:** This function only makes sense when the context is started with :ref:`MODE_CBC_ENCRYPT` or :ref:`MODE_CBC_DECRYPT`. ---- @@ -168,7 +168,7 @@ Start the AES context in the given ``mode``. A ``key`` of either 16 or 32 bytes 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. +\ **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.)` diff --git a/classes/class_animatedsprite2d.rst b/classes/class_animatedsprite2d.rst index de9b536ed..97d9cc22b 100644 --- a/classes/class_animatedsprite2d.rst +++ b/classes/class_animatedsprite2d.rst @@ -18,7 +18,7 @@ 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. +\ **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 --------- @@ -53,13 +53,11 @@ Properties Methods ------- -+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | -+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`play` **(** :ref:`StringName` anim=&"", :ref:`bool` backwards=false **)** | -+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`stop` **(** **)** | -+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ ++------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play` **(** :ref:`StringName` anim=&"", :ref:`bool` backwards=false **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- @@ -195,9 +193,13 @@ The texture's drawing offset. - :ref:`bool` **playing** -+-----------+-----------+ -| *Default* | ``false`` | -+-----------+-----------+ ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_playing(value) | ++-----------+--------------------+ +| *Getter* | is_playing() | ++-----------+--------------------+ If ``true``, the :ref:`animation` is currently playing. @@ -220,14 +222,6 @@ The animation speed is multiplied by this value. Method Descriptions ------------------- -.. _class_AnimatedSprite2D_method_is_playing: - -- :ref:`bool` **is_playing** **(** **)** |const| - -Returns ``true`` if an animation is currently being played. - ----- - .. _class_AnimatedSprite2D_method_play: - void **play** **(** :ref:`StringName` anim=&"", :ref:`bool` backwards=false **)** diff --git a/classes/class_animatedtexture.rst b/classes/class_animatedtexture.rst index de7452eb0..10ae8890b 100644 --- a/classes/class_animatedtexture.rst +++ b/classes/class_animatedtexture.rst @@ -20,9 +20,9 @@ Description 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. +\ ``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`. +\ **Note:** AnimatedTexture doesn't support using :ref:`AtlasTexture`\ s. Each frame needs to be a separate :ref:`Texture2D`. Properties ---------- diff --git a/classes/class_animation.rst b/classes/class_animation.rst index fe4c5ce27..a72146a84 100644 --- a/classes/class_animation.rst +++ b/classes/class_animation.rst @@ -337,7 +337,7 @@ Property Descriptions The total length of the animation (in seconds). -**Note:** Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping. +\ **Note:** Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping. ---- @@ -440,7 +440,7 @@ Returns the audio stream of the key identified by ``key_idx``. The ``track_idx`` Inserts an Audio Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of an Audio Track. -``stream`` is the :ref:`AudioStream` resource to play. ``start_offset`` is the number of seconds cut off at the beginning of the audio stream, while ``end_offset`` is at the ending. +\ ``stream`` is the :ref:`AudioStream` resource to play. ``start_offset`` is the number of seconds cut off at the beginning of the audio stream, while ``end_offset`` is at the ending. ---- @@ -506,7 +506,7 @@ Returns the value of the key identified by ``key_idx``. The ``track_idx`` must b Inserts a Bezier Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of a Bezier Track. -``in_handle`` is the left-side weight of the added Bezier curve point, ``out_handle`` is the right-side one, while ``value`` is the actual value at this point. +\ ``in_handle`` is the left-side weight of the added Bezier curve point, ``out_handle`` is the right-side one, while ``value`` is the actual value at this point. ---- diff --git a/classes/class_animationnodeoneshot.rst b/classes/class_animationnodeoneshot.rst index 8ad76f7d7..9faa05bb6 100644 --- a/classes/class_animationnodeoneshot.rst +++ b/classes/class_animationnodeoneshot.rst @@ -28,28 +28,21 @@ Tutorials Properties ---------- -+---------------------------+-----------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`autorestart` | ``false`` | -+---------------------------+-----------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`autorestart_delay` | ``1.0`` | -+---------------------------+-----------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`autorestart_random_delay` | ``0.0`` | -+---------------------------+-----------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`fadein_time` | ``0.1`` | -+---------------------------+-----------------------------------------------------------------------------------------------+-----------+ -| :ref:`float` | :ref:`fadeout_time` | ``0.1`` | -+---------------------------+-----------------------------------------------------------------------------------------------+-----------+ -| :ref:`bool` | :ref:`sync` | ``false`` | -+---------------------------+-----------------------------------------------------------------------------------------------+-----------+ - -Methods -------- - -+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`MixMode` | :ref:`get_mix_mode` **(** **)** |const| | -+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_mix_mode` **(** :ref:`MixMode` mode **)** | -+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`autorestart` | ``false`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`autorestart_delay` | ``1.0`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`autorestart_random_delay` | ``0.0`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`fadein_time` | ``0.1`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`fadeout_time` | ``0.1`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`MixMode` | :ref:`mix_mode` | ``0`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`sync` | ``false`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ Enumerations ------------ @@ -145,6 +138,20 @@ If :ref:`autorestart` is ``true ---- +.. _class_AnimationNodeOneShot_property_mix_mode: + +- :ref:`MixMode` **mix_mode** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_mix_mode(value) | ++-----------+---------------------+ +| *Getter* | get_mix_mode() | ++-----------+---------------------+ + +---- + .. _class_AnimationNodeOneShot_property_sync: - :ref:`bool` **sync** @@ -157,19 +164,6 @@ If :ref:`autorestart` is ``true | *Getter* | is_using_sync() | +-----------+---------------------+ -Method Descriptions -------------------- - -.. _class_AnimationNodeOneShot_method_get_mix_mode: - -- :ref:`MixMode` **get_mix_mode** **(** **)** |const| - ----- - -.. _class_AnimationNodeOneShot_method_set_mix_mode: - -- 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.)` diff --git a/classes/class_animationnodestatemachine.rst b/classes/class_animationnodestatemachine.rst index 51e823d1e..e792972df 100644 --- a/classes/class_animationnodestatemachine.rst +++ b/classes/class_animationnodestatemachine.rst @@ -18,7 +18,7 @@ Description Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the :ref:`AnimationNodeStateMachinePlayback` object from the :ref:`AnimationTree` node to control it programmatically. -**Example:** +\ **Example:**\ .. tabs:: diff --git a/classes/class_animationnodestatemachineplayback.rst b/classes/class_animationnodestatemachineplayback.rst index 945a64b33..1d7e1fd5c 100644 --- a/classes/class_animationnodestatemachineplayback.rst +++ b/classes/class_animationnodestatemachineplayback.rst @@ -18,7 +18,7 @@ Description Allows control of :ref:`AnimationTree` state machines created with :ref:`AnimationNodeStateMachine`. Retrieve with ``$AnimationTree.get("parameters/playback")``. -**Example:** +\ **Example:**\ .. tabs:: @@ -43,9 +43,9 @@ Tutorials Properties ---------- -+-------------------------+-------------------------+------------------------------+ -| :ref:`bool` | resource_local_to_scene | ``true`` *(parent override)* | -+-------------------------+-------------------------+------------------------------+ ++-------------------------+-------------------------+---------------------------------------------------------------------------------------+ +| :ref:`bool` | resource_local_to_scene | ``true`` (overrides :ref:`Resource`) | ++-------------------------+-------------------------+---------------------------------------------------------------------------------------+ Methods ------- diff --git a/classes/class_animationplayer.rst b/classes/class_animationplayer.rst index c890b00fd..03f4124b3 100644 --- a/classes/class_animationplayer.rst +++ b/classes/class_animationplayer.rst @@ -18,7 +18,7 @@ Description An animation player is used for general-purpose playback of :ref:`Animation` resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels. -``AnimationPlayer`` is more suited than :ref:`Tween` for animations where you know the final values in advance. For example, fading a screen in and out is more easily done with an ``AnimationPlayer`` node thanks to the animation tools provided by the editor. That particular example can also be implemented with a :ref:`Tween` node, but it requires doing everything by code. +\ ``AnimationPlayer`` is more suited than :ref:`Tween` for animations where you know the final values in advance. For example, fading a screen in and out is more easily done with an ``AnimationPlayer`` node thanks to the animation tools provided by the editor. That particular example can also be implemented with a :ref:`Tween` node, but it requires doing everything by code. Updating the target properties of animations occurs at process time. @@ -118,7 +118,7 @@ Signals 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`. +\ **Note:** The signal is not emitted when the animation is changed via :ref:`play` or from :ref:`AnimationTree`. ---- @@ -224,7 +224,7 @@ The name of the animation to play when the scene loads. 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`. +\ **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`. ---- @@ -485,7 +485,7 @@ Plays the animation with key ``name``. Custom blend times and speed can be set. The ``AnimationPlayer`` keeps track of its current or last played animation with :ref:`assigned_animation`. If this method is called with that same animation ``name``, or with no ``name`` parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see :ref:`stop` for both pause and stop). If the animation was already playing, it will keep playing. -**Note:** The animation will be updated the next time the ``AnimationPlayer`` is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call ``advance(0)``. +\ **Note:** The animation will be updated the next time the ``AnimationPlayer`` is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call ``advance(0)``. ---- @@ -505,7 +505,7 @@ This method is a shorthand for :ref:`play` wi Queues an animation for playback once the current one is done. -**Note:** If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow. +\ **Note:** If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow. ---- diff --git a/classes/class_animationtree.rst b/classes/class_animationtree.rst index 4c74c9d17..6ae4b7213 100644 --- a/classes/class_animationtree.rst +++ b/classes/class_animationtree.rst @@ -18,7 +18,7 @@ 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. +\ **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 --------- diff --git a/classes/class_area2d.rst b/classes/class_area2d.rst index d839a4658..ab715c85a 100644 --- a/classes/class_area2d.rst +++ b/classes/class_area2d.rst @@ -86,7 +86,7 @@ Signals Emitted when another Area2D enters this Area2D. Requires :ref:`monitoring` to be set to ``true``. -``area`` the other Area2D. +\ ``area`` the other Area2D. ---- @@ -96,7 +96,7 @@ Emitted when another Area2D enters this Area2D. Requires :ref:`monitoring` to be set to ``true``. -``area`` the other Area2D. +\ ``area`` the other Area2D. ---- @@ -106,13 +106,13 @@ Emitted when another Area2D exits this Area2D. Requires :ref:`monitoring`\ s enters one of this Area2D's :ref:`Shape2D`\ s. Requires :ref:`monitoring` to be set to ``true``. -``area_rid`` the :ref:`RID` of the other Area2D's :ref:`CollisionObject2D` used by the :ref:`PhysicsServer2D`. +\ ``area_rid`` the :ref:`RID` of the other Area2D's :ref:`CollisionObject2D` used by the :ref:`PhysicsServer2D`. -``area`` the other Area2D. +\ ``area`` the other Area2D. -``area_shape_index`` the index of the :ref:`Shape2D` of the other Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``area.shape_owner_get_owner(area_shape_index)``. +\ ``area_shape_index`` the index of the :ref:`Shape2D` of the other Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``area.shape_owner_get_owner(area_shape_index)``. -``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. +\ ``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. ---- @@ -122,13 +122,13 @@ Emitted when one of another Area2D's :ref:`Shape2D`\ s enters one 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_rid`` the :ref:`RID` of the other Area2D's :ref:`CollisionObject2D` used by the :ref:`PhysicsServer2D`. +\ ``area_rid`` the :ref:`RID` of the other Area2D's :ref:`CollisionObject2D` used by the :ref:`PhysicsServer2D`. -``area`` the other Area2D. +\ ``area`` the other Area2D. -``area_shape_index`` the index of the :ref:`Shape2D` of the other Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``area.shape_owner_get_owner(area_shape_index)``. +\ ``area_shape_index`` the index of the :ref:`Shape2D` of the other Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``area.shape_owner_get_owner(area_shape_index)``. -``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. +\ ``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. ---- @@ -138,7 +138,7 @@ Emitted when one of another Area2D's :ref:`Shape2D`\ s exits one 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. -``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. +\ ``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. ---- @@ -148,7 +148,7 @@ Emitted when a :ref:`PhysicsBody2D` or :ref:`TileMap` 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. -``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. +\ ``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. ---- @@ -158,13 +158,13 @@ Emitted when a :ref:`PhysicsBody2D` or :ref:`TileMap` 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. -``body_rid`` the :ref:`RID` of the :ref:`PhysicsBody2D` or :ref:`TileSet`'s :ref:`CollisionObject2D` used by the :ref:`PhysicsServer2D`. +\ ``body_rid`` 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`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody2D` or :ref:`TileMap`. -``body_shape_index`` the index of the :ref:`Shape2D` of the :ref:`PhysicsBody2D` or :ref:`TileMap` used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``body.shape_owner_get_owner(body_shape_index)``. +\ ``body_shape_index`` the index of the :ref:`Shape2D` of the :ref:`PhysicsBody2D` or :ref:`TileMap` used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``body.shape_owner_get_owner(body_shape_index)``. -``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. +\ ``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. ---- @@ -174,13 +174,13 @@ Emitted when one of a :ref:`PhysicsBody2D` or :ref:`TileMap 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. -``body_rid`` the :ref:`RID` of the :ref:`PhysicsBody2D` or :ref:`TileSet`'s :ref:`CollisionObject2D` used by the :ref:`PhysicsServer2D`. +\ ``body_rid`` 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`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody2D` or :ref:`TileMap`. -``body_shape_index`` the index of the :ref:`Shape2D` of the :ref:`PhysicsBody2D` or :ref:`TileMap` used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``body.shape_owner_get_owner(body_shape_index)``. +\ ``body_shape_index`` the index of the :ref:`Shape2D` of the :ref:`PhysicsBody2D` or :ref:`TileMap` used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``body.shape_owner_get_owner(body_shape_index)``. -``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. +\ ``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`PhysicsServer2D`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. Enumerations ------------ @@ -483,7 +483,7 @@ For performance reasons (collisions are all processed at the same time) this lis If ``true``, the given area overlaps the Area2D. -**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. +\ **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. ---- @@ -493,7 +493,7 @@ If ``true``, the given area overlaps the Area2D. 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. +\ **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 bodies themselves, they register their tiles with collision shapes as a virtual physics body). diff --git a/classes/class_area3d.rst b/classes/class_area3d.rst index ada8818f9..08136ad15 100644 --- a/classes/class_area3d.rst +++ b/classes/class_area3d.rst @@ -96,7 +96,7 @@ Signals Emitted when another Area3D enters this Area3D. Requires :ref:`monitoring` to be set to ``true``. -``area`` the other Area3D. +\ ``area`` the other Area3D. ---- @@ -106,7 +106,7 @@ Emitted when another Area3D enters this Area3D. Requires :ref:`monitoring` to be set to ``true``. -``area`` the other Area3D. +\ ``area`` the other Area3D. ---- @@ -116,13 +116,13 @@ Emitted when another Area3D exits this Area3D. Requires :ref:`monitoring`\ s enters one of this Area3D's :ref:`Shape3D`\ s. Requires :ref:`monitoring` to be set to ``true``. -``area_rid`` the :ref:`RID` of the other Area3D's :ref:`CollisionObject3D` used by the :ref:`PhysicsServer3D`. +\ ``area_rid`` the :ref:`RID` of the other Area3D's :ref:`CollisionObject3D` used by the :ref:`PhysicsServer3D`. -``area`` the other Area3D. +\ ``area`` the other Area3D. -``area_shape_index`` the index of the :ref:`Shape3D` of the other Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``area.shape_owner_get_owner(area_shape_index)``. +\ ``area_shape_index`` the index of the :ref:`Shape3D` of the other Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``area.shape_owner_get_owner(area_shape_index)``. -``local_shape_index`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``self.shape_owner_get_owner(local_shape_index)``. +\ ``local_shape_index`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``self.shape_owner_get_owner(local_shape_index)``. ---- @@ -132,13 +132,13 @@ Emitted when one of another Area3D's :ref:`Shape3D`\ s enters one Emitted when one of another Area3D's :ref:`Shape3D`\ s exits one of this Area3D's :ref:`Shape3D`\ s. Requires :ref:`monitoring` to be set to ``true``. -``area_rid`` the :ref:`RID` of the other Area3D's :ref:`CollisionObject3D` used by the :ref:`PhysicsServer3D`. +\ ``area_rid`` the :ref:`RID` of the other Area3D's :ref:`CollisionObject3D` used by the :ref:`PhysicsServer3D`. -``area`` the other Area3D. +\ ``area`` the other Area3D. -``area_shape_index`` the index of the :ref:`Shape3D` of the other Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``area.shape_owner_get_owner(area_shape_index)``. +\ ``area_shape_index`` the index of the :ref:`Shape3D` of the other Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``area.shape_owner_get_owner(area_shape_index)``. -``local_shape_index`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``self.shape_owner_get_owner(local_shape_index)``. +\ ``local_shape_index`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``self.shape_owner_get_owner(local_shape_index)``. ---- @@ -148,7 +148,7 @@ Emitted when one of another Area3D's :ref:`Shape3D`\ s exits one 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`. +\ ``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody3D` or :ref:`GridMap`. ---- @@ -158,7 +158,7 @@ Emitted when a :ref:`PhysicsBody3D` or :ref:`GridMap` 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`. +\ ``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody3D` or :ref:`GridMap`. ---- @@ -168,13 +168,13 @@ Emitted when a :ref:`PhysicsBody3D` or :ref:`GridMap` 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_rid`` the :ref:`RID` of the :ref:`PhysicsBody3D` or :ref:`MeshLibrary`'s :ref:`CollisionObject3D` used by the :ref:`PhysicsServer3D`. +\ ``body_rid`` 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`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody3D` or :ref:`GridMap`. -``body_shape_index`` the index of the :ref:`Shape3D` of the :ref:`PhysicsBody3D` or :ref:`GridMap` used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``body.shape_owner_get_owner(body_shape_index)``. +\ ``body_shape_index`` the index of the :ref:`Shape3D` of the :ref:`PhysicsBody3D` or :ref:`GridMap` used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``body.shape_owner_get_owner(body_shape_index)``. -``local_shape_index`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``self.shape_owner_get_owner(local_shape_index)``. +\ ``local_shape_index`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``self.shape_owner_get_owner(local_shape_index)``. ---- @@ -184,13 +184,13 @@ Emitted when one of a :ref:`PhysicsBody3D` or :ref:`GridMap 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_rid`` the :ref:`RID` of the :ref:`PhysicsBody3D` or :ref:`MeshLibrary`'s :ref:`CollisionObject3D` used by the :ref:`PhysicsServer3D`. +\ ``body_rid`` 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`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody3D` or :ref:`GridMap`. -``body_shape_index`` the index of the :ref:`Shape3D` of the :ref:`PhysicsBody3D` or :ref:`GridMap` used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``body.shape_owner_get_owner(body_shape_index)``. +\ ``body_shape_index`` the index of the :ref:`Shape3D` of the :ref:`PhysicsBody3D` or :ref:`GridMap` used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``body.shape_owner_get_owner(body_shape_index)``. -``local_shape_index`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``self.shape_owner_get_owner(local_shape_index)``. +\ ``local_shape_index`` the index of the :ref:`Shape3D` of this Area3D used by the :ref:`PhysicsServer3D`. Get the :ref:`CollisionShape3D` node with ``self.shape_owner_get_owner(local_shape_index)``. Enumerations ------------ @@ -605,7 +605,7 @@ For performance reasons (collisions are all processed at the same time) this lis 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. +\ **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. ---- @@ -615,7 +615,7 @@ If ``true``, the given area overlaps the Area3D. 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. +\ **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). diff --git a/classes/class_array.rst b/classes/class_array.rst index 9b76807ae..2032d1086 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -16,7 +16,7 @@ Description 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:** +\ **Example:**\ .. tabs:: @@ -61,11 +61,11 @@ Arrays can be concatenated using the ``+`` operator: -**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:** 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:** 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. +\ **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. Constructors ------------ @@ -97,79 +97,79 @@ Constructors Methods ------- -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| 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:`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 **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| 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:`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_at` **(** :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=2147483647, :ref:`int` step=1, :ref:`bool` deep=false **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sort` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sort_custom` **(** :ref:`Callable` func **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Operators --------- @@ -297,7 +297,7 @@ Appends another array at the end of this array. 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. +\ **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. ---- @@ -307,7 +307,7 @@ Returns the last element of the array. Prints an error and returns ``null`` if t 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. Optionally, a ``before`` specifier can be passed. If ``false``, the returned index comes after all existing entries of the value in the array. -**Note:** Calling :ref:`bsearch` on an unsorted array results in unexpected behavior. +\ **Note:** Calling :ref:`bsearch` on an unsorted array results in unexpected behavior. ---- @@ -317,7 +317,7 @@ Finds the index of an existing value (or the insertion index that maintains sort 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_custom` on an unsorted array results in unexpected behavior. +\ **Note:** Calling :ref:`bsearch_custom` on an unsorted array results in unexpected behavior. ---- @@ -351,11 +351,11 @@ If ``deep`` is ``true``, a deep copy is performed: all nested arrays and diction - void **erase** **(** :ref:`Variant` value **)** -Removes the first occurrence of a value from the array. To remove an element by index, use :ref:`remove` instead. +Removes the first occurrence of a value from the array. To remove an element by index, use :ref:`remove_at` instead. -**Note:** This method acts in-place and doesn't return a value. +\ **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. +\ **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. ---- @@ -425,7 +425,7 @@ Searches the array in reverse order for a value and returns its index or ``-1`` 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. +\ **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. ---- @@ -458,7 +458,7 @@ Returns ``true`` if the array contains the given value. -**Note:** This is equivalent to using the ``in`` operator as follows: +\ **Note:** This is equivalent to using the ``in`` operator as follows: .. tabs:: @@ -488,7 +488,7 @@ Returns ``true`` if the array contains the given value. 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. +\ **Note:** Arrays with equal contents can still produce different hashes. Only the exact same arrays will produce the same hashed integer value. ---- @@ -498,9 +498,9 @@ Returns a hashed integer value representing the array and its contents. 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:** 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. +\ **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. ---- @@ -553,7 +553,7 @@ Returns the minimum value contained in the array if all elements are of comparab 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. +\ **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. ---- @@ -571,7 +571,7 @@ Removes and returns the last element of the array. Returns ``null`` if the array 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. +\ **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. ---- @@ -589,7 +589,7 @@ Appends an element at the end of the array. See also :ref:`push_front`. -**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. +\ **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. ---- @@ -612,15 +612,15 @@ The callable's method takes two arguments: the current value of ``accum`` and th ---- -.. _class_Array_method_remove: +.. _class_Array_method_remove_at: -- void **remove** **(** :ref:`int` position **)** +- void **remove_at** **(** :ref:`int` position **)** 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:** 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. +\ **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. ---- @@ -666,9 +666,17 @@ 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 **)** |const| +- :ref:`Array` **slice** **(** :ref:`int` begin, :ref:`int` end=2147483647, :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. Wraps around if ``begin`` or ``end`` are out of bounds or negative. Returns an empty array for invalid parameters. +Returns the slice of the ``Array``, from ``begin`` (inclusive) to ``end`` (exclusive), as a new ``Array``. + +The absolute value of ``begin`` and ``end`` will be clamped to the array size, so the default value for ``end`` makes it slice to the size of the array by default (i.e. ``arr.slice(1)`` is a shorthand for ``arr.slice(1, arr.size())``). + +If either ``begin`` or ``end`` are negative, they will be relative to the end of the array (i.e. ``arr.slice(0, -2)`` is a shorthand for ``arr.slice(0, arr.size() - 2)``). + +If specified, ``step`` is the relative index between source elements. It can be negative, then ``begin`` must be higher than ``end``. For example, ``[0, 1, 2, 3, 4, 5].slice(5, 1, -2)`` returns ``[5, 3]``). + +If ``deep`` is true, each element will be copied by value rather than by reference. ---- @@ -678,7 +686,7 @@ Duplicates the subset described in the function and returns it in an array, deep 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: +\ **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:: @@ -695,6 +703,14 @@ Sorts the array. +To perform natural order sorting, you can use :ref:`sort_custom` with :ref:`String.naturalnocasecmp_to` as follows: + +:: + + var strings = ["string1", "string2", "string10", "string11"] + strings.sort_custom(func(a, b): return a.naturalnocasecmp_to(b) < 0) + print(strings) # Prints [string1, string2, string10, string11] + ---- .. _class_Array_method_sort_custom: @@ -703,7 +719,7 @@ Sorts the array. 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:: diff --git a/classes/class_arraymesh.rst b/classes/class_arraymesh.rst index f58a78289..30cd89659 100644 --- a/classes/class_arraymesh.rst +++ b/classes/class_arraymesh.rst @@ -65,7 +65,7 @@ The :ref:`MeshInstance3D` is ready to be added to the :ref 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. +\ **Note:** Godot uses clockwise `winding order `__ for front faces of triangle primitive modes. Tutorials --------- @@ -86,45 +86,45 @@ Properties 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=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 **)** | -+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| 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 --------------------- @@ -184,7 +184,7 @@ 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=0 **)** +- 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. diff --git a/classes/class_aspectratiocontainer.rst b/classes/class_aspectratiocontainer.rst index 8c05a06e7..2c7edda05 100644 --- a/classes/class_aspectratiocontainer.rst +++ b/classes/class_aspectratiocontainer.rst @@ -21,15 +21,15 @@ Arranges child controls in a way to preserve their aspect ratio automatically wh 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`` | -+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ ++---------------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`AlignmentMode` | :ref:`alignment_horizontal` | ``1`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`AlignmentMode` | :ref:`alignment_vertical` | ``1`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`ratio` | ``1.0`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`StretchMode` | :ref:`stretch_mode` | ``2`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ Enumerations ------------ @@ -58,28 +58,28 @@ When the bounding rectangle of child controls exceed the container's size and :r ---- -.. _enum_AspectRatioContainer_AlignMode: +.. _enum_AspectRatioContainer_AlignmentMode: -.. _class_AspectRatioContainer_constant_ALIGN_BEGIN: +.. _class_AspectRatioContainer_constant_ALIGNMENT_BEGIN: -.. _class_AspectRatioContainer_constant_ALIGN_CENTER: +.. _class_AspectRatioContainer_constant_ALIGNMENT_CENTER: -.. _class_AspectRatioContainer_constant_ALIGN_END: +.. _class_AspectRatioContainer_constant_ALIGNMENT_END: -enum **AlignMode**: +enum **AlignmentMode**: -- **ALIGN_BEGIN** = **0** --- Aligns child controls with the beginning (left or top) of the container. +- **ALIGNMENT_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. +- **ALIGNMENT_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. +- **ALIGNMENT_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** +- :ref:`AlignmentMode` **alignment_horizontal** +-----------+---------------------------------+ | *Default* | ``1`` | @@ -95,7 +95,7 @@ Specifies the horizontal relative position of child controls. .. _class_AspectRatioContainer_property_alignment_vertical: -- :ref:`AlignMode` **alignment_vertical** +- :ref:`AlignmentMode` **alignment_vertical** +-----------+-------------------------------+ | *Default* | ``1`` | diff --git a/classes/class_astar.rst b/classes/class_astar.rst index f47858642..81e864818 100644 --- a/classes/class_astar.rst +++ b/classes/class_astar.rst @@ -52,7 +52,7 @@ It is also possible to use non-Euclidean distances. To do so, create a class tha -: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. +\ :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. @@ -88,14 +88,14 @@ Methods +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_point_count` **(** **)** |const| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_point_ids` **(** **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :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| | @@ -226,7 +226,7 @@ Returns the next available point ID with no point associated to it. 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. +\ **Note:** If several points are the closest to ``to_position``, the one with the smallest ID will be returned, ensuring a deterministic result. ---- @@ -358,13 +358,21 @@ Returns the number of points currently in the points pool. ---- +.. _class_AStar_method_get_point_ids: + +- :ref:`Array` **get_point_ids** **(** **)** + +Returns an array of all point IDs. + +---- + .. _class_AStar_method_get_point_path: - :ref:`PackedVector3Array` **get_point_path** **(** :ref:`int` from_id, :ref:`int` to_id **)** 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. +\ **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. ---- @@ -384,14 +392,6 @@ Returns the weight scale of the point associated with the given ``id``. ---- -.. _class_AStar_method_get_points: - -- :ref:`Array` **get_points** **(** **)** - -Returns an array of all points. - ----- - .. _class_AStar_method_has_point: - :ref:`bool` **has_point** **(** :ref:`int` id **)** |const| diff --git a/classes/class_astar2d.rst b/classes/class_astar2d.rst index 5e37d1827..c468e5437 100644 --- a/classes/class_astar2d.rst +++ b/classes/class_astar2d.rst @@ -50,14 +50,14 @@ Methods +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_point_count` **(** **)** |const| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_point_ids` **(** **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :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| | @@ -188,7 +188,7 @@ Returns the next available point ID with no point associated to it. 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. +\ **Note:** If several points are the closest to ``to_position``, the one with the smallest ID will be returned, ensuring a deterministic result. ---- @@ -322,13 +322,21 @@ Returns the number of points currently in the points pool. ---- +.. _class_AStar2D_method_get_point_ids: + +- :ref:`Array` **get_point_ids** **(** **)** + +Returns an array of all point IDs. + +---- + .. _class_AStar2D_method_get_point_path: - :ref:`PackedVector2Array` **get_point_path** **(** :ref:`int` from_id, :ref:`int` to_id **)** 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. +\ **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. ---- @@ -348,14 +356,6 @@ Returns the weight scale of the point associated with the given ``id``. ---- -.. _class_AStar2D_method_get_points: - -- :ref:`Array` **get_points** **(** **)** - -Returns an array of all points. - ----- - .. _class_AStar2D_method_has_point: - :ref:`bool` **has_point** **(** :ref:`int` id **)** |const| diff --git a/classes/class_atlastexture.rst b/classes/class_atlastexture.rst index 98f3b0fff..94b3bf81a 100644 --- a/classes/class_atlastexture.rst +++ b/classes/class_atlastexture.rst @@ -18,7 +18,7 @@ Description :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. +\ ``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 ---------- diff --git a/classes/class_audioeffectrecord.rst b/classes/class_audioeffectrecord.rst index b4202c774..9bb17b6ab 100644 --- a/classes/class_audioeffectrecord.rst +++ b/classes/class_audioeffectrecord.rst @@ -11,12 +11,16 @@ AudioEffectRecord **Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Audio effect used for recording sound from a microphone. +Audio effect used for recording the sound from an audio bus. 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. +Allows the user to record the sound from an audio bus. This can include all audio output by Godot when used on the "Master" audio bus. + +Can be used (with an :ref:`AudioStreamMicrophone`) to record 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 --------- diff --git a/classes/class_audioeffectspectrumanalyzer.rst b/classes/class_audioeffectspectrumanalyzer.rst index 7fe766861..52bc491ce 100644 --- a/classes/class_audioeffectspectrumanalyzer.rst +++ b/classes/class_audioeffectspectrumanalyzer.rst @@ -23,9 +23,9 @@ See also :ref:`AudioStreamGenerator` for procedurall Tutorials --------- -- `https://godotengine.org/asset-library/asset/528