c# - 在cosmos C#中获取屏幕高度和宽度
问题描述
如何在 C# Cosmos 中获取屏幕高度和宽度?
我正在制作一个操作系统,我正在制作 GUI,我需要一个欢迎文本的中心点。
喜欢:
int centerX = SCREENWIDTH / 2;
// and
int centerY = SCREENHEIGHT / 2;
// Would get the center
解决方案
是的,我终于想通了!
canvas.Mode.Columns
是列,canvas.Mode.Rows
是行!
推荐阅读
- javascript - jQuery - 单击时添加/删除类
- reporting-services - 自定义字体在订阅 PDF 输出 SSRS 中不起作用
- node.js - 如何使用 REST API [NodeJS] 在画面中上传文件
- javascript - forEach/函数递归和返回值
- android - 将 Android gradle Plugin 升级到 4.2.1 后出现 DaemonDisappearedException
- mysql - 无法在 SQL 中相乘,按错误分组聚合
- c++ - 当数组声明为 constexpr 时,为什么我不能使用整数变量作为数组键?
- sql - 如何在sql查询中将行转换为列
- reactjs - 垂直图像没有覆盖整个头像材质-ui React
- java - 使用 PDF 转码器时保持相同大小的输出