- Home /
How to place objects at edge of screen for mobile devices
I am using Unity sprites for a 2D game. I have an orthographic camera with a size of 10.06. I have 2D objects that I want to place at the screen edge. How can I do this so it works for all mobile devices (iPad/iPhone/Android).
In fact I would love to know how to anchor items to top left, middle left, bottom left, top right, etc, etc
It also needs to work with retina resolutions.
This seems like it must be a common problem, but I can't seem to find a good solution for it (DPI, Screen.Width - not sure how to use these to accomplish what I need).
I tried using http://pixelplacement.com/2011/05/13/simplifying-screen-positioning-in-unity/
But this script doesn't seem to support retina resolutions (inconsistent results among devices).
The specific example on my project is a 2D character will poke his head in the scene, then disappear. This always has to start at the edge of the screen (so detected at runtime).
Thoughts? I need a good screen anchor system!
Your answer

Follow this Question
Related Questions
Optimal # of Faces for many mesh scene for mobile 1 Answer
Changing the splash screen background color 3 Answers
GUI system for android? 1 Answer
What is static batching and dynamic batching? 0 Answers
Joystick trouble... 0 Answers