From fe259f74ff67492e80eec7e4d4b0e3934a7f1730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 27 Jan 2023 15:10:25 +0100 Subject: [PATCH] classref: Sync with current master branch (518b9e580) --- classes/class_@gdscript.rst | 6 +- classes/class_@globalscope.rst | 879 ++++++------------ classes/class_aabb.rst | 2 +- classes/class_acceptdialog.rst | 6 +- classes/class_animatablebody3d.rst | 2 + classes/class_animatedsprite2d.rst | 272 ++++-- classes/class_animatedsprite3d.rst | 256 +++-- classes/class_animationnode.rst | 14 + classes/class_animationnodeoneshot.rst | 34 + ...lass_animationnodestatemachineplayback.rst | 72 +- ...ss_animationnodestatemachinetransition.rst | 51 +- classes/class_animationnodetransition.rst | 46 +- classes/class_animationplayer.rst | 194 ++-- classes/class_animationtree.rst | 38 +- classes/class_area3d.rst | 2 + classes/class_array.rst | 66 +- classes/class_arraymesh.rst | 98 +- classes/class_astargrid2d.rst | 8 +- classes/class_audiostream.rst | 2 +- classes/class_audiostreamplayback.rst | 2 +- .../class_audiostreamplaybackpolyphonic.rst | 137 +++ classes/class_audiostreampolyphonic.rst | 65 ++ classes/class_backbuffercopy.rst | 4 +- classes/class_basebutton.rst | 2 +- classes/class_boneattachment3d.rst | 89 +- classes/class_bool.rst | 2 +- classes/class_callable.rst | 12 +- classes/class_canvasgroup.rst | 4 +- classes/class_canvasitem.rst | 62 +- classes/class_characterbody3d.rst | 6 +- classes/class_codeedit.rst | 16 +- classes/class_collisionobject3d.rst | 8 +- classes/class_collisionpolygon3d.rst | 2 + classes/class_collisionshape3d.rst | 2 + classes/class_color.rst | 2 +- classes/class_confirmationdialog.rst | 4 +- classes/class_control.rst | 28 +- classes/class_convexpolygonshape3d.rst | 2 +- classes/class_cubemap.rst | 29 + classes/class_cubemaparray.rst | 29 + classes/class_curve2d.rst | 4 +- classes/class_curve3d.rst | 2 +- classes/class_dictionary.rst | 30 +- classes/class_displayserver.rst | 16 +- classes/class_dtlsserver.rst | 4 +- classes/class_editorcommandpalette.rst | 2 +- classes/class_editorexportplatform.rst | 11 +- classes/class_editorfilesystem.rst | 26 +- classes/class_editorplugin.rst | 38 +- .../class_editorresourceconversionplugin.rst | 45 +- classes/class_editorsettings.rst | 64 +- classes/class_editorundoredomanager.rst | 2 +- classes/class_expression.rst | 2 +- classes/class_filesystemdock.rst | 14 + classes/class_gdscript.rst | 20 +- classes/class_geometryinstance3d.rst | 8 +- classes/class_gltfdocument.rst | 8 +- classes/class_gltfstate.rst | 65 ++ classes/class_gpuparticles2d.rst | 8 +- classes/class_graphnode.rst | 48 +- classes/class_heightmapshape3d.rst | 4 +- classes/class_httprequest.rst | 4 +- classes/class_image.rst | 6 +- classes/class_importermesh.rst | 14 +- classes/class_input.rst | 20 +- classes/class_inputeventkey.rst | 107 ++- classes/class_inputeventwithmodifiers.rst | 20 +- classes/class_javascriptbridge.rst | 2 +- classes/class_json.rst | 24 +- classes/class_light3d.rst | 2 +- classes/class_lightmapgi.rst | 28 +- classes/class_lineedit.rst | 105 ++- classes/class_marshalls.rst | 2 +- classes/class_material.rst | 36 +- classes/class_mesh.rst | 26 +- classes/class_meshinstance2d.rst | 31 +- classes/class_multimeshinstance2d.rst | 31 +- classes/class_multiplayerapi.rst | 4 +- classes/class_navigationagent2d.rst | 72 +- classes/class_navigationagent3d.rst | 52 +- classes/class_navigationlink2d.rst | 26 +- classes/class_navigationlink3d.rst | 26 +- classes/class_navigationserver2d.rst | 34 +- classes/class_navigationserver3d.rst | 135 ++- classes/class_node.rst | 10 +- classes/class_object.rst | 52 +- classes/class_openxraction.rst | 4 +- classes/class_os.rst | 32 +- classes/class_particleprocessmaterial.rst | 4 +- classes/class_performance.rst | 124 ++- classes/class_physicalbone3d.rst | 7 +- classes/class_physicsbody3d.rst | 4 +- classes/class_physicsserver3dmanager.rst | 2 +- classes/class_plane.rst | 36 +- classes/class_projection.rst | 108 +-- classes/class_projectsettings.rst | 177 +++- classes/class_rect2i.rst | 6 +- classes/class_refcounted.rst | 2 +- classes/class_remotetransform2d.rst | 6 +- classes/class_renderingserver.rst | 36 +- classes/class_resource.rst | 6 +- classes/class_resourceformatloader.rst | 14 + classes/class_resourcepreloader.rst | 4 +- classes/class_richtextlabel.rst | 34 +- classes/class_rigidbody3d.rst | 2 + classes/class_shader.rst | 10 +- classes/class_shadermaterial.rst | 4 +- classes/class_signal.rst | 4 +- classes/class_skeleton2d.rst | 2 +- classes/class_skeleton3d.rst | 332 ++----- classes/class_skeletonmodification2d.rst | 2 +- classes/class_skeletonmodification3d.rst | 187 ---- classes/class_skeletonmodification3dccdik.rst | 339 ------- .../class_skeletonmodification3dfabrik.rst | 387 -------- .../class_skeletonmodification3djiggle.rst | 504 ---------- .../class_skeletonmodification3dlookat.rst | 206 ---- ...lass_skeletonmodification3dstackholder.rst | 74 -- .../class_skeletonmodification3dtwoboneik.rst | 450 --------- classes/class_skeletonmodificationstack3d.rst | 246 ----- classes/class_skeletonprofile.rst | 18 +- classes/class_skeletonprofilehumanoid.rst | 2 + classes/class_spriteframes.rst | 22 +- classes/class_staticbody3d.rst | 6 +- classes/class_string.rst | 16 +- classes/class_stringname.rst | 16 +- classes/class_stylebox.rst | 76 +- classes/class_styleboxtexture.rst | 268 +++--- classes/class_surfacetool.rst | 4 +- classes/class_systemfont.rst | 38 + classes/class_textedit.rst | 119 ++- classes/class_textserver.rst | 20 +- classes/class_textserverextension.rst | 4 +- classes/class_texture2d.rst | 76 +- classes/class_texture2darray.rst | 29 + classes/class_texture3d.rst | 64 +- classes/class_texturerect.rst | 118 ++- classes/class_tilemap.rst | 36 +- classes/class_tileset.rst | 2 +- classes/class_timer.rst | 2 +- classes/class_transform3d.rst | 4 +- classes/class_tree.rst | 32 +- classes/class_treeitem.rst | 62 +- classes/class_tween.rst | 30 +- classes/class_undoredo.rst | 10 +- classes/class_variant.rst | 4 +- classes/class_vehiclebody3d.rst | 2 + classes/class_viewport.rst | 4 +- classes/class_visualinstance3d.rst | 16 +- classes/class_visualshadernode.rst | 17 - .../class_visualshadernodederivativefunc.rst | 71 +- ...ass_visualshadernodeparticlerandomness.rst | 10 +- classes/class_visualshadernodetexture.rst | 20 +- ...class_visualshadernodetextureparameter.rst | 69 ++ classes/class_webxrinterface.rst | 6 +- classes/class_window.rst | 213 +++-- classes/class_xrcontroller3d.rst | 42 +- classes/class_xrpositionaltracker.rst | 12 +- classes/index.rst | 12 +- 158 files changed, 3976 insertions(+), 4796 deletions(-) create mode 100644 classes/class_audiostreamplaybackpolyphonic.rst create mode 100644 classes/class_audiostreampolyphonic.rst delete mode 100644 classes/class_skeletonmodification3d.rst delete mode 100644 classes/class_skeletonmodification3dccdik.rst delete mode 100644 classes/class_skeletonmodification3dfabrik.rst delete mode 100644 classes/class_skeletonmodification3djiggle.rst delete mode 100644 classes/class_skeletonmodification3dlookat.rst delete mode 100644 classes/class_skeletonmodification3dstackholder.rst delete mode 100644 classes/class_skeletonmodification3dtwoboneik.rst delete mode 100644 classes/class_skeletonmodificationstack3d.rst diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index 2540049f0..7a8b4344e 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -482,7 +482,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_NODE_PATH_VALID_TYPES` | :ref:`is_nan` **(** :ref:`float` x **)** | +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_same` **(** :ref:`Variant` a, :ref:`Variant` b **)** | + +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_zero_approx` **(** :ref:`float` x **)** | +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`lerp` **(** :ref:`Variant` from, :ref:`Variant` to, :ref:`Variant` weight **)** | @@ -1373,22 +1375,6 @@ Number 8 on the numeric keypad. Number 9 on the numeric keypad. -.. _class_@GlobalScope_constant_KEY_SUPER_L: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_SUPER_L** = ``4194368`` - -Left Super key (Windows key). - -.. _class_@GlobalScope_constant_KEY_SUPER_R: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_SUPER_R** = ``4194369`` - -Right Super key (Windows key). - .. _class_@GlobalScope_constant_KEY_MENU: .. rst-class:: classref-enumeration-constant @@ -1397,21 +1383,13 @@ Right Super key (Windows key). Context menu key. -.. _class_@GlobalScope_constant_KEY_HYPER_L: +.. _class_@GlobalScope_constant_KEY_HYPER: .. rst-class:: classref-enumeration-constant -:ref:`Key` **KEY_HYPER_L** = ``4194371`` +:ref:`Key` **KEY_HYPER** = ``4194371`` -Left Hyper key. - -.. _class_@GlobalScope_constant_KEY_HYPER_R: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_HYPER_R** = ``4194372`` - -Right Hyper key. +Hyper key. (On Linux/X11 only). .. _class_@GlobalScope_constant_KEY_HELP: @@ -1421,22 +1399,6 @@ Right Hyper key. Help key. -.. _class_@GlobalScope_constant_KEY_DIRECTION_L: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_DIRECTION_L** = ``4194374`` - -Left Direction key. - -.. _class_@GlobalScope_constant_KEY_DIRECTION_R: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_DIRECTION_R** = ``4194375`` - -Right Direction key. - .. _class_@GlobalScope_constant_KEY_BACK: .. rst-class:: classref-enumeration-constant @@ -1493,46 +1455,6 @@ Mute volume key. Volume up key. -.. _class_@GlobalScope_constant_KEY_BASSBOOST: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_BASSBOOST** = ``4194383`` - -Bass Boost key. - -.. _class_@GlobalScope_constant_KEY_BASSUP: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_BASSUP** = ``4194384`` - -Bass up key. - -.. _class_@GlobalScope_constant_KEY_BASSDOWN: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_BASSDOWN** = ``4194385`` - -Bass down key. - -.. _class_@GlobalScope_constant_KEY_TREBLEUP: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_TREBLEUP** = ``4194386`` - -Treble up key. - -.. _class_@GlobalScope_constant_KEY_TREBLEDOWN: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_TREBLEDOWN** = ``4194387`` - -Treble down key. - .. _class_@GlobalScope_constant_KEY_MEDIAPLAY: .. rst-class:: classref-enumeration-constant @@ -1761,7 +1683,7 @@ Launch Shortcut F key. .. rst-class:: classref-enumeration-constant -:ref:`Key` **KEY_UNKNOWN** = ``16777215`` +:ref:`Key` **KEY_UNKNOWN** = ``8388607`` Unknown key. @@ -2317,46 +2239,6 @@ Z key. ~ key. -.. _class_@GlobalScope_constant_KEY_NOBREAKSPACE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_NOBREAKSPACE** = ``160`` - -Non-breakable space key. - -.. _class_@GlobalScope_constant_KEY_EXCLAMDOWN: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_EXCLAMDOWN** = ``161`` - -¡ key. - -.. _class_@GlobalScope_constant_KEY_CENT: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_CENT** = ``162`` - -¢ key. - -.. _class_@GlobalScope_constant_KEY_STERLING: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_STERLING** = ``163`` - -£ key. - -.. _class_@GlobalScope_constant_KEY_CURRENCY: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_CURRENCY** = ``164`` - -¤ key. - .. _class_@GlobalScope_constant_KEY_YEN: .. rst-class:: classref-enumeration-constant @@ -2365,14 +2247,6 @@ Non-breakable space key. ¥ key. -.. _class_@GlobalScope_constant_KEY_BROKENBAR: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_BROKENBAR** = ``166`` - -¦ key. - .. _class_@GlobalScope_constant_KEY_SECTION: .. rst-class:: classref-enumeration-constant @@ -2381,469 +2255,37 @@ Non-breakable space key. § key. -.. _class_@GlobalScope_constant_KEY_DIAERESIS: +.. _class_@GlobalScope_constant_KEY_GLOBE: .. rst-class:: classref-enumeration-constant -:ref:`Key` **KEY_DIAERESIS** = ``168`` +:ref:`Key` **KEY_GLOBE** = ``4194416`` -¨ key. +"Globe" key on Mac / iPad keyboard. -.. _class_@GlobalScope_constant_KEY_COPYRIGHT: +.. _class_@GlobalScope_constant_KEY_KEYBOARD: .. rst-class:: classref-enumeration-constant -:ref:`Key` **KEY_COPYRIGHT** = ``169`` +:ref:`Key` **KEY_KEYBOARD** = ``4194417`` -© key. +"On-screen keyboard" key iPad keyboard. -.. _class_@GlobalScope_constant_KEY_ORDFEMININE: +.. _class_@GlobalScope_constant_KEY_JIS_EISU: .. rst-class:: classref-enumeration-constant -:ref:`Key` **KEY_ORDFEMININE** = ``170`` +:ref:`Key` **KEY_JIS_EISU** = ``4194418`` -ª key. +英数 key on Mac keyboard. -.. _class_@GlobalScope_constant_KEY_GUILLEMOTLEFT: +.. _class_@GlobalScope_constant_KEY_JIS_KANA: .. rst-class:: classref-enumeration-constant -:ref:`Key` **KEY_GUILLEMOTLEFT** = ``171`` +:ref:`Key` **KEY_JIS_KANA** = ``4194419`` -« key. - -.. _class_@GlobalScope_constant_KEY_NOTSIGN: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_NOTSIGN** = ``172`` - -¬ key. - -.. _class_@GlobalScope_constant_KEY_HYPHEN: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_HYPHEN** = ``173`` - -Soft hyphen key. - -.. _class_@GlobalScope_constant_KEY_REGISTERED: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_REGISTERED** = ``174`` - -® key. - -.. _class_@GlobalScope_constant_KEY_MACRON: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_MACRON** = ``175`` - -¯ key. - -.. _class_@GlobalScope_constant_KEY_DEGREE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_DEGREE** = ``176`` - -° key. - -.. _class_@GlobalScope_constant_KEY_PLUSMINUS: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_PLUSMINUS** = ``177`` - -± key. - -.. _class_@GlobalScope_constant_KEY_TWOSUPERIOR: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_TWOSUPERIOR** = ``178`` - -² key. - -.. _class_@GlobalScope_constant_KEY_THREESUPERIOR: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_THREESUPERIOR** = ``179`` - -³ key. - -.. _class_@GlobalScope_constant_KEY_ACUTE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ACUTE** = ``180`` - -´ key. - -.. _class_@GlobalScope_constant_KEY_MU: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_MU** = ``181`` - -µ key. - -.. _class_@GlobalScope_constant_KEY_PARAGRAPH: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_PARAGRAPH** = ``182`` - -¶ key. - -.. _class_@GlobalScope_constant_KEY_PERIODCENTERED: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_PERIODCENTERED** = ``183`` - -· key. - -.. _class_@GlobalScope_constant_KEY_CEDILLA: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_CEDILLA** = ``184`` - -¸ key. - -.. _class_@GlobalScope_constant_KEY_ONESUPERIOR: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ONESUPERIOR** = ``185`` - -¹ key. - -.. _class_@GlobalScope_constant_KEY_MASCULINE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_MASCULINE** = ``186`` - -º key. - -.. _class_@GlobalScope_constant_KEY_GUILLEMOTRIGHT: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_GUILLEMOTRIGHT** = ``187`` - -» key. - -.. _class_@GlobalScope_constant_KEY_ONEQUARTER: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ONEQUARTER** = ``188`` - -¼ key. - -.. _class_@GlobalScope_constant_KEY_ONEHALF: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ONEHALF** = ``189`` - -½ key. - -.. _class_@GlobalScope_constant_KEY_THREEQUARTERS: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_THREEQUARTERS** = ``190`` - -¾ key. - -.. _class_@GlobalScope_constant_KEY_QUESTIONDOWN: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_QUESTIONDOWN** = ``191`` - -¿ key. - -.. _class_@GlobalScope_constant_KEY_AGRAVE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_AGRAVE** = ``192`` - -À key. - -.. _class_@GlobalScope_constant_KEY_AACUTE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_AACUTE** = ``193`` - -Á key. - -.. _class_@GlobalScope_constant_KEY_ACIRCUMFLEX: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ACIRCUMFLEX** = ``194`` - -Â key. - -.. _class_@GlobalScope_constant_KEY_ATILDE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ATILDE** = ``195`` - -Ã key. - -.. _class_@GlobalScope_constant_KEY_ADIAERESIS: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ADIAERESIS** = ``196`` - -Ä key. - -.. _class_@GlobalScope_constant_KEY_ARING: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ARING** = ``197`` - -Å key. - -.. _class_@GlobalScope_constant_KEY_AE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_AE** = ``198`` - -Æ key. - -.. _class_@GlobalScope_constant_KEY_CCEDILLA: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_CCEDILLA** = ``199`` - -Ç key. - -.. _class_@GlobalScope_constant_KEY_EGRAVE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_EGRAVE** = ``200`` - -È key. - -.. _class_@GlobalScope_constant_KEY_EACUTE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_EACUTE** = ``201`` - -É key. - -.. _class_@GlobalScope_constant_KEY_ECIRCUMFLEX: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ECIRCUMFLEX** = ``202`` - -Ê key. - -.. _class_@GlobalScope_constant_KEY_EDIAERESIS: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_EDIAERESIS** = ``203`` - -Ë key. - -.. _class_@GlobalScope_constant_KEY_IGRAVE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_IGRAVE** = ``204`` - -Ì key. - -.. _class_@GlobalScope_constant_KEY_IACUTE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_IACUTE** = ``205`` - -Í key. - -.. _class_@GlobalScope_constant_KEY_ICIRCUMFLEX: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ICIRCUMFLEX** = ``206`` - -Î key. - -.. _class_@GlobalScope_constant_KEY_IDIAERESIS: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_IDIAERESIS** = ``207`` - -Ï key. - -.. _class_@GlobalScope_constant_KEY_ETH: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ETH** = ``208`` - -Ð key. - -.. _class_@GlobalScope_constant_KEY_NTILDE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_NTILDE** = ``209`` - -Ñ key. - -.. _class_@GlobalScope_constant_KEY_OGRAVE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_OGRAVE** = ``210`` - -Ò key. - -.. _class_@GlobalScope_constant_KEY_OACUTE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_OACUTE** = ``211`` - -Ó key. - -.. _class_@GlobalScope_constant_KEY_OCIRCUMFLEX: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_OCIRCUMFLEX** = ``212`` - -Ô key. - -.. _class_@GlobalScope_constant_KEY_OTILDE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_OTILDE** = ``213`` - -Õ key. - -.. _class_@GlobalScope_constant_KEY_ODIAERESIS: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_ODIAERESIS** = ``214`` - -Ö key. - -.. _class_@GlobalScope_constant_KEY_MULTIPLY: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_MULTIPLY** = ``215`` - -× key. - -.. _class_@GlobalScope_constant_KEY_OOBLIQUE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_OOBLIQUE** = ``216`` - -Ø key. - -.. _class_@GlobalScope_constant_KEY_UGRAVE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_UGRAVE** = ``217`` - -Ù key. - -.. _class_@GlobalScope_constant_KEY_UACUTE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_UACUTE** = ``218`` - -Ú key. - -.. _class_@GlobalScope_constant_KEY_UCIRCUMFLEX: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_UCIRCUMFLEX** = ``219`` - -Û key. - -.. _class_@GlobalScope_constant_KEY_UDIAERESIS: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_UDIAERESIS** = ``220`` - -Ü key. - -.. _class_@GlobalScope_constant_KEY_YACUTE: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_YACUTE** = ``221`` - -Ý key. - -.. _class_@GlobalScope_constant_KEY_THORN: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_THORN** = ``222`` - -Þ key. - -.. _class_@GlobalScope_constant_KEY_SSHARP: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_SSHARP** = ``223`` - -ß key. - -.. _class_@GlobalScope_constant_KEY_DIVISION: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_DIVISION** = ``247`` - -÷ key. - -.. _class_@GlobalScope_constant_KEY_YDIAERESIS: - -.. rst-class:: classref-enumeration-constant - -:ref:`Key` **KEY_YDIAERESIS** = ``255`` - -ÿ key. +かな key on Mac keyboard. .. rst-class:: classref-item-separator @@ -4432,19 +3874,27 @@ The property is a script variable which should be serialized and saved in the sc The property is an array. -.. _class_@GlobalScope_constant_PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE: +.. _class_@GlobalScope_constant_PROPERTY_USAGE_ALWAYS_DUPLICATE: .. rst-class:: classref-enumeration-constant -:ref:`PropertyUsageFlags` **PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE** = ``524288`` +:ref:`PropertyUsageFlags` **PROPERTY_USAGE_ALWAYS_DUPLICATE** = ``524288`` -If the property is a :ref:`Resource`, a new copy of it is always created when calling :ref:`Node.duplicate` or :ref:`Resource.duplicate`. +When duplicating a resource with :ref:`Resource.duplicate`, and this flag is set on a property of that resource, the property should always be duplicated, regardless of the ``subresources`` bool parameter. + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_NEVER_DUPLICATE: + +.. rst-class:: classref-enumeration-constant + +:ref:`PropertyUsageFlags` **PROPERTY_USAGE_NEVER_DUPLICATE** = ``1048576`` + +When duplicating a resource with :ref:`Resource.duplicate`, and this flag is set on a property of that resource, the property should never be duplicated, regardless of the ``subresources`` bool parameter. .. _class_@GlobalScope_constant_PROPERTY_USAGE_HIGH_END_GFX: .. rst-class:: classref-enumeration-constant -:ref:`PropertyUsageFlags` **PROPERTY_USAGE_HIGH_END_GFX** = ``1048576`` +:ref:`PropertyUsageFlags` **PROPERTY_USAGE_HIGH_END_GFX** = ``2097152`` The property is only shown in the editor if modern renderers are supported (GLES3 is excluded). @@ -4452,7 +3902,7 @@ The property is only shown in the editor if modern renderers are supported (GLES .. rst-class:: classref-enumeration-constant -:ref:`PropertyUsageFlags` **PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT** = ``2097152`` +:ref:`PropertyUsageFlags` **PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT** = ``4194304`` @@ -4460,7 +3910,7 @@ The property is only shown in the editor if modern renderers are supported (GLES .. rst-class:: classref-enumeration-constant -:ref:`PropertyUsageFlags` **PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT** = ``4194304`` +:ref:`PropertyUsageFlags` **PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT** = ``8388608`` @@ -4468,7 +3918,7 @@ The property is only shown in the editor if modern renderers are supported (GLES .. rst-class:: classref-enumeration-constant -:ref:`PropertyUsageFlags` **PROPERTY_USAGE_KEYING_INCREMENTS** = ``8388608`` +:ref:`PropertyUsageFlags` **PROPERTY_USAGE_KEYING_INCREMENTS** = ``16777216`` @@ -4476,7 +3926,7 @@ The property is only shown in the editor if modern renderers are supported (GLES .. rst-class:: classref-enumeration-constant -:ref:`PropertyUsageFlags` **PROPERTY_USAGE_DEFERRED_SET_RESOURCE** = ``16777216`` +:ref:`PropertyUsageFlags` **PROPERTY_USAGE_DEFERRED_SET_RESOURCE** = ``33554432`` @@ -4484,7 +3934,7 @@ The property is only shown in the editor if modern renderers are supported (GLES .. rst-class:: classref-enumeration-constant -:ref:`PropertyUsageFlags` **PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT** = ``33554432`` +:ref:`PropertyUsageFlags` **PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT** = ``67108864`` @@ -4492,7 +3942,7 @@ The property is only shown in the editor if modern renderers are supported (GLES .. rst-class:: classref-enumeration-constant -:ref:`PropertyUsageFlags` **PROPERTY_USAGE_EDITOR_BASIC_SETTING** = ``67108864`` +:ref:`PropertyUsageFlags` **PROPERTY_USAGE_EDITOR_BASIC_SETTING** = ``134217728`` @@ -4500,7 +3950,7 @@ The property is only shown in the editor if modern renderers are supported (GLES .. rst-class:: classref-enumeration-constant -:ref:`PropertyUsageFlags` **PROPERTY_USAGE_READ_ONLY** = ``134217728`` +:ref:`PropertyUsageFlags` **PROPERTY_USAGE_READ_ONLY** = ``268435456`` The property is read-only in the :ref:`EditorInspector`. @@ -6187,10 +5637,19 @@ Produces: Returns the integer hash of the passed ``variable``. -:: + +.. tabs:: + + .. code-tab:: gdscript print(hash("a")) # Prints 177670 + .. code-tab:: csharp + + GD.Print(GD.Hash("a")); // Prints 177670 + + + .. rst-class:: classref-item-separator ---- @@ -6203,14 +5662,34 @@ Returns the integer hash of the passed ``variable``. Returns the :ref:`Object` that corresponds to ``instance_id``. All Objects have a unique instance ID. See also :ref:`Object.get_instance_id`. -:: + +.. tabs:: + + .. code-tab:: gdscript var foo = "bar" + func _ready(): var id = get_instance_id() var inst = instance_from_id(id) print(inst.foo) # Prints bar + .. code-tab:: csharp + + public partial class MyNode : Node + { + public string Foo { get; set; } = "bar"; + + public override void _Ready() + { + ulong id = GetInstanceId(); + var inst = (MyNode)InstanceFromId(Id); + GD.Print(inst.Foo); // Prints bar + } + } + + + .. rst-class:: classref-item-separator ---- @@ -6315,13 +5794,45 @@ Returns ``true`` if ``x`` is a NaN ("Not a Number" or invalid) value. ---- +.. _class_@GlobalScope_method_is_same: + +.. rst-class:: classref-method + +:ref:`bool` **is_same** **(** :ref:`Variant` a, :ref:`Variant` b **)** + +Returns ``true``, for value types, if ``a`` and ``b`` share the same value. Returns ``true``, for reference types, if the references of ``a`` and ``b`` are the same. + +:: + + # Vector2 is a value type + var vec2_a = Vector2(0, 0) + var vec2_b = Vector2(0, 0) + var vec2_c = Vector2(1, 1) + is_same(vec2_a, vec2_a) # true + is_same(vec2_a, vec2_b) # true + is_same(vec2_a, vec2_c) # false + + # Array is a reference type + var arr_a = [] + var arr_b = [] + is_same(arr_a, arr_a) # true + is_same(arr_a, arr_b) # false + +These are :ref:`Variant` value types: ``null``, :ref:`bool`, :ref:`int`, :ref:`float`, :ref:`String`, :ref:`StringName`, :ref:`Vector2`, :ref:`Vector2i`, :ref:`Vector3`, :ref:`Vector3i`, :ref:`Vector4`, :ref:`Vector4i`, :ref:`Rect2`, :ref:`Rect2i`, :ref:`Transform2D`, :ref:`Transform3D`, :ref:`Plane`, :ref:`Quaternion`, :ref:`AABB`, :ref:`Basis`, :ref:`Projection`, :ref:`Color`, :ref:`NodePath`, :ref:`RID`, :ref:`Callable` and :ref:`Signal`. + +These are :ref:`Variant` reference types: :ref:`Object`, :ref:`Dictionary`, :ref:`Array`, :ref:`PackedByteArray`, :ref:`PackedInt32Array`, :ref:`PackedInt64Array`, :ref:`PackedFloat32Array`, :ref:`PackedFloat64Array`, :ref:`PackedStringArray`, :ref:`PackedVector2Array`, :ref:`PackedVector3Array` and :ref:`PackedColorArray`. + +.. rst-class:: classref-item-separator + +---- + .. _class_@GlobalScope_method_is_zero_approx: .. rst-class:: classref-method :ref:`bool` **is_zero_approx** **(** :ref:`float` x **)** -Returns ``true`` if ``x`` is zero or almost zero. +Returns ``true`` if ``x`` is zero or almost zero. The comparison is done using a tolerance calculation with a small internal epsilon. This function is faster than using :ref:`is_equal_approx` with one value as zero. @@ -6663,11 +6174,21 @@ void **print** **(** ... **)** |vararg| Converts one or more arguments of any type to string in the best way possible and prints them to the console. -:: + +.. tabs:: + + .. code-tab:: gdscript var a = [1, 2, 3] print("a", "b", a) # Prints ab[1, 2, 3] + .. code-tab:: csharp + + var a = new Godot.Collections.Array { 1, 2, 3 }; + GD.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` or :ref:`print_rich`. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. .. rst-class:: classref-item-separator @@ -6684,10 +6205,19 @@ Converts one or more arguments of any type to string in the best way possible an When printing to standard output, the supported subset of BBCode is converted to ANSI escape codes for the terminal emulator to display. Displaying ANSI escape codes is currently only supported on Linux and macOS. Support for ANSI escape codes may vary across terminal emulators, especially for italic and strikethrough. -:: + +.. tabs:: + + .. code-tab:: gdscript print_rich("[code][b]Hello world![/b][/code]") # Prints out: [b]Hello world![/b] + .. code-tab:: csharp + + GD.PrintRich("[code][b]Hello world![/b][/code]"); // Prints out: [b]Hello world![/b] + + + \ **Note:** Consider using :ref:`push_error` and :ref:`push_warning` to print error and warning messages instead of :ref:`print` or :ref:`print_rich`. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. .. rst-class:: classref-item-separator @@ -6714,10 +6244,19 @@ void **printerr** **(** ... **)** |vararg| Prints one or more arguments to strings in the best way possible to standard error line. -:: + +.. tabs:: + + .. code-tab:: gdscript printerr("prints to stderr") + .. code-tab:: csharp + + GD.PrintErr("prints to stderr"); + + + .. rst-class:: classref-item-separator ---- @@ -6730,13 +6269,25 @@ void **printraw** **(** ... **)** |vararg| Prints one or more arguments to strings in the best way possible to the OS terminal. Unlike :ref:`print`, no newline is automatically added at the end. -:: + +.. tabs:: + + .. code-tab:: gdscript printraw("A") printraw("B") printraw("C") # Prints ABC to terminal + .. code-tab:: csharp + + GD.PrintRaw("A"); + GD.PrintRaw("B"); + GD.PrintRaw("C"); + // Prints ABC to terminal + + + .. rst-class:: classref-item-separator ---- @@ -6749,10 +6300,19 @@ void **prints** **(** ... **)** |vararg| Prints one or more arguments to the console with a space between each argument. -:: + +.. tabs:: + + .. code-tab:: gdscript prints("A", "B", "C") # Prints A B C + .. code-tab:: csharp + + GD.PrintS("A", "B", "C"); // Prints A B C + + + .. rst-class:: classref-item-separator ---- @@ -6765,10 +6325,19 @@ void **printt** **(** ... **)** |vararg| Prints one or more arguments to the console with a tab between each argument. -:: + +.. tabs:: + + .. code-tab:: gdscript printt("A", "B", "C") # Prints A B C + .. code-tab:: csharp + + GD.PrintT("A", "B", "C"); // Prints A B C + + + .. rst-class:: classref-item-separator ---- @@ -6781,10 +6350,19 @@ void **push_error** **(** ... **)** |vararg| Pushes an error message to Godot's built-in debugger and to the OS terminal. -:: + +.. tabs:: + + .. code-tab:: gdscript push_error("test error") # Prints "test error" to debugger and terminal as error call + .. code-tab:: csharp + + GD.PushError("test error"); // Prints "test error" to debugger and terminal as error call + + + \ **Note:** This function does not pause project execution. To print an error message and pause project execution in debug builds, use ``assert(false, "test error")`` instead. .. rst-class:: classref-item-separator @@ -6799,10 +6377,19 @@ void **push_warning** **(** ... **)** |vararg| Pushes a warning message to Godot's built-in debugger and to the OS terminal. -:: + +.. tabs:: + + .. code-tab:: gdscript push_warning("test warning") # Prints "test warning" to debugger and terminal as warning call + .. code-tab:: csharp + + GD.PushWarning("test warning"); // Prints "test warning" to debugger and terminal as warning call + + + .. rst-class:: classref-item-separator ---- @@ -6854,10 +6441,19 @@ Given a ``seed``, returns a :ref:`PackedInt64Array` of s Returns a random floating point value between ``0.0`` and ``1.0`` (inclusive). -:: + +.. tabs:: + + .. code-tab:: gdscript randf() # Returns e.g. 0.375671 + .. code-tab:: csharp + + GD.Randf(); // Returns e.g. 0.375671 + + + .. rst-class:: classref-item-separator ---- @@ -6870,11 +6466,21 @@ Returns a random floating point value between ``0.0`` and ``1.0`` (inclusive). Returns a random floating point value between ``from`` and ``to`` (inclusive). -:: + +.. tabs:: + + .. code-tab:: gdscript randf_range(0, 20.5) # Returns e.g. 7.45315 randf_range(-10, 10) # Returns e.g. -3.844535 + .. code-tab:: csharp + + GD.RandRange(0.0, 20.5); // Returns e.g. 7.45315 + GD.RandRange(-10.0, 10.0); // Returns e.g. -3.844535 + + + .. rst-class:: classref-item-separator ---- @@ -6899,13 +6505,25 @@ Returns a normally-distributed pseudo-random floating point value using Box-Mull Returns a random unsigned 32-bit integer. Use remainder to obtain a random value in the interval ``[0, N - 1]`` (where N is smaller than 2^32). -:: + +.. tabs:: + + .. code-tab:: gdscript randi() # Returns random integer between 0 and 2^32 - 1 randi() % 20 # Returns random integer between 0 and 19 randi() % 100 # Returns random integer between 0 and 99 randi() % 100 + 1 # Returns random integer between 1 and 100 + .. code-tab:: csharp + + GD.Randi(); // Returns random integer between 0 and 2^32 - 1 + GD.Randi() % 20; // Returns random integer between 0 and 19 + GD.Randi() % 100; // Returns random integer between 0 and 99 + GD.Randi() % 100 + 1; // Returns random integer between 1 and 100 + + + .. rst-class:: classref-item-separator ---- @@ -6918,11 +6536,21 @@ Returns a random unsigned 32-bit integer. Use remainder to obtain a random value Returns a random signed 32-bit integer between ``from`` and ``to`` (inclusive). If ``to`` is lesser than ``from``, they are swapped. -:: + +.. tabs:: + + .. code-tab:: gdscript randi_range(0, 1) # Returns either 0 or 1 randi_range(-10, 1000) # Returns random integer between -10 and 1000 + .. code-tab:: csharp + + GD.RandRange(0, 1); // Returns either 0 or 1 + GD.RandRange(-10, 1000); // Returns random integer between -10 and 1000 + + + .. rst-class:: classref-item-separator ---- @@ -7041,7 +6669,10 @@ void **seed** **(** :ref:`int` base **)** Sets the seed for the random number generator to ``base``. Setting the seed manually can ensure consistent, repeatable results for most random functions. -:: + +.. tabs:: + + .. code-tab:: gdscript var my_seed = "Godot Rocks".hash() seed(my_seed) @@ -7050,6 +6681,17 @@ Sets the seed for the random number generator to ``base``. Setting the seed manu var b = randf() + randi() # a and b are now identical + .. code-tab:: csharp + + ulong mySeed = (ulong)GD.Hash("Godot Rocks"); + GD.Seed(mySeed); + var a = GD.Randf() + GD.Randi(); + GD.Seed(mySeed); + var b = GD.Randf() + GD.Randi(); + // a and b are now identical + + + .. rst-class:: classref-item-separator ---- @@ -7294,12 +6936,23 @@ Converts one or more arguments of any :ref:`Variant` type to :ref Converts a formatted ``string`` that was returned by :ref:`var_to_str` to the original :ref:`Variant`. -:: + +.. tabs:: + + .. code-tab:: gdscript var a = '{ "a": 1, "b": 2 }' # a is a String var b = str_to_var(a) # b is a Dictionary print(b["a"]) # Prints 1 + .. code-tab:: csharp + + string a = "{ \"a\": 1, \"b\": 2 }"; // a is a string + var b = GD.StrToVar(a).AsGodotDictionary(); // b is a Dictionary + GD.Print(b["a"]); // Prints 1 + + + .. rst-class:: classref-item-separator ---- @@ -7393,18 +7046,28 @@ Encodes a :ref:`Variant` value to a byte array. Encoding objects Converts a :ref:`Variant` ``variable`` to a formatted :ref:`String` that can then be parsed using :ref:`str_to_var`. -:: - a = { "a": 1, "b": 2 } +.. tabs:: + + .. code-tab:: gdscript + + var a = { "a": 1, "b": 2 } print(var_to_str(a)) + .. code-tab:: csharp + + var a = new Godot.Collections.Dictionary { ["a"] = 1, ["b"] = 2 }; + GD.Print(GD.VarToStr(a)); + + + Prints: :: { - "a": 1, - "b": 2 + "a": 1, + "b": 2 } .. rst-class:: classref-item-separator diff --git a/classes/class_aabb.rst b/classes/class_aabb.rst index 7a51d7da8..f6746b71d 100644 --- a/classes/class_aabb.rst +++ b/classes/class_aabb.rst @@ -280,7 +280,7 @@ Returns a copy of this **AABB** expanded to include a given point. .. code-tab:: csharp // position (-3, 2, 0), size (1, 1, 1) - var box = new AABB(new Vector3(-3, 2, 0), new Vector3(1, 1, 1)); + var box = new Aabb(new Vector3(-3, 2, 0), new Vector3(1, 1, 1)); // position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and Vector3(0, -1, 2) var box2 = box.Expand(new Vector3(0, -1, 2)); diff --git a/classes/class_acceptdialog.rst b/classes/class_acceptdialog.rst index 29c3f6b23..0ab313ec2 100644 --- a/classes/class_acceptdialog.rst +++ b/classes/class_acceptdialog.rst @@ -98,11 +98,11 @@ Theme Properties Signals ------- -.. _class_AcceptDialog_signal_cancelled: +.. _class_AcceptDialog_signal_canceled: .. rst-class:: classref-signal -**cancelled** **(** **)** +**canceled** **(** **)** Emitted when the dialog is closed or the button created with :ref:`add_cancel_button` is pressed. @@ -307,7 +307,7 @@ Registers a :ref:`LineEdit` in the dialog. When the enter key is void **remove_button** **(** :ref:`Control` button **)** -Removes the ``button`` from the dialog. Does NOT free the ``button``. The ``button`` must be a :ref:`Button` added with :ref:`add_button` or :ref:`add_cancel_button` method. After removal, pressing the ``button`` will no longer emit this dialog's :ref:`custom_action` or :ref:`cancelled` signals. +Removes the ``button`` from the dialog. Does NOT free the ``button``. The ``button`` must be a :ref:`Button` added with :ref:`add_button` or :ref:`add_cancel_button` method. After removal, pressing the ``button`` will no longer emit this dialog's :ref:`custom_action` or :ref:`canceled` signals. .. rst-class:: classref-section-separator diff --git a/classes/class_animatablebody3d.rst b/classes/class_animatablebody3d.rst index 19706da44..347d2a310 100644 --- a/classes/class_animatablebody3d.rst +++ b/classes/class_animatablebody3d.rst @@ -25,6 +25,8 @@ An animatable body can't be moved by external forces or contacts, but can be mov When the body is moved manually, either from code or from an :ref:`AnimationPlayer` (with :ref:`AnimationPlayer.playback_process_mode` set to ``physics``), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). +\ **Warning:** With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. + .. rst-class:: classref-introduction-group Tutorials diff --git a/classes/class_animatedsprite2d.rst b/classes/class_animatedsprite2d.rst index bca3b504e..156b33180 100644 --- a/classes/class_animatedsprite2d.rst +++ b/classes/class_animatedsprite2d.rst @@ -21,12 +21,6 @@ Description **AnimatedSprite2D** is similar to the :ref:`Sprite2D` node, except it carries multiple textures as animation frames. Animations are created using a :ref:`SpriteFrames` resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The :ref:`SpriteFrames` resource can be configured in the editor via the SpriteFrames bottom panel. -After setting up :ref:`frames`, :ref:`play` may be called. It's also possible to select an :ref:`animation` and toggle :ref:`playing`, even within the editor. - -To pause the current animation, set :ref:`playing` to ``false``. Alternatively, setting :ref:`speed_scale` to ``0`` also preserves the current frame's elapsed time. - -\ **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. - .. rst-class:: classref-introduction-group Tutorials @@ -44,25 +38,27 @@ Properties .. table:: :widths: auto - +-----------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`StringName` | :ref:`animation` | ``&"default"`` | - +-----------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`bool` | :ref:`centered` | ``true`` | - +-----------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`bool` | :ref:`flip_h` | ``false`` | - +-----------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`bool` | :ref:`flip_v` | ``false`` | - +-----------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`int` | :ref:`frame` | ``0`` | - +-----------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`SpriteFrames` | :ref:`frames` | | - +-----------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`offset` | ``Vector2(0, 0)`` | - +-----------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`bool` | :ref:`playing` | ``false`` | - +-----------------------------------------+-----------------------------------------------------------------+-------------------+ - | :ref:`float` | :ref:`speed_scale` | ``1.0`` | - +-----------------------------------------+-----------------------------------------------------------------+-------------------+ + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ + | :ref:`StringName` | :ref:`animation` | ``&"default"`` | + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ + | :ref:`String` | :ref:`autoplay` | ``""`` | + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ + | :ref:`bool` | :ref:`centered` | ``true`` | + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ + | :ref:`bool` | :ref:`flip_h` | ``false`` | + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ + | :ref:`bool` | :ref:`flip_v` | ``false`` | + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ + | :ref:`int` | :ref:`frame` | ``0`` | + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`frame_progress` | ``0.0`` | + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`offset` | ``Vector2(0, 0)`` | + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`speed_scale` | ``1.0`` | + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ + | :ref:`SpriteFrames` | :ref:`sprite_frames` | | + +-----------------------------------------+-----------------------------------------------------------------------+-------------------+ .. rst-class:: classref-reftable-group @@ -72,11 +68,21 @@ Methods .. table:: :widths: auto - +------+---------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`play` **(** :ref:`StringName` anim=&"", :ref:`bool` backwards=false **)** | - +------+---------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`stop` **(** **)** | - +------+---------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_playing_speed` **(** **)** |const| | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_playing` **(** **)** |const| | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`pause` **(** **)** | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`play` **(** :ref:`StringName` name=&"", :ref:`float` custom_speed=1.0, :ref:`bool` from_end=false **)** | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`play_backwards` **(** :ref:`StringName` name=&"" **)** | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_frame_and_progress` **(** :ref:`int` frame, :ref:`float` progress **)** | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`stop` **(** **)** | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -87,13 +93,37 @@ Methods Signals ------- +.. _class_AnimatedSprite2D_signal_animation_changed: + +.. rst-class:: classref-signal + +**animation_changed** **(** **)** + +Emitted when :ref:`animation` changes. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimatedSprite2D_signal_animation_finished: .. rst-class:: classref-signal **animation_finished** **(** **)** -Emitted when the animation reaches the end, or the start if it is played in reverse. If the animation is looping, this signal is emitted at the end of each loop. +Emitted when the animation reaches the end, or the start if it is played in reverse. When the animation finishes, it pauses the playback. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite2D_signal_animation_looped: + +.. rst-class:: classref-signal + +**animation_looped** **(** **)** + +Emitted when the animation loops. .. rst-class:: classref-item-separator @@ -105,7 +135,19 @@ Emitted when the animation reaches the end, or the start if it is played in reve **frame_changed** **(** **)** -Emitted when :ref:`frame` changed. +Emitted when :ref:`frame` changes. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite2D_signal_sprite_frames_changed: + +.. rst-class:: classref-signal + +**sprite_frames_changed** **(** **)** + +Emitted when :ref:`sprite_frames` changes. .. rst-class:: classref-section-separator @@ -127,7 +169,24 @@ Property Descriptions - void **set_animation** **(** :ref:`StringName` value **)** - :ref:`StringName` **get_animation** **(** **)** -The current animation from the :ref:`frames` resource. If this value changes, the ``frame`` counter is reset. +The current animation from the :ref:`sprite_frames` resource. If this value is changed, the :ref:`frame` counter and the :ref:`frame_progress` are reset. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite2D_property_autoplay: + +.. rst-class:: classref-property + +:ref:`String` **autoplay** = ``""`` + +.. rst-class:: classref-property-setget + +- void **set_autoplay** **(** :ref:`String` value **)** +- :ref:`String` **get_autoplay** **(** **)** + +The key of the animation to play when the scene loads. .. rst-class:: classref-item-separator @@ -195,24 +254,24 @@ If ``true``, texture is flipped vertically. - void **set_frame** **(** :ref:`int` value **)** - :ref:`int` **get_frame** **(** **)** -The displayed animation frame's index. +The displayed animation frame's index. Setting this property also resets :ref:`frame_progress`. If this is not desired, use :ref:`set_frame_and_progress`. .. rst-class:: classref-item-separator ---- -.. _class_AnimatedSprite2D_property_frames: +.. _class_AnimatedSprite2D_property_frame_progress: .. rst-class:: classref-property -:ref:`SpriteFrames` **frames** +:ref:`float` **frame_progress** = ``0.0`` .. rst-class:: classref-property-setget -- void **set_sprite_frames** **(** :ref:`SpriteFrames` value **)** -- :ref:`SpriteFrames` **get_sprite_frames** **(** **)** +- void **set_frame_progress** **(** :ref:`float` value **)** +- :ref:`float` **get_frame_progress** **(** **)** -The :ref:`SpriteFrames` resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the :ref:`SpriteFrames` resource. +The progress value between ``0.0`` and ``1.0`` until the current frame transitions to the next frame. If the animation is playing backwards, the value transitions from ``1.0`` to ``0.0``. .. rst-class:: classref-item-separator @@ -235,27 +294,6 @@ The texture's drawing offset. ---- -.. _class_AnimatedSprite2D_property_playing: - -.. rst-class:: classref-property - -:ref:`bool` **playing** = ``false`` - -.. rst-class:: classref-property-setget - -- void **set_playing** **(** :ref:`bool` value **)** -- :ref:`bool` **is_playing** **(** **)** - -If ``true``, the :ref:`animation` is currently playing. Setting this property to ``false`` pauses the current animation. Use :ref:`stop` to stop the animation at the current frame instead. - -\ **Note:** Unlike :ref:`stop`, changing this property to ``false`` preserves the current frame's elapsed time and the ``backwards`` flag of the current :ref:`animation` (if it was previously set by :ref:`play`). - -\ **Note:** After a non-looping animation finishes, the property still remains ``true``. - -.. rst-class:: classref-item-separator - ----- - .. _class_AnimatedSprite2D_property_speed_scale: .. rst-class:: classref-property @@ -267,7 +305,26 @@ If ``true``, the :ref:`animation` is - void **set_speed_scale** **(** :ref:`float` value **)** - :ref:`float` **get_speed_scale** **(** **)** -The animation speed is multiplied by this value. If set to a negative value, the animation is played in reverse. If set to ``0``, the animation is paused, preserving the current frame's elapsed time. +The speed scaling ratio. For example, if this value is ``1``, then the animation plays at normal speed. If it's ``0.5``, then it plays at half speed. If it's ``2``, then it plays at double speed. + +If set to a negative value, the animation is played in reverse. If set to ``0``, the animation will not advance. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite2D_property_sprite_frames: + +.. rst-class:: classref-property + +:ref:`SpriteFrames` **sprite_frames** + +.. rst-class:: classref-property-setget + +- void **set_sprite_frames** **(** :ref:`SpriteFrames` value **)** +- :ref:`SpriteFrames` **get_sprite_frames** **(** **)** + +The :ref:`SpriteFrames` resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the :ref:`SpriteFrames` resource. .. rst-class:: classref-section-separator @@ -278,15 +335,98 @@ The animation speed is multiplied by this value. If set to a negative value, the Method Descriptions ------------------- +.. _class_AnimatedSprite2D_method_get_playing_speed: + +.. rst-class:: classref-method + +:ref:`float` **get_playing_speed** **(** **)** |const| + +Returns the actual playing speed of current animation or ``0`` if not playing. This speed is the :ref:`speed_scale` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play` method. + +Returns a negative value if the current animation is playing backwards. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite2D_method_is_playing: + +.. rst-class:: classref-method + +:ref:`bool` **is_playing** **(** **)** |const| + +Returns ``true`` if an animation is currently playing (even if :ref:`speed_scale` and/or ``custom_speed`` are ``0``). + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite2D_method_pause: + +.. rst-class:: classref-method + +void **pause** **(** **)** + +Pauses the currently playing animation. The :ref:`frame` and :ref:`frame_progress` will be kept and calling :ref:`play` or :ref:`play_backwards` without arguments will resume the animation from the current playback position. + +See also :ref:`stop`. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimatedSprite2D_method_play: .. rst-class:: classref-method -void **play** **(** :ref:`StringName` anim=&"", :ref:`bool` backwards=false **)** +void **play** **(** :ref:`StringName` name=&"", :ref:`float` custom_speed=1.0, :ref:`bool` from_end=false **)** + +Plays the animation with key ``name``. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards`). + +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. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite2D_method_play_backwards: + +.. rst-class:: classref-method + +void **play_backwards** **(** :ref:`StringName` name=&"" **)** + +Plays the animation with key ``name`` in reverse. + +This method is a shorthand for :ref:`play` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite2D_method_set_frame_and_progress: + +.. rst-class:: classref-method + +void **set_frame_and_progress** **(** :ref:`int` frame, :ref:`float` progress **)** + +The setter of :ref:`frame` resets the :ref:`frame_progress` to ``0.0`` implicitly, but this method avoids that. + +This is useful when you want to carry over the current :ref:`frame_progress` to another :ref:`frame`. + +\ **Example:**\ + + +.. tabs:: + + .. code-tab:: gdscript + + # Change the animation with keeping the frame index and progress. + var current_frame = animated_sprite.get_frame() + var current_progress = animated_sprite.get_frame_progress() + animated_sprite.play("walk_another_skin") + animated_sprite.set_frame_and_progress(current_frame, current_progress) -Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played. If ``backwards`` is ``true``, the animation is played in reverse. -\ **Note:** If :ref:`speed_scale` is negative, the animation direction specified by ``backwards`` will be inverted. .. rst-class:: classref-item-separator @@ -298,9 +438,7 @@ Plays the animation named ``anim``. If no ``anim`` is provided, the current anim void **stop** **(** **)** -Stops the current :ref:`animation` at the current :ref:`frame`. - -\ **Note:** This method resets the current frame's elapsed time and removes the ``backwards`` flag from the current :ref:`animation` (if it was previously set by :ref:`play`). If this behavior is undesired, set :ref:`playing` to ``false`` instead. +Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause`. .. |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_animatedsprite3d.rst b/classes/class_animatedsprite3d.rst index 432d1c771..23d039c2b 100644 --- a/classes/class_animatedsprite3d.rst +++ b/classes/class_animatedsprite3d.rst @@ -19,11 +19,7 @@ AnimatedSprite3D Description ----------- -**AnimatedSprite3D** is similar to the :ref:`Sprite3D` node, except it carries multiple textures as animation :ref:`frames`. Animations are created using a :ref:`SpriteFrames` resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The :ref:`SpriteFrames` resource can be configured in the editor via the SpriteFrames bottom panel. - -After setting up :ref:`frames`, :ref:`play` may be called. It's also possible to select an :ref:`animation` and toggle :ref:`playing`, even within the editor. - -To pause the current animation, set :ref:`playing` to ``false``. Alternatively, setting :ref:`speed_scale` to ``0`` also preserves the current frame's elapsed time. +**AnimatedSprite3D** is similar to the :ref:`Sprite3D` node, except it carries multiple textures as animation :ref:`sprite_frames`. Animations are created using a :ref:`SpriteFrames` resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The :ref:`SpriteFrames` resource can be configured in the editor via the SpriteFrames bottom panel. .. rst-class:: classref-introduction-group @@ -40,17 +36,19 @@ Properties .. table:: :widths: auto - +-----------------------------------------+-----------------------------------------------------------------+----------------+ - | :ref:`StringName` | :ref:`animation` | ``&"default"`` | - +-----------------------------------------+-----------------------------------------------------------------+----------------+ - | :ref:`int` | :ref:`frame` | ``0`` | - +-----------------------------------------+-----------------------------------------------------------------+----------------+ - | :ref:`SpriteFrames` | :ref:`frames` | | - +-----------------------------------------+-----------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`playing` | ``false`` | - +-----------------------------------------+-----------------------------------------------------------------+----------------+ - | :ref:`float` | :ref:`speed_scale` | ``1.0`` | - +-----------------------------------------+-----------------------------------------------------------------+----------------+ + +-----------------------------------------+-----------------------------------------------------------------------+----------------+ + | :ref:`StringName` | :ref:`animation` | ``&"default"`` | + +-----------------------------------------+-----------------------------------------------------------------------+----------------+ + | :ref:`String` | :ref:`autoplay` | ``""`` | + +-----------------------------------------+-----------------------------------------------------------------------+----------------+ + | :ref:`int` | :ref:`frame` | ``0`` | + +-----------------------------------------+-----------------------------------------------------------------------+----------------+ + | :ref:`float` | :ref:`frame_progress` | ``0.0`` | + +-----------------------------------------+-----------------------------------------------------------------------+----------------+ + | :ref:`float` | :ref:`speed_scale` | ``1.0`` | + +-----------------------------------------+-----------------------------------------------------------------------+----------------+ + | :ref:`SpriteFrames` | :ref:`sprite_frames` | | + +-----------------------------------------+-----------------------------------------------------------------------+----------------+ .. rst-class:: classref-reftable-group @@ -60,11 +58,21 @@ Methods .. table:: :widths: auto - +------+---------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`play` **(** :ref:`StringName` anim=&"", :ref:`bool` backwards=false **)** | - +------+---------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`stop` **(** **)** | - +------+---------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_playing_speed` **(** **)** |const| | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_playing` **(** **)** |const| | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`pause` **(** **)** | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`play` **(** :ref:`StringName` name=&"", :ref:`float` custom_speed=1.0, :ref:`bool` from_end=false **)** | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`play_backwards` **(** :ref:`StringName` name=&"" **)** | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_frame_and_progress` **(** :ref:`int` frame, :ref:`float` progress **)** | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`stop` **(** **)** | + +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -75,13 +83,37 @@ Methods Signals ------- +.. _class_AnimatedSprite3D_signal_animation_changed: + +.. rst-class:: classref-signal + +**animation_changed** **(** **)** + +Emitted when :ref:`animation` changes. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimatedSprite3D_signal_animation_finished: .. rst-class:: classref-signal **animation_finished** **(** **)** -Emitted when the animation reaches the end, or the start if it is played in reverse. If the animation is looping, this signal is emitted at the end of each loop. +Emitted when the animation reaches the end, or the start if it is played in reverse. When the animation finishes, it pauses the playback. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite3D_signal_animation_looped: + +.. rst-class:: classref-signal + +**animation_looped** **(** **)** + +Emitted when the animation loops. .. rst-class:: classref-item-separator @@ -93,7 +125,19 @@ Emitted when the animation reaches the end, or the start if it is played in reve **frame_changed** **(** **)** -Emitted when :ref:`frame` changed. +Emitted when :ref:`frame` changes. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite3D_signal_sprite_frames_changed: + +.. rst-class:: classref-signal + +**sprite_frames_changed** **(** **)** + +Emitted when :ref:`sprite_frames` changes. .. rst-class:: classref-section-separator @@ -115,7 +159,24 @@ Property Descriptions - void **set_animation** **(** :ref:`StringName` value **)** - :ref:`StringName` **get_animation** **(** **)** -The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset. +The current animation from the :ref:`sprite_frames` resource. If this value is changed, the :ref:`frame` counter and the :ref:`frame_progress` are reset. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite3D_property_autoplay: + +.. rst-class:: classref-property + +:ref:`String` **autoplay** = ``""`` + +.. rst-class:: classref-property-setget + +- void **set_autoplay** **(** :ref:`String` value **)** +- :ref:`String` **get_autoplay** **(** **)** + +The key of the animation to play when the scene loads. .. rst-class:: classref-item-separator @@ -132,45 +193,24 @@ The current animation from the ``frames`` resource. If this value changes, the ` - void **set_frame** **(** :ref:`int` value **)** - :ref:`int` **get_frame** **(** **)** -The displayed animation frame's index. +The displayed animation frame's index. Setting this property also resets :ref:`frame_progress`. If this is not desired, use :ref:`set_frame_and_progress`. .. rst-class:: classref-item-separator ---- -.. _class_AnimatedSprite3D_property_frames: +.. _class_AnimatedSprite3D_property_frame_progress: .. rst-class:: classref-property -:ref:`SpriteFrames` **frames** +:ref:`float` **frame_progress** = ``0.0`` .. rst-class:: classref-property-setget -- void **set_sprite_frames** **(** :ref:`SpriteFrames` value **)** -- :ref:`SpriteFrames` **get_sprite_frames** **(** **)** +- void **set_frame_progress** **(** :ref:`float` value **)** +- :ref:`float` **get_frame_progress** **(** **)** -The :ref:`SpriteFrames` resource containing the animation(s). - -.. rst-class:: classref-item-separator - ----- - -.. _class_AnimatedSprite3D_property_playing: - -.. rst-class:: classref-property - -:ref:`bool` **playing** = ``false`` - -.. rst-class:: classref-property-setget - -- void **set_playing** **(** :ref:`bool` value **)** -- :ref:`bool` **is_playing** **(** **)** - -If ``true``, the :ref:`animation` is currently playing. Setting this property to ``false`` pauses the current animation. Use :ref:`stop` to stop the animation at the current frame instead. - -\ **Note:** Unlike :ref:`stop`, changing this property to ``false`` preserves the current frame's elapsed time and the ``backwards`` flag of the current :ref:`animation` (if it was previously set by :ref:`play`). - -\ **Note:** After a non-looping animation finishes, the property still remains ``true``. +The progress value between ``0.0`` and ``1.0`` until the current frame transitions to the next frame. If the animation is playing backwards, the value transitions from ``1.0`` to ``0.0``. .. rst-class:: classref-item-separator @@ -187,7 +227,26 @@ If ``true``, the :ref:`animation` is - void **set_speed_scale** **(** :ref:`float` value **)** - :ref:`float` **get_speed_scale** **(** **)** -The animation speed is multiplied by this value. If set to a negative value, the animation is played in reverse. If set to ``0``, the animation is paused, preserving the current frame's elapsed time. +The speed scaling ratio. For example, if this value is ``1``, then the animation plays at normal speed. If it's ``0.5``, then it plays at half speed. If it's ``2``, then it plays at double speed. + +If set to a negative value, the animation is played in reverse. If set to ``0``, the animation will not advance. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite3D_property_sprite_frames: + +.. rst-class:: classref-property + +:ref:`SpriteFrames` **sprite_frames** + +.. rst-class:: classref-property-setget + +- void **set_sprite_frames** **(** :ref:`SpriteFrames` value **)** +- :ref:`SpriteFrames` **get_sprite_frames** **(** **)** + +The :ref:`SpriteFrames` resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the :ref:`SpriteFrames` resource. .. rst-class:: classref-section-separator @@ -198,15 +257,98 @@ The animation speed is multiplied by this value. If set to a negative value, the Method Descriptions ------------------- +.. _class_AnimatedSprite3D_method_get_playing_speed: + +.. rst-class:: classref-method + +:ref:`float` **get_playing_speed** **(** **)** |const| + +Returns the actual playing speed of current animation or ``0`` if not playing. This speed is the :ref:`speed_scale` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play` method. + +Returns a negative value if the current animation is playing backwards. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite3D_method_is_playing: + +.. rst-class:: classref-method + +:ref:`bool` **is_playing** **(** **)** |const| + +Returns ``true`` if an animation is currently playing (even if :ref:`speed_scale` and/or ``custom_speed`` are ``0``). + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite3D_method_pause: + +.. rst-class:: classref-method + +void **pause** **(** **)** + +Pauses the currently playing animation. The :ref:`frame` and :ref:`frame_progress` will be kept and calling :ref:`play` or :ref:`play_backwards` without arguments will resume the animation from the current playback position. + +See also :ref:`stop`. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimatedSprite3D_method_play: .. rst-class:: classref-method -void **play** **(** :ref:`StringName` anim=&"", :ref:`bool` backwards=false **)** +void **play** **(** :ref:`StringName` name=&"", :ref:`float` custom_speed=1.0, :ref:`bool` from_end=false **)** + +Plays the animation with key ``name``. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards`). + +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. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite3D_method_play_backwards: + +.. rst-class:: classref-method + +void **play_backwards** **(** :ref:`StringName` name=&"" **)** + +Plays the animation with key ``name`` in reverse. + +This method is a shorthand for :ref:`play` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimatedSprite3D_method_set_frame_and_progress: + +.. rst-class:: classref-method + +void **set_frame_and_progress** **(** :ref:`int` frame, :ref:`float` progress **)** + +The setter of :ref:`frame` resets the :ref:`frame_progress` to ``0.0`` implicitly, but this method avoids that. + +This is useful when you want to carry over the current :ref:`frame_progress` to another :ref:`frame`. + +\ **Example:**\ + + +.. tabs:: + + .. code-tab:: gdscript + + # Change the animation with keeping the frame index and progress. + var current_frame = animated_sprite.get_frame() + var current_progress = animated_sprite.get_frame_progress() + animated_sprite.play("walk_another_skin") + animated_sprite.set_frame_and_progress(current_frame, current_progress) -Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played. If ``backwards`` is ``true``, the animation is played in reverse. -\ **Note:** If :ref:`speed_scale` is negative, the animation direction specified by ``backwards`` will be inverted. .. rst-class:: classref-item-separator @@ -218,9 +360,7 @@ Plays the animation named ``anim``. If no ``anim`` is provided, the current anim void **stop** **(** **)** -Stops the current :ref:`animation` at the current :ref:`frame`. - -\ **Note:** This method resets the current frame's elapsed time and removes the ``backwards`` flag from the current :ref:`animation` (if it was previously set by :ref:`play`). If this behavior is undesired, set :ref:`playing` to ``false`` instead. +Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause`. .. |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_animationnode.rst b/classes/class_animationnode.rst index 637fa5fe0..e798e9e39 100644 --- a/classes/class_animationnode.rst +++ b/classes/class_animationnode.rst @@ -65,6 +65,8 @@ Methods +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_has_filter` **(** **)** |virtual| |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`_is_parameter_read_only` **(** :ref:`StringName` parameter **)** |virtual| |const| | + +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`_process` **(** :ref:`float` time, :ref:`bool` seek, :ref:`bool` is_external_seeking **)** |virtual| |const| | +-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_input` **(** :ref:`String` name **)** | @@ -257,6 +259,18 @@ When inheriting from :ref:`AnimationRootNode`, implemen ---- +.. _class_AnimationNode_method__is_parameter_read_only: + +.. rst-class:: classref-method + +:ref:`bool` **_is_parameter_read_only** **(** :ref:`StringName` parameter **)** |virtual| |const| + +When inheriting from :ref:`AnimationRootNode`, implement this virtual method to return whether the ``parameter`` is read-only. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimationNode_method__process: .. rst-class:: classref-method diff --git a/classes/class_animationnodeoneshot.rst b/classes/class_animationnodeoneshot.rst index e2dac05c5..ff915627c 100644 --- a/classes/class_animationnodeoneshot.rst +++ b/classes/class_animationnodeoneshot.rst @@ -61,6 +61,40 @@ Properties Enumerations ------------ +.. _enum_AnimationNodeOneShot_OneShotRequest: + +.. rst-class:: classref-enumeration + +enum **OneShotRequest**: + +.. _class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_NONE: + +.. rst-class:: classref-enumeration-constant + +:ref:`OneShotRequest` **ONE_SHOT_REQUEST_NONE** = ``0`` + + + +.. _class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_FIRE: + +.. rst-class:: classref-enumeration-constant + +:ref:`OneShotRequest` **ONE_SHOT_REQUEST_FIRE** = ``1`` + + + +.. _class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_ABORT: + +.. rst-class:: classref-enumeration-constant + +:ref:`OneShotRequest` **ONE_SHOT_REQUEST_ABORT** = ``2`` + + + +.. rst-class:: classref-item-separator + +---- + .. _enum_AnimationNodeOneShot_MixMode: .. rst-class:: classref-enumeration diff --git a/classes/class_animationnodestatemachineplayback.rst b/classes/class_animationnodestatemachineplayback.rst index d8d8ed461..85c1c9c49 100644 --- a/classes/class_animationnodestatemachineplayback.rst +++ b/classes/class_animationnodestatemachineplayback.rst @@ -65,23 +65,27 @@ Methods .. table:: :widths: auto - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_current_length` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`StringName` | :ref:`get_current_node` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_current_play_position` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_travel_path` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_playing` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`start` **(** :ref:`StringName` node **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`stop` **(** **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`travel` **(** :ref:`StringName` to_node **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_current_length` **(** **)** |const| | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`get_current_node` **(** **)** |const| | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_current_play_position` **(** **)** |const| | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`get_fading_from_node` **(** **)** |const| | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_travel_path` **(** **)** |const| | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_playing` **(** **)** |const| | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`next` **(** **)** | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`start` **(** :ref:`StringName` node, :ref:`bool` reset=true **)** | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`stop` **(** **)** | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`travel` **(** :ref:`StringName` to_node, :ref:`bool` reset_on_teleport=true **)** | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -130,6 +134,18 @@ Returns the playback position within the current animation state. ---- +.. _class_AnimationNodeStateMachinePlayback_method_get_fading_from_node: + +.. rst-class:: classref-method + +:ref:`StringName` **get_fading_from_node** **(** **)** |const| + +Returns the starting state of currently fading animation. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimationNodeStateMachinePlayback_method_get_travel_path: .. rst-class:: classref-method @@ -154,14 +170,28 @@ Returns ``true`` if an animation is playing. ---- +.. _class_AnimationNodeStateMachinePlayback_method_next: + +.. rst-class:: classref-method + +void **next** **(** **)** + +If there is a next path by travel or auto advance, immediately transitions from the current state to the next state. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimationNodeStateMachinePlayback_method_start: .. rst-class:: classref-method -void **start** **(** :ref:`StringName` node **)** +void **start** **(** :ref:`StringName` node, :ref:`bool` reset=true **)** Starts playing the given animation. +If ``reset`` is ``true``, the animation is played from the beginning. + .. rst-class:: classref-item-separator ---- @@ -182,10 +212,14 @@ Stops the currently playing animation. .. rst-class:: classref-method -void **travel** **(** :ref:`StringName` to_node **)** +void **travel** **(** :ref:`StringName` to_node, :ref:`bool` reset_on_teleport=true **)** Transitions from the current state to another one, following the shortest path. +If the path does not connect from the current state, the animation will play after the state teleports. + +If ``reset_on_teleport`` is ``true``, the animation is played from the beginning when the travel cause a teleportation. + .. |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_animationnodestatemachinetransition.rst b/classes/class_animationnodestatemachinetransition.rst index 88186b946..4799eda8e 100644 --- a/classes/class_animationnodestatemachinetransition.rst +++ b/classes/class_animationnodestatemachinetransition.rst @@ -31,21 +31,23 @@ Properties .. table:: :widths: auto - +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+---------+ - | :ref:`StringName` | :ref:`advance_condition` | ``&""`` | - +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+---------+ - | :ref:`String` | :ref:`advance_expression` | ``""`` | - +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+---------+ - | :ref:`AdvanceMode` | :ref:`advance_mode` | ``1`` | - +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+---------+ - | :ref:`int` | :ref:`priority` | ``1`` | - +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+---------+ - | :ref:`SwitchMode` | :ref:`switch_mode` | ``0`` | - +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+---------+ - | :ref:`Curve` | :ref:`xfade_curve` | | - +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+---------+ - | :ref:`float` | :ref:`xfade_time` | ``0.0`` | - +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+---------+ + +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+ + | :ref:`StringName` | :ref:`advance_condition` | ``&""`` | + +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+ + | :ref:`String` | :ref:`advance_expression` | ``""`` | + +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+ + | :ref:`AdvanceMode` | :ref:`advance_mode` | ``1`` | + +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+ + | :ref:`int` | :ref:`priority` | ``1`` | + +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+ + | :ref:`bool` | :ref:`reset` | ``true`` | + +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+ + | :ref:`SwitchMode` | :ref:`switch_mode` | ``0`` | + +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+ + | :ref:`Curve` | :ref:`xfade_curve` | | + +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+ + | :ref:`float` | :ref:`xfade_time` | ``0.0`` | + +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+ .. rst-class:: classref-section-separator @@ -168,7 +170,7 @@ Turn on auto advance when this condition is set. The provided name will become a .. code-tab:: csharp - GetNode("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.x == 0)); + GetNode("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.X == 0)); @@ -227,6 +229,23 @@ Lower priority transitions are preferred when travelling through the tree via :r ---- +.. _class_AnimationNodeStateMachineTransition_property_reset: + +.. rst-class:: classref-property + +:ref:`bool` **reset** = ``true`` + +.. rst-class:: classref-property-setget + +- void **set_reset** **(** :ref:`bool` value **)** +- :ref:`bool` **is_reset** **(** **)** + +If ``true``, the destination animation is played back from the beginning when switched. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimationNodeStateMachineTransition_property_switch_mode: .. rst-class:: classref-property diff --git a/classes/class_animationnodetransition.rst b/classes/class_animationnodetransition.rst index 5aee0b55b..109ff2934 100644 --- a/classes/class_animationnodetransition.rst +++ b/classes/class_animationnodetransition.rst @@ -43,7 +43,7 @@ Properties +---------------------------+------------------------------------------------------------------------------+----------+ | :ref:`int` | :ref:`enabled_inputs` | ``0`` | +---------------------------+------------------------------------------------------------------------------+----------+ - | :ref:`bool` | :ref:`from_start` | ``true`` | + | :ref:`bool` | :ref:`reset` | ``true`` | +---------------------------+------------------------------------------------------------------------------+----------+ | :ref:`Curve` | :ref:`xfade_curve` | | +---------------------------+------------------------------------------------------------------------------+----------+ @@ -58,6 +58,8 @@ Methods .. table:: :widths: auto + +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`find_input_caption` **(** :ref:`String` caption **)** |const| | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_input_caption` **(** :ref:`int` input **)** |const| | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -88,22 +90,22 @@ Property Descriptions - void **set_enabled_inputs** **(** :ref:`int` value **)** - :ref:`int` **get_enabled_inputs** **(** **)** -The number of enabled input ports for this node. +The number of enabled input ports for this node. The maximum is ``31``. .. rst-class:: classref-item-separator ---- -.. _class_AnimationNodeTransition_property_from_start: +.. _class_AnimationNodeTransition_property_reset: .. rst-class:: classref-property -:ref:`bool` **from_start** = ``true`` +:ref:`bool` **reset** = ``true`` .. rst-class:: classref-property-setget -- void **set_from_start** **(** :ref:`bool` value **)** -- :ref:`bool` **is_from_start** **(** **)** +- void **set_reset** **(** :ref:`bool` value **)** +- :ref:`bool` **is_reset** **(** **)** If ``true``, the destination animation is played back from the beginning when switched. @@ -122,9 +124,7 @@ If ``true``, the destination animation is played back from the beginning when sw - void **set_xfade_curve** **(** :ref:`Curve` value **)** - :ref:`Curve` **get_xfade_curve** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +Determines how cross-fading between animations is eased. If empty, the transition will be linear. .. rst-class:: classref-item-separator @@ -152,15 +152,25 @@ Cross-fading time (in seconds) between each animation connected to the inputs. Method Descriptions ------------------- +.. _class_AnimationNodeTransition_method_find_input_caption: + +.. rst-class:: classref-method + +:ref:`int` **find_input_caption** **(** :ref:`String` caption **)** |const| + +Returns the input index which corresponds to ``caption``. If not found, returns ``-1``. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimationNodeTransition_method_get_input_caption: .. rst-class:: classref-method :ref:`String` **get_input_caption** **(** :ref:`int` input **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns the name of the input at the given ``input`` index. This name is displayed in the editor next to the node input. .. rst-class:: classref-item-separator @@ -172,9 +182,7 @@ Method Descriptions :ref:`bool` **is_input_set_as_auto_advance** **(** :ref:`int` input **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns ``true`` if auto-advance is enabled for the given ``input`` index. .. rst-class:: classref-item-separator @@ -186,9 +194,7 @@ Method Descriptions void **set_input_as_auto_advance** **(** :ref:`int` input, :ref:`bool` enable **)** -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Enables or disables auto-advance for the given ``input`` index. If enabled, state changes to the next input after playing the animation once. If enabled for the last input state, it loops to the first. .. rst-class:: classref-item-separator @@ -200,9 +206,7 @@ void **set_input_as_auto_advance** **(** :ref:`int` input, :ref:`bool void **set_input_caption** **(** :ref:`int` input, :ref:`String` caption **)** -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Sets the name of the input at the given ``input`` index. This name is displayed in the editor next to the node input. .. |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_animationplayer.rst b/classes/class_animationplayer.rst index 38c24e32a..4cfd75784 100644 --- a/classes/class_animationplayer.rst +++ b/classes/class_animationplayer.rst @@ -67,12 +67,12 @@ Properties +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ | :ref:`AnimationProcessCallback` | :ref:`playback_process_mode` | ``1`` | +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ - | :ref:`float` | :ref:`playback_speed` | ``1.0`` | - +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ | :ref:`bool` | :ref:`reset_on_save` | ``true`` | +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ | :ref:`NodePath` | :ref:`root_node` | ``NodePath("..")`` | +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ + | :ref:`float` | :ref:`speed_scale` | ``1.0`` | + +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ .. rst-class:: classref-reftable-group @@ -82,59 +82,63 @@ Methods .. table:: :widths: auto - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`add_animation_library` **(** :ref:`StringName` name, :ref:`AnimationLibrary` library **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`advance` **(** :ref:`float` delta **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`StringName` | :ref:`animation_get_next` **(** :ref:`StringName` anim_from **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`animation_set_next` **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`clear_caches` **(** **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`clear_queue` **(** **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`StringName` | :ref:`find_animation` **(** :ref:`Animation` animation **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`StringName` | :ref:`find_animation_library` **(** :ref:`Animation` animation **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Animation` | :ref:`get_animation` **(** :ref:`StringName` name **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`AnimationLibrary` | :ref:`get_animation_library` **(** :ref:`StringName` name **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`StringName[]` | :ref:`get_animation_library_list` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_animation_list` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_blend_time` **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_playing_speed` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_queue` **(** **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`has_animation` **(** :ref:`StringName` name **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`has_animation_library` **(** :ref:`StringName` name **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_playing` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`play` **(** :ref:`StringName` name="", :ref:`float` custom_blend=-1, :ref:`float` custom_speed=1.0, :ref:`bool` from_end=false **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`play_backwards` **(** :ref:`StringName` name="", :ref:`float` custom_blend=-1 **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`queue` **(** :ref:`StringName` name **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`remove_animation_library` **(** :ref:`StringName` name **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`rename_animation_library` **(** :ref:`StringName` name, :ref:`StringName` newname **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`seek` **(** :ref:`float` seconds, :ref:`bool` update=false **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_blend_time` **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to, :ref:`float` sec **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`stop` **(** :ref:`bool` reset=true **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`_post_process_key_value` **(** :ref:`Animation` animation, :ref:`int` track, :ref:`Variant` value, :ref:`Object` object, :ref:`int` object_idx **)** |virtual| |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`add_animation_library` **(** :ref:`StringName` name, :ref:`AnimationLibrary` library **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`advance` **(** :ref:`float` delta **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`animation_get_next` **(** :ref:`StringName` anim_from **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`animation_set_next` **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`clear_caches` **(** **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`clear_queue` **(** **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`find_animation` **(** :ref:`Animation` animation **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`find_animation_library` **(** :ref:`Animation` animation **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Animation` | :ref:`get_animation` **(** :ref:`StringName` name **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AnimationLibrary` | :ref:`get_animation_library` **(** :ref:`StringName` name **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName[]` | :ref:`get_animation_library_list` **(** **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_animation_list` **(** **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_blend_time` **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_playing_speed` **(** **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_queue` **(** **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_animation` **(** :ref:`StringName` name **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_animation_library` **(** :ref:`StringName` name **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_playing` **(** **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`pause` **(** **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`play` **(** :ref:`StringName` name="", :ref:`float` custom_blend=-1, :ref:`float` custom_speed=1.0, :ref:`bool` from_end=false **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`play_backwards` **(** :ref:`StringName` name="", :ref:`float` custom_blend=-1 **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`queue` **(** :ref:`StringName` name **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_animation_library` **(** :ref:`StringName` name **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`rename_animation_library` **(** :ref:`StringName` name, :ref:`StringName` newname **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`seek` **(** :ref:`float` seconds, :ref:`bool` update=false **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_blend_time` **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to, :ref:`float` sec **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`stop` **(** :ref:`bool` keep_state=false **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -463,23 +467,6 @@ The process notification in which to update animations. ---- -.. _class_AnimationPlayer_property_playback_speed: - -.. rst-class:: classref-property - -:ref:`float` **playback_speed** = ``1.0`` - -.. rst-class:: classref-property-setget - -- void **set_speed_scale** **(** :ref:`float` value **)** -- :ref:`float` **get_speed_scale** **(** **)** - -The speed scaling ratio. For example, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed. - -.. rst-class:: classref-item-separator - ----- - .. _class_AnimationPlayer_property_reset_on_save: .. rst-class:: classref-property @@ -512,6 +499,25 @@ This makes it more convenient to preview and edit animations in the editor, as c The node from which node path references will travel. +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimationPlayer_property_speed_scale: + +.. rst-class:: classref-property + +:ref:`float` **speed_scale** = ``1.0`` + +.. rst-class:: classref-property-setget + +- void **set_speed_scale** **(** :ref:`float` value **)** +- :ref:`float` **get_speed_scale** **(** **)** + +The speed scaling ratio. For example, if this value is ``1``, then the animation plays at normal speed. If it's ``0.5``, then it plays at half speed. If it's ``2``, then it plays at double speed. + +If set to a negative value, the animation is played in reverse. If set to ``0``, the animation will not advance. + .. rst-class:: classref-section-separator ---- @@ -521,6 +527,18 @@ The node from which node path references will travel. Method Descriptions ------------------- +.. _class_AnimationPlayer_method__post_process_key_value: + +.. rst-class:: classref-method + +:ref:`Variant` **_post_process_key_value** **(** :ref:`Animation` animation, :ref:`int` track, :ref:`Variant` value, :ref:`Object` object, :ref:`int` object_idx **)** |virtual| |const| + +A virtual function for processing after key getting during playback. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimationPlayer_method_add_animation_library: .. rst-class:: classref-method @@ -671,7 +689,7 @@ Returns the list of stored animation keys. :ref:`float` **get_blend_time** **(** :ref:`StringName` anim_from, :ref:`StringName` anim_to **)** |const| -Gets the blend time (in seconds) between two animations, referenced by their keys. +Returns the blend time (in seconds) between two animations, referenced by their keys. .. rst-class:: classref-item-separator @@ -683,7 +701,9 @@ Gets the blend time (in seconds) between two animations, referenced by their key :ref:`float` **get_playing_speed** **(** **)** |const| -Gets the actual playing speed of current animation or 0 if not playing. This speed is the :ref:`playback_speed` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play` method. +Returns the actual playing speed of current animation or ``0`` if not playing. This speed is the :ref:`speed_scale` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play` method. + +Returns a negative value if the current animation is playing backwards. .. rst-class:: classref-item-separator @@ -731,7 +751,21 @@ Returns ``true`` if the **AnimationPlayer** stores an :ref:`AnimationLibrary` **is_playing** **(** **)** |const| -Returns ``true`` if playing an animation. +Returns ``true`` if an animation is currently playing (even if :ref:`speed_scale` and/or ``custom_speed`` are ``0``). + +.. rst-class:: classref-item-separator + +---- + +.. _class_AnimationPlayer_method_pause: + +.. rst-class:: classref-method + +void **pause** **(** **)** + +Pauses the currently playing animation. The :ref:`current_animation_position` will be kept and calling :ref:`play` or :ref:`play_backwards` without arguments or with the same animation name as :ref:`assigned_animation` will resume the animation. + +See also :ref:`stop`. .. rst-class:: classref-item-separator @@ -745,7 +779,7 @@ void **play** **(** :ref:`StringName` name="", :ref:`float`). -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. +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. \ **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)``. @@ -835,11 +869,13 @@ Specifies a blend time (in seconds) between two animations, referenced by their .. rst-class:: classref-method -void **stop** **(** :ref:`bool` reset=true **)** +void **stop** **(** :ref:`bool` keep_state=false **)** -Stops or pauses the currently playing animation. If ``reset`` is ``true``, the animation position is reset to ``0`` and the playback speed is reset to ``1.0``. +Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause`. -If ``reset`` is ``false``, the :ref:`current_animation_position` will be kept and calling :ref:`play` or :ref:`play_backwards` without arguments or with the same animation name as :ref:`assigned_animation` will resume the animation. +If ``keep_state`` is ``true``, the animation state is not updated visually. + +\ **Note:** The method / audio / animation playback tracks will not be processed by this method. .. |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_animationtree.rst b/classes/class_animationtree.rst index 5bcd9e1b9..08a2d096b 100644 --- a/classes/class_animationtree.rst +++ b/classes/class_animationtree.rst @@ -62,17 +62,19 @@ Methods .. table:: :widths: auto - +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`advance` **(** :ref:`float` delta **)** | - +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector3` | :ref:`get_root_motion_position` **(** **)** |const| | - +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Quaternion` | :ref:`get_root_motion_rotation` **(** **)** |const| | - +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector3` | :ref:`get_root_motion_scale` **(** **)** |const| | - +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`rename_parameter` **(** :ref:`String` old_name, :ref:`String` new_name **)** | - +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`_post_process_key_value` **(** :ref:`Animation` animation, :ref:`int` track, :ref:`Variant` value, :ref:`Object` object, :ref:`int` object_idx **)** |virtual| |const| | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`advance` **(** :ref:`float` delta **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`get_root_motion_position` **(** **)** |const| | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Quaternion` | :ref:`get_root_motion_rotation` **(** **)** |const| | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`get_root_motion_scale` **(** **)** |const| | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`rename_parameter` **(** :ref:`String` old_name, :ref:`String` new_name **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -248,7 +250,7 @@ The process mode of this **AnimationTree**. See :ref:`AnimationProcessCallback`, :ref:`Animation.TYPE_ROTATION_3D` or :ref:`Animation.TYPE_SCALE_3D` the transformation will be cancelled visually, and the animation will appear to stay in place. See also :ref:`get_root_motion_position`, :ref:`get_root_motion_rotation`, :ref:`get_root_motion_scale` and :ref:`RootMotionView`. +If the track has type :ref:`Animation.TYPE_POSITION_3D`, :ref:`Animation.TYPE_ROTATION_3D` or :ref:`Animation.TYPE_SCALE_3D` the transformation will be canceled visually, and the animation will appear to stay in place. See also :ref:`get_root_motion_position`, :ref:`get_root_motion_rotation`, :ref:`get_root_motion_scale` and :ref:`RootMotionView`. .. rst-class:: classref-item-separator @@ -276,6 +278,18 @@ The root animation node of this **AnimationTree**. See :ref:`AnimationNode` **_post_process_key_value** **(** :ref:`Animation` animation, :ref:`int` track, :ref:`Variant` value, :ref:`Object` object, :ref:`int` object_idx **)** |virtual| |const| + +A virtual function for processing after key getting during playback. + +.. rst-class:: classref-item-separator + +---- + .. _class_AnimationTree_method_advance: .. rst-class:: classref-method diff --git a/classes/class_area3d.rst b/classes/class_area3d.rst index 36f4872db..26e85d9e7 100644 --- a/classes/class_area3d.rst +++ b/classes/class_area3d.rst @@ -25,6 +25,8 @@ To give the area its shape, add a :ref:`CollisionShape3D \ **Warning:** See :ref:`ConcavePolygonShape3D` (also called "trimesh") for a warning about possibly unexpected behavior when using that shape for an area. +\ **Warning:** With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. + .. rst-class:: classref-introduction-group Tutorials diff --git a/classes/class_array.rst b/classes/class_array.rst index 004ababfd..a2604fc4b 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -163,6 +163,8 @@ Methods +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_typed` **(** **)** |const| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`make_read_only` **(** **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`map` **(** :ref:`Callable` method **)** |const| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`max` **(** **)** |const| | @@ -191,8 +193,6 @@ Methods +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rfind` **(** :ref:`Variant` what, :ref:`int` from=-1 **)** |const| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_read_only` **(** :ref:`bool` enable **)** | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_typed` **(** :ref:`int` type, :ref:`StringName` class_name, :ref:`Variant` script **)** | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`shuffle` **(** **)** | @@ -216,23 +216,23 @@ Operators .. table:: :widths: auto - +---------------------------+-------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator !=` **(** :ref:`Array` right **)** | - +---------------------------+-------------------------------------------------------------------------------------------------+ - | :ref:`Array` | :ref:`operator +` **(** :ref:`Array` right **)** | - +---------------------------+-------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator \<` **(** :ref:`Array` right **)** | - +---------------------------+-------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator \<=` **(** :ref:`Array` right **)** | - +---------------------------+-------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator ==` **(** :ref:`Array` right **)** | - +---------------------------+-------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator >` **(** :ref:`Array` right **)** | - +---------------------------+-------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`operator >=` **(** :ref:`Array` right **)** | - +---------------------------+-------------------------------------------------------------------------------------------------+ - | void | :ref:`operator []` **(** :ref:`int` index **)** | - +---------------------------+-------------------------------------------------------------------------------------------------+ + +-------------------------------+-------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator !=` **(** :ref:`Array` right **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------+ + | :ref:`Array` | :ref:`operator +` **(** :ref:`Array` right **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator \<` **(** :ref:`Array` right **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator \<=` **(** :ref:`Array` right **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator ==` **(** :ref:`Array` right **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator >` **(** :ref:`Array` right **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`operator >=` **(** :ref:`Array` right **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`operator []` **(** :ref:`int` index **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -786,7 +786,7 @@ Returns ``true`` if the array is empty. :ref:`bool` **is_read_only** **(** **)** |const| -Returns ``true`` if the array is read-only. See :ref:`set_read_only`. Arrays are automatically read-only if declared with ``const`` keyword. +Returns ``true`` if the array is read-only. See :ref:`make_read_only`. Arrays are automatically read-only if declared with ``const`` keyword. .. rst-class:: classref-item-separator @@ -804,6 +804,18 @@ Returns ``true`` if the array is typed. Typed arrays can only store elements of ---- +.. _class_Array_method_make_read_only: + +.. rst-class:: classref-method + +void **make_read_only** **(** **)** + +Makes the array read-only, i.e. disabled modifying of the array's elements. Does not apply to nested content, e.g. content of nested arrays. + +.. rst-class:: classref-item-separator + +---- + .. _class_Array_method_map: .. rst-class:: classref-method @@ -1013,18 +1025,6 @@ Searches the array in reverse order. Optionally, a start search index can be pas ---- -.. _class_Array_method_set_read_only: - -.. rst-class:: classref-method - -void **set_read_only** **(** :ref:`bool` enable **)** - -Makes the **Array** read-only, i.e. disabled modifying of the array's elements. Does not apply to nested content, e.g. content of nested arrays. - -.. rst-class:: classref-item-separator - ----- - .. _class_Array_method_set_typed: .. rst-class:: classref-method @@ -1268,7 +1268,7 @@ Performs a comparison for each index between the left operand **Array** and the .. rst-class:: classref-operator -void **operator []** **(** :ref:`int` index **)** +:ref:`Variant` **operator []** **(** :ref:`int` index **)** Returns a reference to the element of type :ref:`Variant` at the specified location. Arrays start at index 0. ``index`` can be a zero or positive value to start from the beginning, or a negative value to start from the end. Out-of-bounds array access causes a run-time error, which will result in an error being printed and the project execution pausing if run from the editor. diff --git a/classes/class_arraymesh.rst b/classes/class_arraymesh.rst index 37361e842..47de0c51c 100644 --- a/classes/class_arraymesh.rst +++ b/classes/class_arraymesh.rst @@ -103,45 +103,45 @@ Methods .. table:: :widths: auto - +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | 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:`ArrayFormat` 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:`ArrayFormat` | :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:`ArrayFormat` 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:`ArrayFormat` | :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 **)** | + +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -197,9 +197,7 @@ Overrides the :ref:`AABB` with one defined by user for use with frus - void **set_shadow_mesh** **(** :ref:`ArrayMesh` value **)** - :ref:`ArrayMesh` **get_shadow_mesh** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +An optional mesh which is used for rendering shadows and can be used for the depth prepass. Can be used to increase performance of shadow rendering by using a mesh that only contains vertex position data (without normals, UVs, colors, etc.). .. rst-class:: classref-section-separator @@ -226,13 +224,21 @@ Adds name for a blend shape that will be added with :ref:`add_surface_from_array .. rst-class:: classref-method -void **add_surface_from_arrays** **(** :ref:`PrimitiveType` primitive, :ref:`Array` arrays, :ref:`Array[]` blend_shapes=[], :ref:`Dictionary` lods={}, :ref:`ArrayFormat` compress_flags=0 **)** +void **add_surface_from_arrays** **(** :ref:`PrimitiveType` primitive, :ref:`Array` arrays, :ref:`Array[]` blend_shapes=[], :ref:`Dictionary` lods={}, :ref:`ArrayFormat` flags=0 **)** -Creates a new surface. +Creates a new surface. :ref:`Mesh.get_surface_count` will become the ``surf_idx`` for this new surface. -Surfaces are created to be rendered using a ``primitive``, which may be any of the types defined in :ref:`PrimitiveType`. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) :ref:`Mesh.get_surface_count` will become the ``surf_idx`` for this new surface. +Surfaces are created to be rendered using a ``primitive``, which may be any of the values defined in :ref:`PrimitiveType`. -The ``arrays`` argument is an array of arrays. See :ref:`ArrayType` for the values used in this array. For example, ``arrays[0]`` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array (or be an exact multiple of the vertex array's length, when multiple elements of a sub-array correspond to a single vertex) or be empty, except for :ref:`Mesh.ARRAY_INDEX` if it is used. +The ``arrays`` argument is an array of arrays. Each of the :ref:`Mesh.ARRAY_MAX` elements contains an array with some of the mesh data for this surface as described by the corresponding member of :ref:`ArrayType` or ``null`` if it is not used by the surface. For example, ``arrays[0]`` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this surface into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array (or be an exact multiple of the vertex array's length, when multiple elements of a sub-array correspond to a single vertex) or be empty, except for :ref:`Mesh.ARRAY_INDEX` if it is used. + +The ``blend_shapes`` argument is an array of vertex data for each blend shape. Each element is an array of the same structure as ``arrays``, but :ref:`Mesh.ARRAY_VERTEX`, :ref:`Mesh.ARRAY_NORMAL`, and :ref:`Mesh.ARRAY_TANGENT` are set if and only if they are set in ``arrays`` and all other entries are ``null``. + +The ``lods`` argument is a dictionary with :ref:`float` keys and :ref:`PackedInt32Array` values. Each entry in the dictionary represents a LOD level of the surface, where the value is the :ref:`Mesh.ARRAY_INDEX` array to use for the LOD level and the key is roughly proportional to the distance at which the LOD stats being used. I.e., increasing the key of a LOD also increases the distance that the objects has to be from the camera before the LOD is used. + +The ``flags`` argument is the bitwise or of, as required: One value of :ref:`ArrayCustomFormat` left shifted by ``ARRAY_FORMAT_CUSTOMn_SHIFT`` for each custom channel in use, :ref:`Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE`, :ref:`Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS`, or :ref:`Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY`. + +\ **Note:** When using indices, it is recommended to only use points, lines, or triangles. .. rst-class:: classref-item-separator diff --git a/classes/class_astargrid2d.rst b/classes/class_astargrid2d.rst index beeb868c5..59ae9183a 100644 --- a/classes/class_astargrid2d.rst +++ b/classes/class_astargrid2d.rst @@ -38,11 +38,11 @@ In contrast to :ref:`AStar2D`, you only need set the :ref:`size` **<** :ref:`RefCounted` **<** :ref:`Object` -**Inherited By:** :ref:`AudioStreamGenerator`, :ref:`AudioStreamMicrophone`, :ref:`AudioStreamMP3`, :ref:`AudioStreamOggVorbis`, :ref:`AudioStreamRandomizer`, :ref:`AudioStreamWAV` +**Inherited By:** :ref:`AudioStreamGenerator`, :ref:`AudioStreamMicrophone`, :ref:`AudioStreamMP3`, :ref:`AudioStreamOggVorbis`, :ref:`AudioStreamPolyphonic`, :ref:`AudioStreamRandomizer`, :ref:`AudioStreamWAV` Base class for audio streams. diff --git a/classes/class_audiostreamplayback.rst b/classes/class_audiostreamplayback.rst index be3803a72..ead75f620 100644 --- a/classes/class_audiostreamplayback.rst +++ b/classes/class_audiostreamplayback.rst @@ -12,7 +12,7 @@ AudioStreamPlayback **Inherits:** :ref:`RefCounted` **<** :ref:`Object` -**Inherited By:** :ref:`AudioStreamPlaybackResampled` +**Inherited By:** :ref:`AudioStreamPlaybackPolyphonic`, :ref:`AudioStreamPlaybackResampled` Meta class for playing back audio. diff --git a/classes/class_audiostreamplaybackpolyphonic.rst b/classes/class_audiostreamplaybackpolyphonic.rst new file mode 100644 index 000000000..4545835bc --- /dev/null +++ b/classes/class_audiostreamplaybackpolyphonic.rst @@ -0,0 +1,137 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Godot engine sources. +.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamPlaybackPolyphonic.xml. + +.. _class_AudioStreamPlaybackPolyphonic: + +AudioStreamPlaybackPolyphonic +============================= + +**Inherits:** :ref:`AudioStreamPlayback` **<** :ref:`RefCounted` **<** :ref:`Object` + +Playback instance for :ref:`AudioStreamPolyphonic`. + +.. rst-class:: classref-introduction-group + +Description +----------- + +Playback instance for :ref:`AudioStreamPolyphonic`. After setting the ``stream`` property of :ref:`AudioStreamPlayer`, :ref:`AudioStreamPlayer2D`, or :ref:`AudioStreamPlayer3D`, the playback instance can be obtained by calling :ref:`AudioStreamPlayer.get_stream_playback`, :ref:`AudioStreamPlayer2D.get_stream_playback` or :ref:`AudioStreamPlayer3D.get_stream_playback` methods. + +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_stream_playing` **(** :ref:`int` stream **)** |const| | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`play_stream` **(** :ref:`AudioStream` stream, :ref:`float` from_offset=0, :ref:`float` volume_db=0, :ref:`float` pitch_scale=1.0 **)** | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_stream_pitch_scale` **(** :ref:`int` stream, :ref:`float` pitch_scale **)** | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_stream_volume` **(** :ref:`int` stream, :ref:`float` volume_db **)** | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`stop_stream` **(** :ref:`int` stream **)** | + +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Constants +--------- + +.. _class_AudioStreamPlaybackPolyphonic_constant_INVALID_ID: + +.. rst-class:: classref-constant + +**INVALID_ID** = ``-1`` + +Returned by :ref:`play_stream` in case it could not allocate a stream for playback. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_AudioStreamPlaybackPolyphonic_method_is_stream_playing: + +.. rst-class:: classref-method + +:ref:`bool` **is_stream_playing** **(** :ref:`int` stream **)** |const| + +Return true whether the stream associated with an integer ID is still playing. Check :ref:`play_stream` for information on when this ID becomes invalid. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AudioStreamPlaybackPolyphonic_method_play_stream: + +.. rst-class:: classref-method + +:ref:`int` **play_stream** **(** :ref:`AudioStream` stream, :ref:`float` from_offset=0, :ref:`float` volume_db=0, :ref:`float` pitch_scale=1.0 **)** + +Play an :ref:`AudioStream` at a given offset, volume and pitch scale. Playback starts immediately. + +The return value is an unique integer ID that is associated to this playback stream and which can be used to control it. + +This ID becomes invalid when the stream ends (if it does not loop), when the **AudioStreamPlaybackPolyphonic** is stopped, or when :ref:`stop_stream` is called. + +This function returns :ref:`INVALID_ID` if the amount of streams currently playing equals :ref:`AudioStreamPolyphonic.polyphony`. If you need a higher amount of maximum polyphony, raise this value. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AudioStreamPlaybackPolyphonic_method_set_stream_pitch_scale: + +.. rst-class:: classref-method + +void **set_stream_pitch_scale** **(** :ref:`int` stream, :ref:`float` pitch_scale **)** + +Change the stream pitch scale. The ``stream`` argument is an integer ID returned by :ref:`play_stream`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AudioStreamPlaybackPolyphonic_method_set_stream_volume: + +.. rst-class:: classref-method + +void **set_stream_volume** **(** :ref:`int` stream, :ref:`float` volume_db **)** + +Change the stream volume (in db). The ``stream`` argument is an integer ID returned by :ref:`play_stream`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_AudioStreamPlaybackPolyphonic_method_stop_stream: + +.. rst-class:: classref-method + +void **stop_stream** **(** :ref:`int` stream **)** + +Stop a stream. The ``stream`` argument is an integer ID returned by :ref:`play_stream`, which becomes invalid after calling this function. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_audiostreampolyphonic.rst b/classes/class_audiostreampolyphonic.rst new file mode 100644 index 000000000..1c54877e2 --- /dev/null +++ b/classes/class_audiostreampolyphonic.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Godot engine sources. +.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamPolyphonic.xml. + +.. _class_AudioStreamPolyphonic: + +AudioStreamPolyphonic +===================== + +**Inherits:** :ref:`AudioStream` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` + +AudioStream that lets the user play custom streams at any time from code, simultaneously using a single player. + +.. rst-class:: classref-introduction-group + +Description +----------- + +AudioStream that lets the user play custom streams at any time from code, simultaneously using a single player. + +Playback control is done via the :ref:`AudioStreamPlaybackPolyphonic` instance set inside the player, which can be obtained via :ref:`AudioStreamPlayer.get_stream_playback`, :ref:`AudioStreamPlayer2D.get_stream_playback` or :ref:`AudioStreamPlayer3D.get_stream_playback` methods. Obtaining the playback instance is only valid after the ``stream`` property is set as an **AudioStreamPolyphonic** in those players. + +.. rst-class:: classref-reftable-group + +Properties +---------- + +.. table:: + :widths: auto + + +-----------------------+------------------------------------------------------------------+--------+ + | :ref:`int` | :ref:`polyphony` | ``32`` | + +-----------------------+------------------------------------------------------------------+--------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Property Descriptions +--------------------- + +.. _class_AudioStreamPolyphonic_property_polyphony: + +.. rst-class:: classref-property + +:ref:`int` **polyphony** = ``32`` + +.. rst-class:: classref-property-setget + +- void **set_polyphony** **(** :ref:`int` value **)** +- :ref:`int` **get_polyphony** **(** **)** + +Maximum amount of simultaneous streams that can be played. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` diff --git a/classes/class_backbuffercopy.rst b/classes/class_backbuffercopy.rst index ad06cfb8e..43308c2b5 100644 --- a/classes/class_backbuffercopy.rst +++ b/classes/class_backbuffercopy.rst @@ -12,14 +12,14 @@ BackBufferCopy **Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` -Copies a region of the screen (or the whole screen) to a buffer so it can be accessed in your shader scripts through the ``texture(SCREEN_TEXTURE, ...)`` function. +Copies a region of the screen (or the whole screen) to a buffer so it can be accessed in your shader scripts using the screen texture (i.e. a uniform sampler with ``hint_screen_texture``). .. rst-class:: classref-introduction-group Description ----------- -Node for back-buffering the currently-displayed screen. The region defined in the **BackBufferCopy** node is buffered with the content of the screen it covers, or the entire screen according to the copy mode set. Use the ``texture(SCREEN_TEXTURE, ...)`` function in your shader scripts to access the buffer. +Node for back-buffering the currently-displayed screen. The region defined in the **BackBufferCopy** node is buffered with the content of the screen it covers, or the entire screen according to the copy mode set. Use the screen texture in your shader scripts to access the buffer. \ **Note:** Since this node inherits from :ref:`Node2D` (and not :ref:`Control`), anchors and margins won't apply to child :ref:`Control`-derived nodes. This can be problematic when resizing the window. To avoid this, add :ref:`Control`-derived nodes as *siblings* to the **BackBufferCopy** node instead of adding them as children. diff --git a/classes/class_basebutton.rst b/classes/class_basebutton.rst index f666c8793..d08c024d8 100644 --- a/classes/class_basebutton.rst +++ b/classes/class_basebutton.rst @@ -356,7 +356,7 @@ If ``true``, the button stays pressed when moving the cursor outside the button - void **set_shortcut_feedback** **(** :ref:`bool` value **)** - :ref:`bool` **is_shortcut_feedback** **(** **)** -If ``true``, the button will appear pressed when its shortcut is activated. If ``false`` and :ref:`toggle_mode` is ``false``, the shortcut will activate the button without appearing to press the button. +If ``true``, the button will highlight for a short amount of time when its shortcut is activated. If ``false`` and :ref:`toggle_mode` is ``false``, the shortcut will activate without any visual feedback. .. rst-class:: classref-item-separator diff --git a/classes/class_boneattachment3d.rst b/classes/class_boneattachment3d.rst index 24826d2c9..02aec32fe 100644 --- a/classes/class_boneattachment3d.rst +++ b/classes/class_boneattachment3d.rst @@ -31,11 +31,13 @@ Properties .. table:: :widths: auto - +-----------------------------+-------------------------------------------------------------+--------+ - | :ref:`int` | :ref:`bone_idx` | ``-1`` | - +-----------------------------+-------------------------------------------------------------+--------+ - | :ref:`String` | :ref:`bone_name` | ``""`` | - +-----------------------------+-------------------------------------------------------------+--------+ + +-----------------------------+---------------------------------------------------------------------+-----------+ + | :ref:`int` | :ref:`bone_idx` | ``-1`` | + +-----------------------------+---------------------------------------------------------------------+-----------+ + | :ref:`String` | :ref:`bone_name` | ``""`` | + +-----------------------------+---------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`override_pose` | ``false`` | + +-----------------------------+---------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group @@ -48,20 +50,12 @@ Methods +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`NodePath` | :ref:`get_external_skeleton` **(** **)** |const| | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_override_mode` **(** **)** |const| | - +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`get_override_pose` **(** **)** |const| | - +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_use_external_skeleton` **(** **)** |const| | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`on_bone_pose_update` **(** :ref:`int` bone_index **)** | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_external_skeleton` **(** :ref:`NodePath` external_skeleton **)** | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_override_mode` **(** :ref:`int` override_mode **)** | - +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_override_pose` **(** :ref:`bool` override_pose **)** | - +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_use_external_skeleton` **(** :ref:`bool` use_external_skeleton **)** | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -104,6 +98,23 @@ The index of the attached bone. The name of the attached bone. +.. rst-class:: classref-item-separator + +---- + +.. _class_BoneAttachment3D_property_override_pose: + +.. rst-class:: classref-property + +:ref:`bool` **override_pose** = ``false`` + +.. rst-class:: classref-property-setget + +- void **set_override_pose** **(** :ref:`bool` value **)** +- :ref:`bool` **get_override_pose** **(** **)** + +Whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. When set to ``true``, the BoneAttachment3D node can change the pose of the bone. When set to ``false``, the BoneAttachment3D will always be set to the bone's transform. + .. rst-class:: classref-section-separator ---- @@ -125,32 +136,6 @@ Returns the :ref:`NodePath` to the external :ref:`Skeleton3D` **get_override_mode** **(** **)** |const| - -Deprecated. Local pose overrides will be removed. - -Returns the override mode for the BoneAttachment3D node (0=global / 1=local). - -.. rst-class:: classref-item-separator - ----- - -.. _class_BoneAttachment3D_method_get_override_pose: - -.. rst-class:: classref-method - -:ref:`bool` **get_override_pose** **(** **)** |const| - -Returns whether the BoneAttachment3D node is overriding the bone pose of the bone it's attached to. - -.. rst-class:: classref-item-separator - ----- - .. _class_BoneAttachment3D_method_get_use_external_skeleton: .. rst-class:: classref-method @@ -187,32 +172,6 @@ Sets the :ref:`NodePath` to the external skeleton that the BoneA ---- -.. _class_BoneAttachment3D_method_set_override_mode: - -.. rst-class:: classref-method - -void **set_override_mode** **(** :ref:`int` override_mode **)** - -Deprecated. Local pose overrides will be removed. - -Sets the override mode for the BoneAttachment3D node (0=global / 1=local). The override mode defines which of the bone poses the BoneAttachment3D node will override. - -.. rst-class:: classref-item-separator - ----- - -.. _class_BoneAttachment3D_method_set_override_pose: - -.. rst-class:: classref-method - -void **set_override_pose** **(** :ref:`bool` override_pose **)** - -Sets whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. When set to ``true``, the BoneAttachment3D node can change the pose of the bone. - -.. rst-class:: classref-item-separator - ----- - .. _class_BoneAttachment3D_method_set_use_external_skeleton: .. rst-class:: classref-method diff --git a/classes/class_bool.rst b/classes/class_bool.rst index d234198f1..b892a09c0 100644 --- a/classes/class_bool.rst +++ b/classes/class_bool.rst @@ -91,7 +91,7 @@ The following code will set ``can_shoot`` to ``false`` and start a timer. This w _can_shoot = false _cool_down.start() - func _on_CoolDownTimer_timeout(): + func _on_cool_down_timer_timeout(): _can_shoot = true .. code-tab:: csharp diff --git a/classes/class_callable.rst b/classes/class_callable.rst index 33b822f80..73b31706c 100644 --- a/classes/class_callable.rst +++ b/classes/class_callable.rst @@ -32,22 +32,24 @@ Description func test(): var callable = Callable(self, "print_args") callable.call("hello", "world") # Prints "hello world ". - callable.call(Vector2.UP, 42, callable) # Prints "(0, -1) 42 Node(Node.gd)::print_args". + callable.call(Vector2.UP, 42, callable) # Prints "(0, -1) 42 Node(node.gd)::print_args". callable.call("invalid") # Invalid call, should have at least 2 arguments. .. code-tab:: csharp - public void PrintArgs(object arg1, object arg2, object arg3 = null) + // Default parameter values are not supported. + public void PrintArgs(Variant arg1, Variant arg2, Variant arg3 = default) { GD.PrintS(arg1, arg2, arg3); } public void Test() { - Callable callable = new Callable(this, nameof(PrintArgs)); - callable.Call("hello", "world"); // Prints "hello world null". + // Invalid calls fail silently. + Callable callable = new Callable(this, MethodName.PrintArgs); + callable.Call("hello", "world"); // Default parameter values are not supported, should have 3 arguments. callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.cs)::PrintArgs". - callable.Call("invalid"); // Invalid call, should have at least 2 arguments. + callable.Call("invalid"); // Invalid call, should have 3 arguments. } diff --git a/classes/class_canvasgroup.rst b/classes/class_canvasgroup.rst index 79fc0a875..9cf069871 100644 --- a/classes/class_canvasgroup.rst +++ b/classes/class_canvasgroup.rst @@ -27,8 +27,10 @@ Child :ref:`CanvasItem` nodes of a **CanvasGroup** are drawn a shader_type canvas_item; + uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest; + void fragment() { - vec4 c = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0); + vec4 c = textureLod(screen_texture, SCREEN_UV, 0.0); if (c.a > 0.0001) { c.rgb /= c.a; diff --git a/classes/class_canvasitem.rst b/classes/class_canvasitem.rst index 2231a62ef..5af94b9d7 100644 --- a/classes/class_canvasitem.rst +++ b/classes/class_canvasitem.rst @@ -97,7 +97,7 @@ Methods +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_animation_slice` **(** :ref:`float` animation_length, :ref:`float` slice_begin, :ref:`float` slice_end, :ref:`float` offset=0.0 **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_arc` **(** :ref:`Vector2` center, :ref:`float` radius, :ref:`float` start_angle, :ref:`float` end_angle, :ref:`int` point_count, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | + | void | :ref:`draw_arc` **(** :ref:`Vector2` center, :ref:`float` radius, :ref:`float` start_angle, :ref:`float` end_angle, :ref:`int` point_count, :ref:`Color` color, :ref:`float` width=-1.0, :ref:`bool` antialiased=false **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_char` **(** :ref:`Font` font, :ref:`Vector2` pos, :ref:`String` char, :ref:`int` font_size=16, :ref:`Color` modulate=Color(1, 1, 1, 1) **)** |const| | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -107,21 +107,21 @@ Methods +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_colored_polygon` **(** :ref:`PackedVector2Array` points, :ref:`Color` color, :ref:`PackedVector2Array` uvs=PackedVector2Array(), :ref:`Texture2D` texture=null **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_dashed_line` **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=1.0, :ref:`float` dash=2.0 **)** | + | void | :ref:`draw_dashed_line` **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=-1.0, :ref:`float` dash=2.0, :ref:`bool` aligned=true **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_end_animation` **(** **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_lcd_texture_rect_region` **(** :ref:`Texture2D` texture, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1) **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_line` **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | + | void | :ref:`draw_line` **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=-1.0, :ref:`bool` antialiased=false **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_mesh` **(** :ref:`Mesh` mesh, :ref:`Texture2D` texture, :ref:`Transform2D` transform=Transform2D(1, 0, 0, 1, 0, 0), :ref:`Color` modulate=Color(1, 1, 1, 1) **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_msdf_texture_rect_region` **(** :ref:`Texture2D` texture, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`float` outline=0.0, :ref:`float` pixel_range=4.0, :ref:`float` scale=1.0 **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_multiline` **(** :ref:`PackedVector2Array` points, :ref:`Color` color, :ref:`float` width=1.0 **)** | + | void | :ref:`draw_multiline` **(** :ref:`PackedVector2Array` points, :ref:`Color` color, :ref:`float` width=-1.0 **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_multiline_colors` **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`float` width=1.0 **)** | + | void | :ref:`draw_multiline_colors` **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`float` width=-1.0 **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_multiline_string` **(** :ref:`Font` font, :ref:`Vector2` pos, :ref:`String` text, :ref:`HorizontalAlignment` alignment=0, :ref:`float` width=-1, :ref:`int` font_size=16, :ref:`int` max_lines=-1, :ref:`Color` modulate=Color(1, 1, 1, 1), :ref:`LineBreakFlag` brk_flags=3, :ref:`JustificationFlag` jst_flags=3, :ref:`Direction` direction=0, :ref:`Orientation` orientation=0 **)** |const| | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -131,13 +131,13 @@ Methods +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_polygon` **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`PackedVector2Array` uvs=PackedVector2Array(), :ref:`Texture2D` texture=null **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_polyline` **(** :ref:`PackedVector2Array` points, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | + | void | :ref:`draw_polyline` **(** :ref:`PackedVector2Array` points, :ref:`Color` color, :ref:`float` width=-1.0, :ref:`bool` antialiased=false **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_polyline_colors` **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | + | void | :ref:`draw_polyline_colors` **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`float` width=-1.0, :ref:`bool` antialiased=false **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_primitive` **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`PackedVector2Array` uvs, :ref:`Texture2D` texture=null, :ref:`float` width=1.0 **)** | + | void | :ref:`draw_primitive` **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`PackedVector2Array` uvs, :ref:`Texture2D` texture=null **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_rect` **(** :ref:`Rect2` rect, :ref:`Color` color, :ref:`bool` filled=true, :ref:`float` width=1.0 **)** | + | void | :ref:`draw_rect` **(** :ref:`Rect2` rect, :ref:`Color` color, :ref:`bool` filled=true, :ref:`float` width=-1.0 **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_set_transform` **(** :ref:`Vector2` position, :ref:`float` rotation=0.0, :ref:`Vector2` scale=Vector2(1, 1) **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -800,9 +800,13 @@ Subsequent drawing commands will be ignored unless they fall within the specifie .. rst-class:: classref-method -void **draw_arc** **(** :ref:`Vector2` center, :ref:`float` radius, :ref:`float` start_angle, :ref:`float` end_angle, :ref:`int` point_count, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** +void **draw_arc** **(** :ref:`Vector2` center, :ref:`float` radius, :ref:`float` start_angle, :ref:`float` end_angle, :ref:`int` point_count, :ref:`Color` color, :ref:`float` width=-1.0, :ref:`bool` antialiased=false **)** -Draws a unfilled arc between the given angles. The larger the value of ``point_count``, the smoother the curve. See also :ref:`draw_circle`. +Draws an unfilled arc between the given angles with a uniform ``color`` and ``width`` and optional antialiasing (supported only for positive ``width``). The larger the value of ``point_count``, the smoother the curve. See also :ref:`draw_circle`. + +If ``width`` is negative, then the arc is drawn using :ref:`RenderingServer.PRIMITIVE_LINE_STRIP`. This means that when the CanvasItem is scaled, the arc will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. + +The arc is drawn from ``start_angle`` towards the value of ``end_angle`` so in clockwise direction if ``start_angle < end_angle`` and counter-clockwise otherwise. Passing the same angles but in reversed order will produce the same arc. If absolute difference of ``start_angle`` and ``end_angle`` is greater than :ref:`@GDScript.TAU` radians, then a full circle arc is drawn (i.e. arc will not overlap itself). .. rst-class:: classref-item-separator @@ -860,10 +864,12 @@ Draws a colored polygon of any number of points, convex or concave. Unlike :ref: .. rst-class:: classref-method -void **draw_dashed_line** **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=1.0, :ref:`float` dash=2.0 **)** +void **draw_dashed_line** **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=-1.0, :ref:`float` dash=2.0, :ref:`bool` aligned=true **)** Draws a dashed line from a 2D point to another, with a given color and width. See also :ref:`draw_multiline` and :ref:`draw_polyline`. +If ``width`` is negative, then a two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the line parts will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. + .. rst-class:: classref-item-separator ---- @@ -905,10 +911,12 @@ Texture is drawn using the following blend operation, blend mode of the :ref:`Ca .. rst-class:: classref-method -void **draw_line** **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** +void **draw_line** **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=-1.0, :ref:`bool` antialiased=false **)** Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also :ref:`draw_multiline` and :ref:`draw_polyline`. +If ``width`` is negative, then a two-point primitive will be drawn instead of a four-point one. This means that when the CanvasItem is scaled, the line will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. + .. rst-class:: classref-item-separator ---- @@ -945,10 +953,12 @@ Value of the ``pixel_range`` should the same that was used during distance field .. rst-class:: classref-method -void **draw_multiline** **(** :ref:`PackedVector2Array` points, :ref:`Color` color, :ref:`float` width=1.0 **)** +void **draw_multiline** **(** :ref:`PackedVector2Array` points, :ref:`Color` color, :ref:`float` width=-1.0 **)** Draws multiple disconnected lines with a uniform ``color``. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw interconnected lines, use :ref:`draw_polyline` instead. +If ``width`` is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. + .. rst-class:: classref-item-separator ---- @@ -957,10 +967,12 @@ Draws multiple disconnected lines with a uniform ``color``. When drawing large a .. rst-class:: classref-method -void **draw_multiline_colors** **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`float` width=1.0 **)** +void **draw_multiline_colors** **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`float` width=-1.0 **)** Draws multiple disconnected lines with a uniform ``width`` and segment-by-segment coloring. Colors assigned to line segments match by index between ``points`` and ``colors``. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw interconnected lines, use :ref:`draw_polyline_colors` instead. +If ``width`` is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. + .. rst-class:: classref-item-separator ---- @@ -1017,9 +1029,11 @@ Draws a solid polygon of any number of points, convex or concave. Unlike :ref:`d .. rst-class:: classref-method -void **draw_polyline** **(** :ref:`PackedVector2Array` points, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** +void **draw_polyline** **(** :ref:`PackedVector2Array` points, :ref:`Color` color, :ref:`float` width=-1.0, :ref:`bool` antialiased=false **)** -Draws interconnected line segments with a uniform ``color`` and ``width`` and optional antialiasing. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw disconnected lines, use :ref:`draw_multiline` instead. See also :ref:`draw_polygon`. +Draws interconnected line segments with a uniform ``color`` and ``width`` and optional antialiasing (supported only for positive ``width``). When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw disconnected lines, use :ref:`draw_multiline` instead. See also :ref:`draw_polygon`. + +If ``width`` is negative, the polyline is drawn using :ref:`RenderingServer.PRIMITIVE_LINE_STRIP`. This means that when the CanvasItem is scaled, the polyline will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. .. rst-class:: classref-item-separator @@ -1029,9 +1043,11 @@ Draws interconnected line segments with a uniform ``color`` and ``width`` and op .. rst-class:: classref-method -void **draw_polyline_colors** **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** +void **draw_polyline_colors** **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`float` width=-1.0, :ref:`bool` antialiased=false **)** -Draws interconnected line segments with a uniform ``width`` and segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between ``points`` and ``colors``. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw disconnected lines, use :ref:`draw_multiline_colors` instead. See also :ref:`draw_polygon`. +Draws interconnected line segments with a uniform ``width`` and segment-by-segment coloring, and optional antialiasing (supported only for positive ``width``). Colors assigned to line segments match by index between ``points`` and ``colors``. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw disconnected lines, use :ref:`draw_multiline_colors` instead. See also :ref:`draw_polygon`. + +If ``width`` is negative, then the polyline is drawn using :ref:`RenderingServer.PRIMITIVE_LINE_STRIP`. This means that when the CanvasItem is scaled, the polyline will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. .. rst-class:: classref-item-separator @@ -1041,7 +1057,7 @@ Draws interconnected line segments with a uniform ``width`` and segment-by-segme .. rst-class:: classref-method -void **draw_primitive** **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`PackedVector2Array` uvs, :ref:`Texture2D` texture=null, :ref:`float` width=1.0 **)** +void **draw_primitive** **(** :ref:`PackedVector2Array` points, :ref:`PackedColorArray` colors, :ref:`PackedVector2Array` uvs, :ref:`Texture2D` texture=null **)** Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. If 0 points or more than 4 points are specified, nothing will be drawn and an error message will be printed. See also :ref:`draw_line`, :ref:`draw_polyline`, :ref:`draw_polygon`, and :ref:`draw_rect`. @@ -1053,12 +1069,16 @@ Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for .. rst-class:: classref-method -void **draw_rect** **(** :ref:`Rect2` rect, :ref:`Color` color, :ref:`bool` filled=true, :ref:`float` width=1.0 **)** +void **draw_rect** **(** :ref:`Rect2` rect, :ref:`Color` color, :ref:`bool` filled=true, :ref:`float` width=-1.0 **)** Draws a rectangle. If ``filled`` is ``true``, the rectangle will be filled with the ``color`` specified. If ``filled`` is ``false``, the rectangle will be drawn as a stroke with the ``color`` and ``width`` specified. +If ``width`` is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive ``width`` like ``1.0``. + \ **Note:** ``width`` is only effective if ``filled`` is ``false``. +\ **Note:** Unfilled rectangles drawn with a negative ``width`` may not display perfectly. For example, corners may be missing or brighter due to overlapping lines (for a translucent ``color``). + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_characterbody3d.rst b/classes/class_characterbody3d.rst index 25a3e5863..3407fa3d7 100644 --- a/classes/class_characterbody3d.rst +++ b/classes/class_characterbody3d.rst @@ -21,9 +21,11 @@ Description Character bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a rigid body, these are the same as a :ref:`AnimatableBody3D`. However, they have two main uses: -\ **Kinematic characters:** Character bodies have an API for moving objects with walls and slopes detection (:ref:`move_and_slide` method), in addition to collision detection (also done with :ref:`PhysicsBody3D.move_and_collide`). This makes them really useful to implement characters that move in specific ways and collide with the world, but don't require advanced physics. +\ *Kinematic characters:* Character bodies have an API for moving objects with walls and slopes detection (:ref:`move_and_slide` method), in addition to collision detection (also done with :ref:`PhysicsBody3D.move_and_collide`). This makes them really useful to implement characters that move in specific ways and collide with the world, but don't require advanced physics. -\ **Kinematic motion:** Character bodies can also be used for kinematic motion (same functionality as :ref:`AnimatableBody3D`), which allows them to be moved by code and push other bodies on their path. +\ *Kinematic motion:* Character bodies can also be used for kinematic motion (same functionality as :ref:`AnimatableBody3D`), which allows them to be moved by code and push other bodies on their path. + +\ **Warning:** With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. .. rst-class:: classref-introduction-group diff --git a/classes/class_codeedit.rst b/classes/class_codeedit.rst index 837e476db..e20950c2a 100644 --- a/classes/class_codeedit.rst +++ b/classes/class_codeedit.rst @@ -118,8 +118,6 @@ Methods +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`do_indent` **(** **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`do_unindent` **(** **)** | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fold_all_lines` **(** **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fold_line` **(** :ref:`int` line **)** | @@ -1013,18 +1011,6 @@ Perform an indent as if the user activated the "ui_text_indent" action. ---- -.. _class_CodeEdit_method_do_unindent: - -.. rst-class:: classref-method - -void **do_unindent** **(** **)** - -Perform an unindent as if the user activated the "ui_text_unindent" action. - -.. rst-class:: classref-item-separator - ----- - .. _class_CodeEdit_method_fold_all_lines: .. rst-class:: classref-method @@ -1523,7 +1509,7 @@ Unfolds all lines that were previously folded. void **unindent_lines** **(** **)** -Unindents selected lines, or in the case of no selection the caret line by one. +Unindents selected lines, or in the case of no selection the caret line by one. Same as performing "ui_text_unindent" action. .. rst-class:: classref-item-separator diff --git a/classes/class_collisionobject3d.rst b/classes/class_collisionobject3d.rst index c9b3e64e6..9766d82f9 100644 --- a/classes/class_collisionobject3d.rst +++ b/classes/class_collisionobject3d.rst @@ -23,6 +23,8 @@ Description CollisionObject3D is the base class for physics objects. It can hold any number of collision :ref:`Shape3D`\ s. Each shape must be assigned to a *shape owner*. The CollisionObject3D can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the ``shape_owner_*`` methods. +\ **Warning:** With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. + .. rst-class:: classref-reftable-group Properties @@ -130,7 +132,7 @@ Emitted when the object receives an unhandled :ref:`InputEvent Emitted when the mouse pointer enters any of this object's shapes. Requires :ref:`input_ray_pickable` to be ``true`` and at least one :ref:`collision_layer` bit to be set. -\ **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the :ref:`CollisionObject2D`'s area is small. This signal may also not be emitted if another :ref:`CollisionObject2D` is overlapping the :ref:`CollisionObject2D` in question. +\ **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the **CollisionObject3D**'s area is small. This signal may also not be emitted if another **CollisionObject3D** is overlapping the **CollisionObject3D** in question. .. rst-class:: classref-item-separator @@ -144,7 +146,7 @@ Emitted when the mouse pointer enters any of this object's shapes. Requires :ref Emitted when the mouse pointer exits all this object's shapes. Requires :ref:`input_ray_pickable` to be ``true`` and at least one :ref:`collision_layer` bit to be set. -\ **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the :ref:`CollisionObject2D`'s area is small. This signal may also not be emitted if another :ref:`CollisionObject2D` is overlapping the :ref:`CollisionObject2D` in question. +\ **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the **CollisionObject3D**'s area is small. This signal may also not be emitted if another **CollisionObject3D** is overlapping the **CollisionObject3D** in question. .. rst-class:: classref-section-separator @@ -177,7 +179,7 @@ Automatically re-added to the physics simulation when the :ref:`Node :ref:`DisableMode` **DISABLE_MODE_MAKE_STATIC** = ``1`` -When :ref:`Node.process_mode` is set to :ref:`Node.PROCESS_MODE_DISABLED`, make the body static. Doesn't affect :ref:`Area2D`. :ref:`PhysicsBody3D` can't be affected by forces or other bodies while static. +When :ref:`Node.process_mode` is set to :ref:`Node.PROCESS_MODE_DISABLED`, make the body static. Doesn't affect :ref:`Area3D`. :ref:`PhysicsBody3D` can't be affected by forces or other bodies while static. Automatically set :ref:`PhysicsBody3D` back to its original mode when the :ref:`Node` is processed again. diff --git a/classes/class_collisionpolygon3d.rst b/classes/class_collisionpolygon3d.rst index 6caef1ae7..80afbc92c 100644 --- a/classes/class_collisionpolygon3d.rst +++ b/classes/class_collisionpolygon3d.rst @@ -23,6 +23,8 @@ Allows editing a concave or convex collision polygon's vertices on a selected pl \ **Note:** Since this is an editor-only helper, properties modified during gameplay will have no effect. +\ **Warning:** A non-uniformly scaled CollisionPolygon3D node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change its :ref:`polygon`'s vertices instead. + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_collisionshape3d.rst b/classes/class_collisionshape3d.rst index 554654876..19398fcaa 100644 --- a/classes/class_collisionshape3d.rst +++ b/classes/class_collisionshape3d.rst @@ -23,6 +23,8 @@ Editor facility for creating and editing collision shapes in 3D space. Set the : You can use this node to represent all sorts of collision shapes, for example, add this to an :ref:`Area3D` to give it a detection shape, or add it to a :ref:`PhysicsBody3D` to create a solid object. +\ **Warning:** A non-uniformly scaled CollisionShape3D node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size of its :ref:`shape` resource instead. + .. rst-class:: classref-introduction-group Tutorials diff --git a/classes/class_color.rst b/classes/class_color.rst index cab1d374e..f1a5fd47d 100644 --- a/classes/class_color.rst +++ b/classes/class_color.rst @@ -1635,7 +1635,7 @@ Method Descriptions :ref:`Color` **blend** **(** :ref:`Color` over **)** |const| -Returns a new color resulting from overlaying this color over the given color. In a painting program, you can imagine it as the ``over`` color painted over this colour (including alpha). +Returns a new color resulting from overlaying this color over the given color. In a painting program, you can imagine it as the ``over`` color painted over this color (including alpha). .. tabs:: diff --git a/classes/class_confirmationdialog.rst b/classes/class_confirmationdialog.rst index fa8b3aacc..7ab479c1d 100644 --- a/classes/class_confirmationdialog.rst +++ b/classes/class_confirmationdialog.rst @@ -30,11 +30,11 @@ To get cancel action, you can use: .. code-tab:: gdscript - get_cancel_button().pressed.connect(self.cancelled) + get_cancel_button().pressed.connect(self.canceled) .. code-tab:: csharp - GetCancelButton().Pressed += Cancelled; + GetCancelButton().Pressed += Canceled; diff --git a/classes/class_control.rst b/classes/class_control.rst index d18ec88ae..66554bdd2 100644 --- a/classes/class_control.rst +++ b/classes/class_control.rst @@ -165,7 +165,7 @@ Methods +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`_make_custom_tooltip` **(** :ref:`String` for_text **)** |virtual| |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i[]` | :ref:`_structured_text_parser` **(** :ref:`Array` args, :ref:`String` text **)** |virtual| |const| | + | :ref:`Vector3i[]` | :ref:`_structured_text_parser` **(** :ref:`Array` args, :ref:`String` text **)** |virtual| |const| | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`accept_event` **(** **)** | +----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -1632,7 +1632,7 @@ By default, the node's pivot is its top-left corner. When you change its :ref:`r - :ref:`Vector2` **get_position** **(** **)** -The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by :ref:`pivot_offset`. +The node's position, relative to its containing node. It corresponds to the rectangle's top-left corner. The property is not affected by :ref:`pivot_offset`. .. rst-class:: classref-item-separator @@ -1720,7 +1720,7 @@ The :ref:`Node` which must be a parent of the focused **Control** fo - :ref:`Vector2` **get_size** **(** **)** -The size of the node's bounding rectangle, in pixels. :ref:`Container` nodes update this property automatically. +The size of the node's bounding rectangle, in the node's coordinate system. :ref:`Container` nodes update this property automatically. .. rst-class:: classref-item-separator @@ -2104,7 +2104,7 @@ The returned node will be added as child to a :ref:`PopupPanel .. code-tab:: gdscript func _make_custom_tooltip(for_text): - var tooltip = preload("res://SomeTooltipScene.tscn").instantiate() + var tooltip = preload("res://some_tooltip_scene.tscn").instantiate() tooltip.get_node("Label").text = for_text return tooltip @@ -2112,7 +2112,7 @@ The returned node will be added as child to a :ref:`PopupPanel public override Godot.Control _MakeCustomTooltip(String forText) { - Node tooltip = ResourceLoader.Load("res://SomeTooltipScene.tscn").Instantiate(); + Node tooltip = ResourceLoader.Load("res://some_tooltip_scene.tscn").Instantiate(); tooltip.GetNode