mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 19:29:06 +00:00
classref: Sync with current master branch (42c7f14)
This commit is contained in:
+10
-9
@@ -127,7 +127,7 @@ You should avoid using more than one **Tween** per object's property. If two or
|
||||
.. code-tab:: csharp
|
||||
|
||||
private Tween _tween;
|
||||
|
||||
|
||||
public void Animate()
|
||||
{
|
||||
if (_tween != null)
|
||||
@@ -749,7 +749,7 @@ If ``parallel`` is ``true``, the :ref:`Tweener<class_Tweener>`\ s appended after
|
||||
|
||||
:ref:`Tween<class_Tween>` **set_pause_mode**\ (\ mode\: :ref:`TweenPauseMode<enum_Tween_TweenPauseMode>`\ ) :ref:`🔗<class_Tween_method_set_pause_mode>`
|
||||
|
||||
Determines the behavior of the **Tween** when the :ref:`SceneTree<class_SceneTree>` is paused. Check :ref:`TweenPauseMode<enum_Tween_TweenPauseMode>` for options.
|
||||
Determines the behavior of the **Tween** when the :ref:`SceneTree<class_SceneTree>` is paused.
|
||||
|
||||
Default value is :ref:`TWEEN_PAUSE_BOUND<class_Tween_constant_TWEEN_PAUSE_BOUND>`.
|
||||
|
||||
@@ -817,14 +817,14 @@ Stops the tweening and resets the **Tween** to its initial state. This will not
|
||||
::
|
||||
|
||||
var tween = create_tween()
|
||||
|
||||
|
||||
# Will move from 0 to 500 over 1 second.
|
||||
position.x = 0.0
|
||||
tween.tween_property(self, "position:x", 500, 1.0)
|
||||
|
||||
|
||||
# Will be at (about) 250 when the timer finishes.
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
|
||||
|
||||
# Will now move from (about) 250 to 500 over 1 second,
|
||||
# thus at half the speed as before.
|
||||
tween.stop()
|
||||
@@ -978,7 +978,7 @@ Creates and appends a :ref:`MethodTweener<class_MethodTweener>`. This method is
|
||||
func _ready():
|
||||
var tween = create_tween()
|
||||
tween.tween_method(set_label_text, 0, 10, 1.0).set_delay(1.0)
|
||||
|
||||
|
||||
func set_label_text(value: int):
|
||||
$Label.text = "Counting " + str(value)
|
||||
|
||||
@@ -987,11 +987,11 @@ Creates and appends a :ref:`MethodTweener<class_MethodTweener>`. This method is
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
|
||||
|
||||
Tween tween = CreateTween();
|
||||
tween.TweenMethod(Callable.From<int>(SetLabelText), 0.0f, 10.0f, 1.0f).SetDelay(1.0f);
|
||||
}
|
||||
|
||||
|
||||
private void SetLabelText(int value)
|
||||
{
|
||||
GetNode<Label>("Label").Text = $"Counting {value}";
|
||||
@@ -1069,7 +1069,7 @@ Creates and appends a :ref:`SubtweenTweener<class_SubtweenTweener>`. This method
|
||||
var subtween = create_tween()
|
||||
subtween.tween_property(self, "rotation_degrees", 45.0, 1.0)
|
||||
subtween.tween_property(self, "rotation_degrees", 0.0, 1.0)
|
||||
|
||||
|
||||
# Parent tween will execute the subtween as one of its steps.
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "position:x", 500, 3.0)
|
||||
@@ -1081,6 +1081,7 @@ Creates and appends a :ref:`SubtweenTweener<class_SubtweenTweener>`. This method
|
||||
\ **Note:** The pause and process modes set by :ref:`set_pause_mode()<class_Tween_method_set_pause_mode>` and :ref:`set_process_mode()<class_Tween_method_set_process_mode>` on ``subtween`` will be overridden by the parent **Tween**'s settings.
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |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.)`
|
||||
|
||||
Reference in New Issue
Block a user