【问题标题】:Difficulties with VirtualScreenWidth and VirtualScreenHeight. Error message: Identifier expectedVirtualScreenWidth 和 VirtualScreenHeight 的困难。错误消息:需要标识符
【发布时间】:2014-02-02 09:38:41
【问题描述】:

一开始,我收到以下错误消息: 找不到类型或命名空间名称“VirtualScreenWidth”(您是否缺少 using 指令或程序集引用?)
之后,我添加了“使用 System.Windows”,错误消息消失了。 但是现在,我总是在以下两行中收到此错误消息:

public static const VirtualScreenWidth = 800;
public static const VirtualScreenHeight = 480;

需要标识符

怎么了?我应该改变什么?我在这个小教程中找到了代码: http://www.craftworkgames.com/blog/monogame-resolution-independence/

【问题讨论】:

  • 对不起,这是我的错。我昨天真的写了那个小教程,然后输入了那些行,却忘了检查它们。我已经更新了教程。我希望它对你有用:)

标签: c# windows-8 xna monogame


【解决方案1】:

您忘记定义类型,例如整数:

public const int VirtualScreenWidth = 800;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-28
    • 1970-01-01
    • 2023-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多