2012-07-18 48 views
1

我想讓我的光標在使用isMouseVisible的XNA遊戲中可見,但它不想工作。錯誤:XNA - 沒有定義'isMouseVisible'

'StopWatch.Game1' does not contain a definition for 'isMouseVisible' and no extension method 'isMouseVisible' accepting a first argument of type 'StopWatch.Game1' could be found

代碼:

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); 
     } 
    } 
} 

回答

2

使用IsMouseVisible = true

大寫的我

記住,使用intelisence你可以通過鍵入開始觀看方法和變量。

+0

你打敗了我。 Jeez :) – 2012-07-18 15:53:34

+0

這就是爲什麼我使用RSS源:P – Cyral 2012-07-18 15:55:18

+0

這可能是我做過的最愚蠢的事情。謝謝>。> – 2012-07-18 15:58:45