screen size

Hi all,
i’m new with monogame and i’m trying to build my first game.

i want to place an image in the bottom of my screen, i tried to use “GraphicsDevice.Viewport.Height” and i found out that the image i wanted his height much higher than my screen display so i can not see it.
all i could do is to place it manually.

does anyone knos how i can get the size of the screen?

That should be the screen height. Don’t forget, the offset for a spritebatch draw call is the top left corner of the texture, so unless you change the origin, you will need to subtract the texture height, or the size of the target rect from the screen height.

1 Like