1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

79 Commits

Author SHA1 Message Date
kobewi
e6783dbdd1 Improve to_string() and add it to Resource 2025-10-09 00:54:38 +02:00
Malcolm Anderson
9ad608691b Kill subtweens when their parent tween is killed
# Conflicts:
#	scene/animation/tween.h
2025-09-29 15:11:19 -07:00
kobewi
0108e2f82f Change list of Tweeners from Vector to LocalVector 2025-09-19 22:36:07 +02:00
kobewi
b615c7b3db Block Tween custom_step() during step 2025-06-26 12:27:53 +02:00
Silc Lizard (Tokage) Renew
678fb63451 Fix ambiguous AnimationNode's parameter type in default value
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2025-06-05 10:02:22 +09:00
kobewi
8f657977fc Fix final tween value with custom interpolator 2025-03-24 22:55:57 +01:00
Thaddeus Crews
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
kobewi
ccc134fd1b Tween code improvements 2025-01-07 01:21:23 +01:00
Malcolm Anderson
be266138d7 Add tween_subtween method for nesting Tweens
No actual functionality yet

Actual subtween functionality implemented

Added documentation for Tween.tween_subtween and SubtweenTweener

Implemented some additional functions

`set_ease`, `set_trans`, and `set_delay`
Documentation only for `set_delay` so far, since I have tested it

Removed set_ease and set_trans

Upon further investigation, the way they are implemented for Tween doesn't appear to work here

Fixed indentation in documentation

Reset subtween when parent loops

Fix return type of `SubtweenTweener.set_delay`

Add notes to documentation

Apply suggestions from code review

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>

Apply some suggested changes

- Remove excessive documentation
- Add Tween constructor that takes in SceneTree
- Make `SubtweenTweener::subtween` public so that `Tween` doesn't have to be a friend class

Remove unneeded friend class SceneTree

Remove superfluous documentation describing subtween behavior

Apply suggestions from code review

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>

Apply suggestions from code review

Co-authored-by: Thaddeus Crews <repiteo@outlook.com>

Apply suggestions from code review

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>

Early return from `tween_subtween` if the subtween is `null`
2025-01-03 14:28:48 -08:00
tvenclovas96_bigblackc
dbc0cc1437 Add Tween::ignore_time_scale 2024-12-22 18:39:54 +02:00
kobewi
761d988d47 Add internal _finish() method to Tweener 2024-08-15 08:41:51 +02:00
A Thousand Ships
92814bafb7 [Animation] Improvements to Tween memory management
Using `ObjectID` instead of manually breaking reference cycles.
2024-02-26 18:58:03 +01:00
Rémi Verschelde
e45cc1781b Merge pull request #82306 from KoBeWi/tween_literally_anything
Add `set_custom_interpolator()` to PropertyTweener
2024-02-17 00:22:45 +01:00
kobewi
20aecefd9b Fix Tween loop initial value 2023-12-02 20:20:50 +01:00
kobewi
58f4984d60 Add set_custom_interpolator() to PropertyTweener 2023-10-12 16:41:51 +02:00
Rakka Rage
780e21bcac Add TRANS_SPRING to Tween 2023-05-17 17:54:37 -04:00
kobewi
20f03884f2 Various Tween code improvements 2023-04-03 15:40:02 +02:00
John Pennycook
4cb2085543 Add get_loops_left() function to Tween
Implements godotengine/godot-proposals#5141.

Adds a new get_loops_left() function to Tween, allowing developers to
reason about how many times a tweening sequence will repeat and whether
to expect finished or loop_finished as the next signal.

Co-authored-by: Tomek <kobewi4e@gmail.com>
2023-03-20 20:49:31 -07:00
kobewi
45f4d59fa4 Check for type mismatch in PropertyTweener.from() 2023-02-28 17:16:56 +01:00
kobewi
17fe5c2b23 Fix tween_method() type validation 2023-02-12 22:08:25 +01:00
kobewi
1260cb0bfb Improve empty Tween error message 2023-01-16 10:30:21 +01:00
kobewi
f64dd732b8 Improve some Tween internals 2023-01-11 14:08:14 +01:00
Rémi Verschelde
d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
kobewi
a6e02f149f Improve RefCounted support in Tween 2023-01-01 18:45:17 +01:00
Dave Palais
0c46068af0 Change time parameters and variables to double type
Addresses #65313
2022-09-26 13:52:54 -05:00
Silc Renew
9d47e079b7 Move some methods to Animation from Variant for refactoring 2022-09-15 04:52:43 +09:00
Rémi Verschelde
90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
kobewi
f473aab00d Improve Tween infinite loop detection 2022-05-01 00:24:07 +02:00
kobewi
3017530e26 Make Tween.interpolate_value() static 2022-04-17 23:13:39 +02:00
Rémi Verschelde
6bbd4def45 Merge pull request #59415 from KoBeWi/tween_time() 2022-04-02 00:31:40 +02:00
kobewi
e04ae8c8bc Add get_total_elapsed_time() to Tween 2022-03-29 13:34:05 +02:00
kobewi
d48dea7158 Force final value at the end of Tween 2022-03-27 03:09:12 +02:00
kobewi
205f56f226 Fix Tween pause behavior 2022-01-09 19:38:18 +01:00
Rémi Verschelde
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
kobewi
266955d15f Improvements to Tweens' Variant types 2021-09-16 02:08:26 +02:00
kobewi
e092a132fe Various fixes to Tween code 2021-08-06 13:07:34 +02:00
Tomasz Chabora
900b2e0fdc Complete rewrite of Tweens
* Tweens were changed from Node to RefCounted. New API is inspired by DOTween.
* Tweens are created and managed by SceneTree, similar to SceneTreeTimer, which makes them ultra cheap to use a lot.
* Animating with Tweens is done by creating sequences of Tweeners. You create them from code and they autostart by default (fire-and-forget).
* There are 4 Tweeners that cover the former Tween functionality: PropertyTweener, IntervalTweener, CallbackTweener and MethodTweener.
* The methods were simplified a lot. Long argument lists are replaced with chained calls on Tweens and Tweeners.
* Tweeners by default execute in sequence, so it's easy to create complex chained animations.
* You can bind a Tween to a node. Tween will be removed automatically when the bound node is freed.
2021-06-19 12:08:50 +02:00
jmb462
b3d7adc7d6 fix no tween repeat after stop_all() and start() again 2021-03-03 00:55:17 +01:00
Rafał Mikrut
003bb8e1a8 Initialize class variables with default values in scene/ [1/2] 2021-02-07 22:29:31 +01:00
Rémi Verschelde
b5334d14f7 Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Aaron Franke
02161aad5a Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00
Rémi Verschelde
0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Yuri Roubinsky
d5bff588c7 Removed boolean return type from majority of method in Tween 2020-03-06 10:59:07 +03:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Andrii Doroshenko (Xrayez)
81db0e9274 Provide default Tween values for transition and easing types
TRANS_LINEAR and EASE_IN_OUT are chosen as defaults for
interpolation and follow methods.
2019-12-12 02:15:15 +02:00
Rafał Mikrut
ed1c4bc77d Removed unused variables, add some constants numbers 2019-12-10 05:13:02 +01:00
Mark Riedesel
d0b528e4a8 Fix Tween follow_property finishing with null 2019-10-23 16:38:43 -04:00
Devin Pentecost
265eaf1a2c Implementing 0-duration tweens
Some light refactor
Adding comments in functions
2019-06-14 07:20:13 -07:00
Rémi Verschelde
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
James
4c2f9c19b8 Tween: Add a unique identifier to InterpolateData to be able to remove the right one when finished 2018-08-16 15:59:35 +02:00