Sticking walls, floors, and ceilings to device boundaries
When positioning a ceiling (for example), what is the best way to make sure they stick to the game's "height". I tried constraining to both the device height and the camera height (plus 1/2 the height of the actor) to get it stuck to the top of the screen. On the iPad preview, both work like a charm. But when I switch to test it on the iPhone preview, the ceiling ends up in the middle of the screen (both on letterbox and crop mode).
I'm developing for iPad landscape w/ resolution independence on.
The goal is to create the game boundaries and position elements programatically so we don't have to tweak the design or gameplay for the various screen sizes. Any ideas?
I'm developing for iPad landscape w/ resolution independence on.
The goal is to create the game boundaries and position elements programatically so we don't have to tweak the design or gameplay for the various screen sizes. Any ideas?
Comments
@JoeNewNine
Hi, I'm not getting why you've the complication of using Constrain (let alone any other behaviours); or any rules, to get an image - like a ceiling to be in a certain place... why not just place it where it should go with x and y coordinates for each platform? Or am I missing something here...
However, the safer way is to do it is like @gyroscope says - you know all the resolutions so you can make a rule that says if screen.Height = ### then Change Attribute self.Position.Y to ###.
Do the same for X and Y and the 3 resolutions of iOS.
That is what I would do.
@FryingBaconStudios has done a video, on YouTube on how to do this with Android - a much more fragmented platform.
If there are better ways to do this keen to hear them too
I've found that device screen size is not worth using. Try scene > camera size instead.