Hi all, I hope this makes sense, I would post a .capx but it's a bit hard to isolate from my game at the moment, but if anyone thinks they can help and wants to take a look I will do so. Will try to describe first.
My game has several different layers, one of them is a global layer called 'MAP' which is shown when the user presses the M key. When the M key is pressed it pauses the game and it unhides the map/menu layer.
The map/menu layer contains three screens worth of information, so it can't all be displayed at once. Instead I give the player the option to press the left and right arrows and it will smoothly scroll to the relevant point on the screen using lerp(scrollx, target, etc). Because I can't target a specific layer to scroll to, it does the whole layout - it doesn't really matter because the map screen covers the game area so the player would be unaware of this, BUT using this method there is quite a limitation, in that if the current game layout is smaller than the area needed for the 3 menus it can't scroll to them.
So if I have 3 screens wide to fill with my map/menu it takes up 1920 pixels but if the game layout is smaller than that eg 1280 pixels, the scrollto won't work at any range outside of the layout, even if the layout the global map layer is on is larger than this and set to unbounded scrolling.
If I could turn unbounded scrolling on and off with events, or if I could target a scrollto location on a specific layer I might be able to come up with a workaround, but there doesn't seem to be a way to as far as I can see. I could just make sure all of my layouts are at least the width needed for the map/menu - but it will be a lot more mucking about, less easy to maintain - as I'm doing a metroidvania style game with many different rooms/layouts with a map etc, I don't really want to have to pad layouts out like that if I don't need to.
Anyone got any suggestions, or better ways I could go about this?