JavaScript/TypeScript animation engine
OTHER License
Bot releases are visible (Hide)
BREAKING: no longer auto-start tweens by default when calling tween.update()
. To restore previous behavior for the whole app, set the static Tween.autoStartOnUpdate
property to true
.
fix: make the end()
method work better by setting the end time to start + duration instead of Infinity.
Full Changelog: https://github.com/tweenjs/tween.js/compare/v24.0.0...v25.0.0
Published by trusktr 3 months ago
This release finally deprecates usage of TWEEN
as a default Group
. All new Tween
s now default to having no group, and must be explicitly added to a group if desired. Plus some other improvements to related to groups, including breaking changes (see below for all details and how to migrate if affected).
feat: do not automatically add/remove a tween to/from its associated group, and do not automatically add new Tween
s to the global TWEEN
group by default.
feat: the tween.group(group)
method now has a reciprocal tween.remove()
method that will remove a tween from its associated group, and unassociate the group. tween.group()
without an arg is no longer valid, see breaking changes and migration below.
fix: when a tween is stopped before its end time, do not allow its update method to continue, therefore preventing logic (f.e. repeat logic) from being triggered
docs: improved the docs, adding some missing information, removing all examples of the global TWEEN
group which has been deprecated, and adding docs on how to manage groups of tweens. Also updated samples to use import
syntax for importing Tween, avoiding the use of the TWEEN
UMD global variable which has been deprecated.
feat: A new Group.allStopped()
method returns true if all tweens in a group are not playing (i.e. stopped, and not paused), otherwise false. Useful for stopping an animation loop once all tweens in a group have finished their animation.
deprecated: Methods on TWEEN
that come from Group
are now deprecated to be removed in a future major version. Migrate forward by making a new Group
instead of using TWEEN
as a group.
deprecated: The UMD script that creates a global TWEEN
variable is deprecated to be removed in a future major version.
deprecated: The CommonJS build is deprecated to be removed in a future major version.
BREAKING:
start()
, stop()
, or pause()
, and the preserve
parameter to Group.update()
now defaults to true
and is deprecated to be removed in a future major version.
group.update()
with false
for the second parameter. To migrate forward, do not rely on automatic add/remove of tweens, and instead add/remove tweens to/from groups manually.Group.update()
no longer returns a boolean indicating if all tweens have been removed.
Group.allStopped()
method to check if all tweens in a group are stopped in order to determine whether or not to continue an animation loop.group
parameter to Tween.constructor
now defaults to undefined
instead of the global TWEEN
group. Additionally it accepts a value of true
to restore the old default behavior. The true
value is deprecated and will be removed in a future major version.
true
to restore the old behavior. To migrate forward, use tween.group(group)
or group.add(tween)
instead.tween.group()
signature has been removed.
group.add(tween)
or group.remove(tween)
instead. tween.group(TWEEN)
, TWEEN.add(tween)
, and TWEEN.remove(tween)
will also work for now, but they are deprecated and will be removed in a future major version.Group.update
's second parameter preserve
defaults to true
now, and is deprecated to be removed in a future major version, at which point tweens of a group will no longer be automatically added/remove to/from a group when calling any Tween methods such as start()
, pause()
, or stop()
.
false
to restore old default behavior when calling group.update()
. To migrate forward, do not rely on the automatic add/remove behavior, and instead manually add or remove tweens to or from groups.tween.update()
to be a no-op for stopped tweens, we had to break an undocumented feature that allowed tweens to move backward in time (https://github.com/tweenjs/tween.js/pull/271).
tween.start(startTime)
then proceed to call tween.update(time)
in reverse order as before (see the unit test with "go backward in time" in its name). Without calling tween.start()
nothing will happen because stopped/completed tweens will now always return early from update()
, as they are considered to be no longer running.Full Changelog: https://github.com/tweenjs/tween.js/compare/v23.1.3...v24.0.0
Published by trusktr 3 months ago
Unfortunately we had to revert the fix for yoyo in v23.1.2 because it broke the yoyo demo. lol
So, this ironically fixes yoyo so that it is more fixed than how fixed we thought it was, and we will have to circle back to #677 again get yoyo even more fixed. 🥴
Full Changelog: https://github.com/tweenjs/tween.js/compare/v23.1.2...v23.1.3
Published by trusktr 6 months ago
let in = TWEEN.Easing.Linear.In; in()
. by @soumen-pradhan in https://github.com/tweenjs/tween.js/pull/682
Full Changelog: https://github.com/tweenjs/tween.js/compare/v23.1.1...v23.1.2
Published by trusktr 9 months ago
Full Changelog: https://github.com/tweenjs/tween.js/compare/v23.1.0...v23.1.1
Published by trusktr 9 months ago
requestAnimationFrame
not firing for unfocused tabs) and then start firing again later, things now work (tweens can travel properly into the future)..delay()
are no longer valid (it was not a documented feature). See df8214619f671162034b9c881f81eafcdcbcad92 for migration example.Full Changelog: https://github.com/tweenjs/tween.js/compare/v22.0.0...v23.0.0
Published by trusktr 9 months ago
But! Some people might still be using it, so:
dist/index.cjs.js
was renamed to dist/index.cjs
. If you relied on dist/index.cjs.js
, update your paths and you'll be good to go.Full Changelog: https://github.com/tweenjs/tween.js/compare/v21.1.1...v22.0.0
Published by trusktr 9 months ago
exports
field so that types will be discoverable by TypeScript out of the box when importing tween.js into a TS project. Thanks @tazyong @jramstedt @keiya01!Full Changelog: https://github.com/tweenjs/tween.js/compare/v21.0.0...v21.1.1
Published by trusktr over 1 year ago
exports
field was added to package.json
to make it compatible with ESM tools (to override the main
field currently pointing at a CommonJS file which doesn't make sense for ESM, but does for old Node.js). To be safe, we made this a major version because there's a chance it can break someone's app (f.e. if they imported from dist/ directly, that will now be blocked, and they would need to change import ... from '@tweenjs/tween.js/dist/tween.esm.js'
to import ... from '@tweenjs/tween.js'
). Thanks for this @christjt!Published by trusktr over 1 year ago
You won't be able to outrun the fox!
tween.dynamic(true)
.
Warning When
dynamic
is set tofalse
, Tween makes a copy of the object passed intotween.to()
and will never modify it (hence updating the original object from the outside is not dynamic). Whendynamic
istrue
, Tween uses the original object as the source of values during animation (every update reads the values, hence they can be modified dynamically) but note that in dynamic mode, Tween will modify any interpolation arrays of the object passed intotween.to()
which may cause side-effects on any external code that may also rely on the same object.
We've added two new dynamic_to examples. In each example, when dynamic is disabled, the fox cannot catch any rabbits. When dynamic is enabled, the rabbits have no chance!
tween.to()
now throws if it is called when a tween is started (even if paused). Call tween.stop()
first before setting a new .to()
value.Published by trusktr over 1 year ago
Easing
object is no longer monkey-patchable, i.e. it has been frozen with Object.freeze()
. If you relied on patching Easing
, instead you should use alternative references for the easing functions you wish to use.From now on we will also keep the changelog updated with each release so that it is easy to see what changed and if any migration is needed for breaking changes.
Published by trusktr over 1 year ago
The update to v18 was largely foundational: removal of bower and update of scripts and CI. It may break someone using Bower to install from git, hence the major bump.
src/Tween.js
to dist/tween.umd.js
for global <script>
tags. See the install guide.tween.start('+100')
tween.delay(100).start()
Published by trusktr over 1 year ago
Reverted a breaking change from v17.3.0 to v17.3.2 (v17.3.1 was never released) that broke dynamic-to with array interpolation values.
In v17.6, objects passed to tween.to()
that have interpolation arrays will be modified as before v17.3.2, and those objects can be modified on the outside during animation to update interpolation values dynamically.
v18 contains the new behavior where the object passed into to()
is prototypically copied and never modified, but that prevents dynamic interpolation values during animations (the breaking change is suitable for the major version bump from 17 to 18).
A following major version will provide a new dynamic
option to the to()
method for choosing the desired behavior.
Published by mikebolt over 5 years ago
Published by mikebolt over 5 years ago
Published by mikebolt over 7 years ago
<a name"16.7.1">
Tweens now use only 20% of the memory that they previously used. This means that you can have more active tweens, and creating tweens is now faster.