[SOLVED] Monarch popup => Non-gui elements (GO, tilemap etc.) are hidden at runtime

Hi!

(not sure if this is a bug with Defold/Monarch or if there is something important that I don’t know)

I’d like to display a popup containing a tilemap (via Monarch) and just gave it a try.

In the editor, everything looks as intended:

But in game, the popup looks like… “this”:
(the tilemap is not displayed :thinking: all you can see is the GUI header)

Just in case, I tried to…
1/ Change the tilemap layer z-positions (from 0/0.2 to 0.97/0.99 etc.)
2/ Preload the popup.

But as expected, none of these solutions worked.

Do you have any idea why the tilemap is not visible in a Monarch popup?

Looks like it’s not tilemap-specific.

I just added game objects (btn_levels) and they’re not visible either when I display the popup in the game :thinking:
(even if I set the z-position to 1 etc.)

Probably the case is that all of your game objects are spawned in your current world and current render camera is moved far away from (0:0)

Probably you should to position your GO’s on your current camera position (you can add the root GO to make it easy). Or use other tags for this game objects to render it on screen, not depended on current camera projection

You see the GUI always, since it rendered in screen coordinates

1 Like

Oh ok, thanks for the info!

I genuinely thought that everything inside a popup was like… “part of the popup” and treated as such (but it’s stupid since there is no link between the gui and the rest of the collection)

I did what you suggested but there are 2 (expected) issues:
1/ The footer menu remains above the tilemap/buttons
=> well… in this case, I suppose I could make the footer menu move outside the screen (when I trigger the map popup). Not exactly what I wanted, but better than nothing!
2/ The tilemap doesn’t follow the popup transition animation (which is pretty logical since there is zero link between both at this point)

So I made the tilemap follow the popup root (instead of the camera), thinking that it would follow the transition as well… but same result.

It looks like in Monarch, the popup is considered “already positioned” when the “in” transition starts or really disappears when the “out” transition ends. So this transition seems purely cosmetic.

@britzl Is there a way to know the popup coordinates during the Monarch transitions?

Another option is probably to render the tilemap with a different material and predicate and draw it in screen space along with the GUI?

2 Likes

Thanks for your answer!
But to be honest, I don’t know how to do it (never dealt with materials, except when using already existing stuff for very specific purposes). Is there an example somewhere that could help me?

Anyway, in the short term I set the transition anim duration to 0 (so it’s instant => problem “solved”) and everything except the tilemap will be made in gui.

But just to be sure: there is no way to know the popup position during the transition? (in Monarch)

If not, I’ll have to learn how to apply the solution mentioned above OR maybe I’ll just have to create the popup transition myself (if I really really want an animated transition for THIS popup :slight_smile: ) So I should be able to easily know the popup position and force the tilemap to follow it. I’ll see :nerd_face:

You can create your own transition functions which means that you can also make the position available to another script.

1 Like