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

Change to synchronous playback of animations #33

Open
igorhart opened this issue Oct 14, 2021 · 3 comments
Open

Change to synchronous playback of animations #33

igorhart opened this issue Oct 14, 2021 · 3 comments
Labels
feature request New feature or request

Comments

@igorhart
Copy link

igorhart commented Oct 14, 2021

Currently, it is possible to set the value of state machine input like this:

-- Set the value of the "progress" input to 50
go.set("#model", "progress", 50)

but there is no way to animate the change from the current value to 50, like this:

-- Animate the value of the "progress" input to 50
go.animate("#model", "progress", go.PLAYBACK_ONCE_FORWARD, 50, go.EASING_LINEAR, 1, 0, callback)
@britzl
Copy link
Contributor

britzl commented Oct 18, 2021

It works but rive.play_state_machine() is async (uses message passing internally) which means that you need to wait until the play_state_machine() call has been processed before you animate the state machine value. Like this:

	rive.play_state_machine("#model", "State Machine 1")
	timer.delay(0, false, function()
		go.animate("#model", hash("Number 1"), go.PLAYBACK_LOOP_PINGPONG, 90, go.EASING_LINEAR, 1)
	end)

@britzl
Copy link
Contributor

britzl commented Oct 18, 2021

We should change rive.play_state_machine() so that it is sync and completes immediately

@JCash
Copy link
Contributor

JCash commented Oct 18, 2021

We'll keep this ticket, as our goal it to make it so that the rive.play_animation() is synchronous, and that will allow for the get/set of properties of the rive component (animation is using get/set)

@britzl britzl added feature request New feature or request and removed improvement labels Oct 29, 2021
@britzl britzl changed the title Add ability to animate state machine inputs Change to synchronous playback of animations Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants