xna

How do I get an XNA 4.0 game to run on other machines?

◇◆丶佛笑我妖孽 提交于 2019-12-13 05:27:01
问题 Whenever I try and run a game made in XNA 4.0 on a machine other than ones used for development, it just won't run. I've followed the instructions here to ensure that all the dependencies are present. To be clear I've done the following: Downloaded and installed the Microsoft .NET Framework 4 Client Profile. Downloaded and installed the Microsoft XNA Framework Redistributable 4.0. Made sure I am not using anything contained within GamerServices and Microsoft.Xna.Net.* , my references are as

Trying to figure out the hierarchy of classes in my XNA game

妖精的绣舞 提交于 2019-12-13 05:12:53
问题 I am still kinda new to developing games in XNA and using classes with C#, but I want to start a semi-decent game project where I can learn without throwaway projects. I want to devide my game up into classes. For example a main game class, a player class (i want two players, and they battle against each other), a level class (for drawing the world) and maybe later on things like a power up class and a networking class so I can make everything multiplayer. But I don't know the best way to

How to set IAMStreamConfig file in DirectShowLib

元气小坏坏 提交于 2019-12-13 04:56:39
问题 I am using DirectShowLib in my C# XNA project to show webcam video. I have downloaded the complete code from the following link. https://github.com/Iridio/XNADirectShowWebCam I am using Logitech 1080p webcam, but in my program output i am not getting the HD result. I google it and found various results. Many experts are saying to edit IAMStreamConfig method to set the resolution and Frame rate. I am unable to understand how to edit it. Kindly guide me. Thanks Aftab 回答1: Your webcam is

XNA - Drawing Strings on Menus

元气小坏坏 提交于 2019-12-13 04:44:13
问题 Two questions on Drawing a list of Strings on XNA in menus. First is how do you left align the text instead of center align it? Second is how do you show a say a line before whichever one is selected? Here is the code I have for it so far; public void Draw(SpriteBatch spriteBatch, GameTime gameTime) { Color color; int linePadding = 3; if (gameTime.TotalGameTime.TotalSeconds <= 3) { spriteBatch.Draw(mTheQuantumBros2, new Rectangle(300, 150, mTheQuantumBros2.Width, mTheQuantumBros2.Height),

ArgumentOutOfRangeException Was Unhandled

蹲街弑〆低调 提交于 2019-12-13 04:41:59
问题 Further details of the exception: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index When reading the exception, I understand what it's trying to tell me. What I don't understand is -why- it's coming up. Here is the snippet of relevant code: //the model contains more than one mesh, so each //one must be accounted for in the final sphere List<BoundingSphere> spheres = new List<BoundingSphere>(); int index = 0; //cycle through the meshes

How to make an object face its forward vector

℡╲_俬逩灬. 提交于 2019-12-13 04:39:18
问题 Similar to my recent question only this time I would like to move the object towards a vector and not another object. Vector3 line = dalekList[i].direction; float rotationDal = (float)(-Math.Atan2(dalekList[i].position.X, -dalekList[i].position.Z) / (2 * Math.PI)); Matrix dalekTransform = Matrix.CreateScale(GameConstants.DalekScalar) * Matrix.CreateRotationY(rotationDal) * Matrix.CreateTranslation(dalekList[i].position); So I would need to put the rotation ( rotationDal ) into the

Render buffer to texture2D object in XNA

亡梦爱人 提交于 2019-12-13 03:45:41
问题 In XNA is there a way to render the contents of a spriteBatch after drawing to a texture object before rendering to the screen? 回答1: You'll need to switch your render target for the spritebatch and then grab the texture out of it. This MSDN article explains it pretty well. http://msdn.microsoft.com/en-us/library/bb976073.aspx 回答2: As Hexxagonal already answered, yes you can. But you might get into trouble, if you are using sprites with translucency. The reason is, that two overlapping sprites

Confusion about model's vertexbuffer and indexbuffer

倖福魔咒の 提交于 2019-12-13 03:44:56
问题 I have a model file containing multiple meshes (ie: a tree, a car, ...) that is used as a static background for our game. My goal is to store the model's vertices and indices as two buffers and assign these buffers to the GPU. However, I'm a bit confused on the way to go. This Riemer's XNA Tutorial states that the model itself has a one big vertexbuffer and one big indexbuffer containing informations of all its meshes (and meshparts), but it doesn't seem possible to access these buffers.

WP7 XNA+Silverlight Templates missing

帅比萌擦擦* 提交于 2019-12-13 03:21:08
问题 I got an issue with Visual Studio, Silverlight 5 Beta SDK and XNA. I did a fresh install of all Visual Studio components I need to create the application I have in mind: Visual C# 2010 Express XNA Game Studio 4.0 Visual Web Developer 2010 Express Visual Studio 2010 Express for Windows Phone Visual Studio 2010 SP1 Silverlight 5 Beta Tools However, when I start VS 2010 Express for Windows Phone and go to create a new project these are the templates I have: Missing Templates But there are a few

XNA: adding a force to a vector

本小妞迷上赌 提交于 2019-12-13 02:42:49
问题 i do have 2 points on a 2d plane. one has already an vector that does determine in which direction it will move. now i want to add a vector to this existing vector. so he accelerates in the direction of the other point. to be a bit more clear, it is about 2 asteroids flying in space (only 2d) and gravitation should move them a bit closer to each other. what i did build till now is this: c = body.position - body2.position; dist = c.Length(); acc = (body.masse * body2.masse) / (dist * dist);