我正在使用 Silverlight 和 XNA 框架开发游戏。我想获取移动屏幕的高度和宽度,以便在任何设备上运行应用程序。意味着所有设备都应该支持应用程序的扩展。
public partial class GamePage : PhoneApplicationPage
{
public static ContentManager contentManager;
GameTimer timer;
SpriteBatch spriteBatch;
GraphicsDeviceManager graphics;
public GamePage()
{
InitializeComponent();
//error at below line
graphics = new GraphicsDeviceManager(this);
contentManager = (System.Windows.Application.Current as App).Content;
rand = new Random();
// Create a timer for this page
timer = new GameTimer();
timer.UpdateInterval = TimeSpan.FromTicks(333333);
timer.Update += OnUpdate;
timer.Draw += OnDraw;
}