Android Development

I am new to mobile development and have run into a problem. I am rendering a 32x32 tile (for testing purposes) to the screen and when I test the game the tile is drawn as if it’s 4x4. It’s incredibly tiny and hard to see. What do I have to do in order to make it appear the actual size on the screen?

Hi @Boosh and welcome to the community?

What is the resolution of your target Android device compared to the resolution you are trying to set in the game?

1 Like

What I have done so far is adjust the back buffer size using the width/height values from the GraphicsAdapter to get the size of the phone being used. However, I’ve tried entering many different resolution sizes and it doesn’t seem to work.

Are you setting the back buffer in the constructor, initialize or load content method? Are you calling ApplyChanges? I think, and I might be wrong, Android only supports the default resolution. You need to handle scaling between different resolutions in your app. I’m not sure why you’re tiles are so small other than a difference between resolutions or the size you are developing on.

1 Like

That is my experience!

A 32 by 32 tile on a say samsung s10 will look very small. As you cant change resolution look in to a camera matrix so you can zoom.

http://blog.roboblob.com/2013/07/27/solving-resolution-independent-rendering-and-2d-camera-using-monogame/comment-page-1/

1 Like

Thank you very much I will try this solution!

If you are just starting out and/or just doing a test scaling a sprite is as easy as: https://gamedev.stackexchange.com/questions/92395/scaling-sprites-in-xna-4-0-monogame

But sooner or later you have to start consider how your game look on other devices, resolutions and aspects and the article i first posted helped me out.