2

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
Eli Ozcan
  • 412
  • 6
  • 10
  • What C# frameworks are you using? WPF? Windows.Forms? Also, what do you mean you are writing an OS? – Michael Welch Oct 24 '20 at 14:49
  • I'm in **.NET Core 2.0** (I have to because Cosmos only supports that) and I'm using **[COSMOS](https://gocosmos.org)** (C# Open Source Managed Operating System) To make the OS @MichaelWelch – Eli Ozcan Oct 24 '20 at 16:48

1 Answers1

3

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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Eli Ozcan
  • 412
  • 6
  • 10