From d6a42081ae41151e7065a21bfb55160588013097 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Wed, 7 Dec 2022 20:41:52 +0300 Subject: [PATCH] Update Y Sort and add `String.right()` in Upgrading to Godot 4 (#6464) Co-authored-by: Hugo Locurcio --- tutorials/editor/upgrading_to_godot_4.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tutorials/editor/upgrading_to_godot_4.rst b/tutorials/editor/upgrading_to_godot_4.rst index 3e453566ada..85f5ca19444 100644 --- a/tutorials/editor/upgrading_to_godot_4.rst +++ b/tutorials/editor/upgrading_to_godot_4.rst @@ -478,7 +478,7 @@ The most notable examples of this are: GDScript. This allows for greater optimization, as StringName is specifically designed to be used for "constant" strings that are created once and reused many times. These types are not equivalent to each other, which means - ``"example") == &"example"`` returns ``false`` (``&`` creates a StringName). + ``"example" == &"example"`` returns ``false`` (``&`` creates a StringName). This should be taken into account for ``if`` and ``match`` comparisons in particular, as you may have to replace ``"example"`` with ``&"example"``. - :ref:`GDScript setter and getter syntax ` @@ -534,6 +534,10 @@ The most notable examples of this are: - A :ref:`class_StreamPeerTCP` must have ``poll()`` called on it to update its state, instead of relying on ``get_status()`` automatically polling: `GH-59582 `__ +- :ref:`class_String`'s ``right()`` method `has changed behavior `__: + it now returns a number of characters from the right of the string, rather than + the right side of the string from a given position. If you need the old behavior, + you can use ``substr()`` instead. - ``is_connected_to_host()`` was removed from StreamPeerTCP and PacketPeerUDP as per `GH-59582 `__. ``get_status()`` can be used in StreamPeerTCP instead. @@ -573,7 +577,7 @@ converter doesn't support updating existing setups: +---------------------+-----------------------+----------------------------------------------------------------------------+ | ToolButton | Button | ToolButton was Button with the **Flat** property enabled by default. | +---------------------+-----------------------+----------------------------------------------------------------------------+ -| YSort | Node2D | Node2D has a new **Y Sort** property in 4.0. | +| YSort | Node2D or Control | CanvasItem has a new **Y Sort Enabled** property in 4.0. | +---------------------+-----------------------+----------------------------------------------------------------------------+ | ProximityGroup | Node3D | :ref:`class_VisibleOnScreenNotifier3D` can act as a replacement. | +---------------------+-----------------------+----------------------------------------------------------------------------+