Tag: xna 3.0

如何在XNA中使用DirectX.DirectInput

joystick.cs using System; using Microsoft.DirectX.DirectInput; namespace gameproject { /// /// Description of device. /// class joysticks { public static Device joystick; public static JoystickState state; public static void InitDevices() //Function of initialize device { //create joystick device. foreach (DeviceInstance di in Manager.GetDevices( DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly)) { joystick = new Device(di.InstanceGuid); break; } if (joystick == null) […]

资产未找到XNA

我是XNA的新手,我开始遵循在屏幕上绘制图像的教程。 我能够将我的图像移动到Content文件夹中,但是当我尝试在我的代码中使用它时,无法找到它。 我正在使用资产名称而我无法找到我做错的事情。 教程使用XNA 3.0,我使用的是Visual Studio 2010,不确定是否重要。 这是我的代码 public class Game1 : Microsoft.Xna.Framework.Game { Vector2 mPosition = new Vector2(0, 0); Texture2D mSpriteTexture; GraphicsDeviceManager graphics; SpriteBatch spriteBatch; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = “Content”; } protected override void Initialize() { base.Initialize(); } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); mSpriteTexture = […]