Helo World,
This next game that I'm gonna be working on would be perfect for using scale outer. However I'm having trouble figuring out how to set up my game based only on the area that the player can actually see on his particular device.
For example lets say my layout is 640x480(and lets assume everyone can see all of it) and that I have an object(size 30x30, origin at 15x15) that I want to spawn in random locations. Normally I would have some events like:
1. on start of layout | system scroll to
x: 320
y: 240
2. every x seconds | create object at
x: random(40,610)
y: random(40,440)
So in that scenario I know the starting x/y and the ending x/y of what the player can see. And I know that I have to add 40 to the starting x/y and substract 40 from the ending x/y, that way the object will be created at random positions but will always be fully withing the layout and will have a little space between it and the layout edge.
However if I use scale outer I would need something like(let's call it visible.area, I don't know what the proper term is):
1. on start of layout | system scroll to
x: 320
y: 240
2. every x seconds | create object at
x: random(visible.area.start+40,visible.area.end-40)
y: random(visible.area.start+40,visible.area.end-40)
And it's not just for randomly spawned objects, that was just an example, I would olso need to always keep my HUD elements at a certain distance from the visible.area edge, etc. So, in conclusion, how do I make sure that my entire game is always within the part of the layout that the player can actually see on his device?
Thank you.