Hi Everyone. This is my 1st post on this forum.
I am creating a card game for Android/Windows - focusing on the Android version now.
And I am having some (basic) doubts regarding the screen coordinate system when the Android phone is rotated (i.e.: in Landscape mode).
I ran a couple of tests:
1- Phone in Portrait mode:
I render a small Card Sprite on screen pos (0,0) and I get:
Which is expected .
Now, when I just rotate the phone (or emulator in my case), the image is still at (0,0):
But, things I have noticed (and need some feedback here, if possible):
A- My assets don’t automatically rotate when the screen rotates (I think this is the expected behavior?).
B- With the screen in Landscape mode, when I use the following to draw:
spriteBatch.Draw(text1, new Rectangle(0, 0, 100, 100), Color.White);
I notice the x,y params are inverted… With landscape mode, if I want my sprite a bit to the right I need to increment the Y coordinate instead of the X one… Sure the phone is rotated, but my expectation was that the framework would handle that?
My question then is:
If I write a game in Landscape mode, do I need to invert all the coordinates? X becomes Y and vice-versa?
Any input is really appreciated.
Thanks.