-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structure proposal #21
Comments
I think it would be impossible to mix different animations, such as Also, I did avoid on purpose parameters and preferred a Dictionary because Godot does not support named parameters, and you have to pass all the parameters, even if not used. Said that we could use a different syntax that is more dev friendly, for example: var anima := Anima.begin(self)
anima.then(
Anima.Node($Control) \
.anima_property("position") \
.anima_duration(0.3)
)
anima.then(
Anima.Grid($Grid) \
.anima_grid_size(Vector2(3, 2))
) The
By doing so, the editor will only show you the methods that exist for the type of Animation you're creating. |
This kind of style syntax isn't possible with GDScript yet.. as GDScript doesn't support Structs. This only be possible in C# as it has a structs. Yes, I agree about hard to maintain a property and had to look on the documentation, but there are many parameters that this addon has in just one function. |
Yeah, I was thinking of the prefix only because the autocomplete shows too many options by default. |
Oh.. it seems prefix will be a good idea then. You could let that stay instead. |
I've pushed an initial implementation for this. The
Possible to pass a dictionary is still possible tho |
You seem to be using the same class (
AnimaNode
) for everything right but this makes it hard to maintain and possibly prone to errors because you have to pass dictionaries with properties that sometimes are not compatible with each other. Plus users will have to remember all the names of the properties they have to pass. A better approach would be to have a different class for each type of animation. An example would be:That way users wont have to go back to the documentation in order to check which parameters they can pass etc...
EDIT: And of course have a base class from which all of the animations inherit
The text was updated successfully, but these errors were encountered: