I’m considering using MonoGame and Primitives2D to develop an Android application that displays a 2D line graph instead of a game.
I want to flip the Y axis in SpriteBatch, but for some reason nothing is drawn.
What am I doing wrong?
// y up
var scale = Matrix.CreateScale(1, -1, 1);
// rotate
var rotate = Matrix.CreateRotationZ(MathHelper.ToRadians(0));
// center origin
var w = GraphicsDevice.PresentationParameters.BackBufferWidth;
var h = GraphicsDevice.PresentationParameters.BackBufferHeight;
var x = (w / 2) ;
var y = (h / 2) ;
var position = Matrix.CreateTranslation(x, y, 0);
var transform = scale * rotate * position;
// draw
spriteBatch.Begin(transformMatrix: transform);
spriteBatch.DrawLine(0, 100, 0, -100, Color.White, 10);
spriteBatch.End();