Temporarily skipping a transition using Monarch

I am trying to transition to a scene using Monarch. Currently, when loading a scene, it has a default transition when showing in (slide_in_left). I want this transition to be used for the most part, except to not be used when loading from one specific scene.


Context

I have a book of demons that the user can click into and read - its a pop-up. Every page has the same nodes just different words and pictures, so its a single gui in a collection and clicking next page just updates the pictures, with a second separate collection/gui for the intro page.

The intro page has a bunch of different nodes. I could put that in the same GUI and just enable or disable all nodes in the “instructions root” when I wanted to show hide, but that makes it much more difficult to use edit in the editor, so currently it is two separate scenes, and when switching between the intro page and the first main page, I use monarch scene transition (I will just default to putting all the nodes in the same scene if I cant figure this out)

Currently the book saves which page you are on when you leave and return. So if the user opens the book the collection needs to load via a transition, sliding in, regardless of which page you are on. However if they are on the instructions page and flip to the first main page (or vice versa) I need to load a new collection without the transition so it doesn’t look like you are loading anything new


Things I have tried:

Looking at the code it doesn’t look like there is a parameter I can pass in to override the transition. I tried preloading, then setting the transition to nil (monarch.on_transition(“summons_instructions”, nil) ) then loading, but that just errors out - it doesn’t look like you can remove a transition once assigned.

Do I need to make a custom transition function (which I would assume just copies the default transitions but has an extra parameter to pass nothing). Or would you suggest not even doing this, and putting it all in one GUI scene despite the overlapping mess.

Thank you so much for your advice

if can_transition then
    monarch.on_message(message_id, message, sender)
end

I wonder if something like this would work. You just have to get the can_transition from somewhere global or perhaps put it as a data in the monarch.show().

I think this is an oversight on my part. Can you create a feature request on GitHub in the Monarch repo and I’ll make sure to fix it tomorrow.

And I suppose another solution would be to add an option no_transition to skip the transition on a show() or back()

I created Cannot remove transition once assigned · Issue #117 · britzl/monarch · GitHub

Hope this is the correct way to address this. Sorry for the delay and thank you for reviewing!

1 Like