Search code examples
c#operating-system.net-2.0cosmos

Get screen height and width in cosmos C#


How would I get the screen height and width in C# Cosmos?

I'm making a OS and I'm doing GUI and I need the center point for a welcome text.

Like:

int centerX = SCREENWIDTH / 2;
// and
int centerY = SCREENHEIGHT / 2;
// Would get the center

Solution

  • To get the columns: canvas.Mode.Columns. To get the rows: canvas.Mode.Rows