-
Notifications
You must be signed in to change notification settings - Fork 17
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
Scene transitions (pushing popping multiple scenes at once) #16
Comments
Sorry for the delay in getting back to you. The way I did transitions is basically the same as yours, but IIRC I used Also if you want to contribute your |
no problem on the delay, not expecting instant replies. The problem I ran into with replace is that if I push a fadeout scene and emit a
I had a quick read around about push down automatas and there's some definitions allow pushing multiple and popping multple can be simulate by epsilon transitions, so there's nothing wrong with them in principle. I'm just trying to figure out the "best way" ™️ |
Heh, now that I think back, I had this exact problem and I think I resolved it by having my
It's a bit of a hack, but it's such a neat hack, right? Pushing and popping multiple scenes might honestly be simpler. XD I don't know any better than you in this case. |
Finally found some time for this. I've run into a problem if I try to replace the current scene and give fade out owenrship of the current scene that I'm calling so if I try to emit a replace
which isn't possible, since I have a mutable reference to self. So I could clone the scene, but this seems quite wasteful, especially if there is a lot of state in the scene. The other way I looked into would be to This isn't a problem for a fade in, as you're fading into a new scene. I was also worried about the static lifetimein https://github.com/ggez/ggez-goodies/blob/master/src/scene.rs#L52 , but that might be completely unfounded |
What's a sensible way of handling transitions?
I added a
FadeIn/FadeOut
Scene, the problem is that once you pop the scene, the scene underneath is drawn for a frame before that is popped, so a fade to black would suddenly flicker once before being popped off.I solved this by adding
Push/PopMultiple
but I'm unsure whether this is a good idea? see master...joetsoi:push-multipleThe text was updated successfully, but these errors were encountered: