Closed johnnyneverwalked closed 1 year ago
What do you think about making the "to" parameter optional? For example:
anima.then({
grid = $VBoxContainer,
grid_size = Vector2(3, 3),
animation_type = Anima.GRID.FROM_CENTER,
property = "modulate",
from = Color.red,
duration = 0.3
})
each cell animated will animate from red to their colour before the animation started.
In addition I could also implement something like this:
anima.then({
grid = $VBoxContainer,
grid_size = Vector2(3, 3),
animation_type = Anima.GRID.FROM_CENTER,
property = "modulate",
from = Color.red,
to = ":my_custom_value",
duration = 0.3
})
where my_custom_value
is a property of the node. This would allow having a "dynamic" to (and from) value not linked to the "property" animated and will also work for animating a single node, not only grids.
This would be amazing! It can add an incredible amount of versatility
@johnnyneverwalked I just pushed a WIP version of the addon that address the request in this issue:
var anima: AnimaNode = Anima.begin(self)
anima.then({ node = $Node, to = ":size:x", duration = 0.3 })
:size:x
is going to be replaced with the component width value.
You can also pass a formula, for example: - :size:x + :size:y * 50
, or access to any property of the node.
You can also retrieve a parameter from another node, for example:
var anima: AnimaNode = Anima.begin(self)
anima.then({ node = $Node, to = "./AnotherNode:size:x", duration = 0.3 })
Here the initial documentation of how "Dynamic values" work:
https://anima.ceceppa.me/docs/docs/tutorial-extras/dynamic-value/
It would be nice to be able to access specific properties of the current iterating node while performing a group or grid animation.
For example:
The iteratee field could contain the cell that is being animated and by using ":" you get the value of the cell's property at the time before the animation starts.
In the above example every cell would animate from red to their current modulate color which could be used to create a "red wave" animation on the grid, and then returning each cell's color to its original value assuming they all have a different one.
This is just a thought I had, of course it doesn't have to be implemented that specific way if at all. :)