Screen Bounds Calculator

Just wrapped up a new sample project!

I’m working on a Doodle Jump-style game, and one of the most important mechanics is screen wrapping, where the player moves off one side of the screen and reappears on the other. In the past, I’ve run into issues with screen bounds behaving differently across mobile devices due to varying resolutions and aspect ratios.

This sample shows my solution to that: it dynamically calculates the visible screen bounds in world space, so your logic stays consistent across all devices. I plan to use this in nearly every 2.5D game I make moving forward.

It works best when gameplay happens on a single 2D plane using 3D assets. Perfect for vertical scrollers like Doodle Jump (X and Y axis movement), or top-down games where gameplay happens on the X and Z axis.

Check it out and let me know what you think!

https://www.8thwall.com/dcln/screen-bounds

1 Like

Awesome! Thanks for posting this!

Of course! Please let me know what you think. I did notice a weird problem with the UI_PRESSED and UI_RELEASED functionality. Try pressing the left button on the project and then before you release the left button press the right button. When you do that you can no longer get the UI_RELEASED event to fire off of the first button press. so in this case it breaks the movement. The cube will continue to move left until you press and release the left button again. I tried to solve this multiple ways but it seems to be an error that occurs on the UI_RELEASED event dispatch level.

Just rolled out a big update to the Screen Bounds project!

It can now automatically translate your game world entity so it fits a specific unit size.
In other words, no matter the screen resolution, your game world’s width or height (you choose) will always match the exact number of units you set.

This means consistent gameplay feel across every device.

I’ve also added a new demo space in the project so you can see it in action!

1 Like