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

Can't switch stage before file chooser fades out #257

Open
StrongJoshua opened this issue Apr 19, 2017 · 2 comments
Open

Can't switch stage before file chooser fades out #257

StrongJoshua opened this issue Apr 19, 2017 · 2 comments
Labels

Comments

@StrongJoshua
Copy link
Contributor

I am using FileChooser to open a file, and once the file is opened, my program switches to another stage. However, this has the effect of not allowing the FileChooser to fade out properly (so when I then try to fade it in again in this subsequent stage, it immediately fades back out due to the queued actions). I have tried just clearing its actions, but that results in it being un-touchable since that's what the VisWindow's fadeOut() function does.

@kotcrab kotcrab added the ui label Apr 19, 2017
@kotcrab
Copy link
Owner

kotcrab commented Apr 19, 2017

I'm not sure if stage2d actors are meant to be moved between stages. Not seeing any good fix for this.
You can use these workarounds:

  • extend FileChooser, override fadeOut(float time) and call remove() directly thus skipping animation
  • recreate FileChooser for new stage
  • just change touchable after clearing action, that method is publicly exposed

@StrongJoshua
Copy link
Contributor Author

The workaround I ended up using is just adding the file chooser to the next stage in its constructor, which has the added cool effect of it seeming to persist between the two stages and fade out during the transition. But I agree, there is no good fix, I just wanted to let you know in case you wanted to change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants