Skip to content
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

UI: Add Transitions to arcade GUI [after 3.0 release] #1420

Draft
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

eruvanos
Copy link
Member

This adds an easy way to animate UIWidgets.

Implemented transitions:

  • TransitionAttr - Change value over time (start til end)
  • TransitionAttrIncr - Increment value over time
  • TransitionAttrSet - Set value after time
  • TransitionParallel - Execute multiple transactions parallel
  • TransitionChain - Execute multiple transactions sequentially
  • TransitionDelay - Used to pause :class:TransitionChain
widget = UIWidget()
# move a widgets center_x from 0 to 100 within 2 seconds
widget.add_transition(Transition(attribute="center_x", start=0, end=100, duration=2))

The transition implementation could also be used with sprites, I am not sure which way would be a good one. I would love to get some feedback.

I see two options:

# add transition
sprite.add_transition(Transition(...))

# integrate transition update in sprite updates
sprite.on_update()

or

# use a `Animation` class to connect a sprite and a transition
animation = Animation(sprite, Transition())

# update transitions via an wrapping `Animation` object
animation.on_update(dt)

@eruvanos eruvanos added the gui Related to arcade GUI (sub module arcade.gui) label Jan 12, 2023
@eruvanos
Copy link
Member Author

Talked to @einarf :

  • missing feature: cancel transition
  • for Sprites, this might be a performance problem

@eruvanos
Copy link
Member Author

eruvanos commented Jan 16, 2023

Will be added after 3.0 release. It is more important to release!

@eruvanos eruvanos changed the title UI: Add Transitions to arcade GUI UI: Add Transitions to arcade GUI [after 2.7 release] Jan 24, 2023
@eruvanos eruvanos changed the title UI: Add Transitions to arcade GUI [after 2.7 release] UI: Add Transitions to arcade GUI [after 3.0 release] Feb 24, 2023
@eruvanos eruvanos marked this pull request as draft November 8, 2023 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gui Related to arcade GUI (sub module arcade.gui)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant