godot-extended-libraries / godot-next

Godot Node Extensions - Basic Node Extensions for Godot Engine
MIT License
957 stars 61 forks source link

Tween Sequence can be removed #103

Open KoBeWi opened 2 years ago

KoBeWi commented 2 years ago

After https://github.com/godotengine/godot/pull/60581 was merged, Godot's 3.x branch now officially includes the same Tween system as in Godot 4.0 (as a separate class, SceneTreeTween), which is based on TweenSequence, but superior in many ways. Thus TweenSequence class can now be removed. Also it became incompatible with the newest 3.5, as Tweener class shadows the Tweener in core.

For anyone who wants to continue using TweenSequence in the newest Godot 3.5, they need to rename all Tweener classes to e.g. Tweener2, PropertyTweener2 etc. They are used only internally, so it will be fine.

But I'd suggest everyone to just switch to the new SceneTreeTween. Here's a quick migration guide: var tween = TweenSequence.new(get_tree()) -> var tween = create_tween() tween.append(...) -> tween.tween_property() tween.append_advance(...) -> tween.tween_property(...).as_relative() tween.append_interval(...) -> tween.tween_interval(...) tween.append_callback(...) -> tween.tween_callback(...) tween.append_method(...) -> tween.tween_method(...) tween.set_loops(x) -> tween.set_loops(x + 1) tween.set_speed(...) -> tween.set_speed_scale(...)

Aside from these renames, the new SceneTreeTween (and Tween in 4.0) API is compatible with the TweenSequence code. SceneTreeTween will also work much more reliably.