Hello 👋 I am back with my weekly newsletter!
Every week, I will insights from my journey and how I am earning $$$ from different sources as a solo developer/solopreneur.
Right now I am earning by making web-games, but soon I am adding more sources of income, which I will talk about soon!
Making your games playable on any device (mobile/PC/tablet) by designing adaptable UI & camera is a problem many game devs face.
[insights from discussions in my Discord]
Today, I'm sharing five tips to help you make your games playable on any device:
1. Anchor UI Elements to Screen Corners
Ensure your UI elements stay in place regardless of screen size or resolution by anchoring them to the appropriate corners.
Assign anchors based on each element's position so they adjust seamlessly when the screen resizes. This provides a consistent and adaptable UI experience for all players.
2. Make UI Elements Resizable
Allow your UI elements to resize dynamically with the screen by using anchor and stretch settings based on height and width.
This maintains proportionality and usability across different devices, ensuring buttons and menus remain user-friendly whether on a smartphone, tablet, or desktop.
I also have a video version of these tips here:
3. Toggle UI Elements Based on Orientation
Optimize your game's interface for both portrait and landscape modes by enabling or disabling specific UI elements based on the device's orientation.
Detect the orientation using Screen.width
and Screen.height
, and adjust your UI accordingly to keep the interface clean and intuitive.
4. Switch Cameras Based on Orientation
Enhance the visual experience by using different camera setups for portrait and landscape modes.
Implement separate cameras for each orientation, allowing you to zoom in or out and adjust backgrounds to suit the mode. This makes your game more engaging and visually appealing.
5. Adapt Camera Settings Based on Screen Size
Maintain consistent gameplay views across all devices by adjusting camera variables like field of view (FOV), size, or distance based on the screen's aspect ratio.
By detecting the ratio of height to width, you can ensure important elements remain in view, providing a seamless experience for all players.
Bonus Tips:
Consider Control Adaptability: Ensure your game controls are flexible for touchscreens, mice, and keyboards to enhance the gaming experience across different platforms.
Implementing these strategies will make your games more accessible and enjoyable for everyone, ultimately expanding your player base and enhancing your game's success.
Until next time,
Anul