首页 > 解决方案 > 在cosmos C#中获取屏幕高度和宽度

问题描述

如何在 C# Cosmos 中获取屏幕高度和宽度?

我正在制作一个操作系统,我正在制作 GUI,我需要一个欢迎文本的中心点。

喜欢:

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

标签: c#operating-system.net-2.0cosmos

解决方案


是的,我终于想通了!

canvas.Mode.Columns是列,canvas.Mode.Rows是行!


推荐阅读