Class PropertyTweener
- Namespace
- Godot
- Assembly
- GodotSharp.dll
PropertyTweener is used to interpolate a property in an object. See TweenProperty(GodotObject, NodePath, Variant, double) for more usage information.
Note: TweenProperty(GodotObject, NodePath, Variant, double) is the only correct way to create PropertyTweener. Any PropertyTweener created manually will not function correctly.
public class PropertyTweener : Tweener, IDisposable
- Inheritance
-
PropertyTweener
- Implements
- Inherited Members
Constructors
PropertyTweener()
public PropertyTweener()
Methods
AsRelative()
When called, the final value will be used as a relative value instead.
Example:
var tween = get_tree().create_tween()
tween.tween_property(self, "position", Vector2.RIGHT * 100, 1).as_relative() #the node will move by 100 pixels to the right
public PropertyTweener AsRelative()
Returns
From(Variant)
Sets a custom initial value to the PropertyTweener.
Example:
var tween = get_tree().create_tween()
tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100)) #this will move the node from position (100, 100) to (200, 100)
public PropertyTweener From(Variant value)
Parameters
value
Variant
Returns
FromCurrent()
Makes the PropertyTweener use the current property value (i.e. at the time of creating this PropertyTweener) as a starting point. This is equivalent of using From(Variant) with the current value. These two calls will do the same:
tween.tween_property(self, "position", Vector2(200, 100), 1).from(position)
tween.tween_property(self, "position", Vector2(200, 100), 1).from_current()
public PropertyTweener FromCurrent()
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
SetDelay(double)
Sets the time in seconds after which the PropertyTweener will start interpolating. By default there's no delay.
public PropertyTweener SetDelay(double delay)
Parameters
delay
double
Returns
SetEase(EaseType)
Sets the type of used easing from Tween.EaseType. If not set, the default easing is used from the Tween that contains this Tweener.
public PropertyTweener SetEase(Tween.EaseType ease)
Parameters
Returns
SetTrans(TransitionType)
Sets the type of used transition from Tween.TransitionType. If not set, the default transition is used from the Tween that contains this Tweener.
public PropertyTweener SetTrans(Tween.TransitionType trans)
Parameters
trans
Tween.TransitionType