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);
}
}
}
你打敗了我。 Jeez :) – 2012-07-18 15:53:34
這就是爲什麼我使用RSS源:P – Cyral 2012-07-18 15:55:18
這可能是我做過的最愚蠢的事情。謝謝>。> – 2012-07-18 15:58:45