isMouseVisibleを使用してXNAゲームでカーソルを表示しようとしていますが、機能しません。エラー:
「StopWatch.Game1」には「isMouseVisible」の定義が含まれておらず、「StopWatch.Game1」タイプの最初の引数を受け入れる拡張メソッド「isMouseVisible」が見つかりませんでした
コード:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace StopWatch
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
public SpriteBatch spriteBatch;
public static Game1 Instance;
StopWatch stopWatch;
public Game1()
{
this.isMouseVisible = true;
graphics = new GraphicsDeviceManager(this);
Instance = this;
Content.RootDirectory = "Content";
graphics.PreferredBackBufferWidth = 512;
graphics.PreferredBackBufferHeight = 512;
}
protected override void Initialize()
{
stopWatch = new StopWatch();
base.Initialize();
}
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
stopWatch.LoadContent();
}
protected override void UnloadContent()
{
stopWatch.UnloadContent();
}
protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
stopWatch.Update(gameTime);
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
stopWatch.Draw(gameTime);
spriteBatch.End();
base.Draw(gameTime);
}
}
}