xna

Dealing with lag in XNA + lidgren

有些话、适合烂在心里 提交于 2020-06-24 04:01:27
问题 I am experimenting with lidgren in XNA and I'm having some issues with the 'lag'. I've downloaded their XNA sample and noticed that even their sample lags. The thing is, the movement is not smooth on the other side, and I'm trying this on a LAN (on the same computer actually) not over the internet. Has any had the same issues as regards unsmooth movement due to a lagging connection with lidgren and XNA ? 回答1: The sample you linked directly sets the position to whatever it receives from the

Graphics Card and XNA 4.0

对着背影说爱祢 提交于 2020-06-22 08:28:18
问题 I create a new project in xna 4.0 for windows. I put it on both Reach and HiDef profile settings in properties. When debugging I get the following error: No suitable graphics card found. Could not find a Direct3D device that supports the XNA Framework HiDef profile. I made sure to select the 'Reach' profile, I still get this error. Graphics card is an intel GM45. It states support of DX10 on their website. Intel Core 2 Duo 2.2Ghz Windows 7 Professional Visual Studio 2010 Ultimate 3GB RAM So

Graphics Card and XNA 4.0

喜你入骨 提交于 2020-06-22 08:27:43
问题 I create a new project in xna 4.0 for windows. I put it on both Reach and HiDef profile settings in properties. When debugging I get the following error: No suitable graphics card found. Could not find a Direct3D device that supports the XNA Framework HiDef profile. I made sure to select the 'Reach' profile, I still get this error. Graphics card is an intel GM45. It states support of DX10 on their website. Intel Core 2 Duo 2.2Ghz Windows 7 Professional Visual Studio 2010 Ultimate 3GB RAM So

How do I check if a List contains an object of a certain type? C#

北城余情 提交于 2020-05-22 19:56:45
问题 I have a list (called Within ), and it contains objects of type GameObject . GameObject is a parent class to many others, including Dog and Ball . I want to make a method that returns true if Within contains any object of type Ball , but I don't know how to do this. I've tried using Count<> , Any<> , Find<> and a few other methods provided within C#, but I couldn't get them to work. public bool DetectBall(List<GameObject> Within) { //if Within contains any object of type ball: { return true;

MonoGame / XNA Draw Polygon in Spritebatch

只愿长相守 提交于 2020-04-11 05:02:07
问题 i am currently writing a game with MonoGame and I need to draw textured shapes. I want to draw polygons with 4 corners. All my renderstuff is done with the spritebatch. I tried to use TriangleStripes, but it does not work very well for me, because I don't have any experience with shaders and mixing this with the rest of the spritebatch-rendercode seems complicated. One solution i thought about was to draw a quad and strech the texture with texturecoordinats. Is this possible somehow? I can't

XNA beginner question about draw method

半城伤御伤魂 提交于 2020-02-06 15:56:42
问题 I understand that I have to draw everything in draw(), and it's looping continuously. But I don't want to draw texture again and again, for example I want to create a texture, draw something to texture (not spritebatch). than I will only draw that texture in draw(). Is it possible? What can I use? 回答1: Not drawing it again is a performance optimisation. You should only do that if you really need to. If you do need to do this, create a render target, draw your scene to the render target, and

When I change vertical size of XNA game window to minimum, it throws ObjectDisposedException for spritebatch, why?

主宰稳场 提交于 2020-02-04 01:15:30
问题 When I resize the game window and the viewport's height becomes 0, GC disposes of spritebatch, I think. Is this what happens? How do I prevent this? 回答1: Form gameForm = (Form)Form.FromHandle(Window.Handle); gameForm.MinimumSize = new System.Drawing.Size(800, 600); Short and sweet! 回答2: I had this same problem and some quick debugging shows that XNA calls UnloadContent and then LoadContent again to reinitialise resources; my guess it it loses the GraphicsDevice or something, hence the reload.

XNA - How to dim a section of the screen?

£可爱£侵袭症+ 提交于 2020-01-25 05:01:35
问题 How would you dim an image(or a section of the screen) so that you can show something else that's not dimmed as the focus? Sorry that it's a little vague and hard to understand, but I can't think of a better way to phrase it. 回答1: I don't know how efficient or smart this is, but spriteBatch.Draw takes a color to shade textures. You could try setting up a list of textures and apply darker colors to the textures that are meant to be dimmed. Something like: for(int i = 0; i < texturesToDraw

Xna transform a 2d texture like photoshop transforming tool

百般思念 提交于 2020-01-25 04:55:10
问题 I want to create the same transforming effect on XNA 4 as Photoshop does: Transform tool is used to scale, rotate, skew, and just distort the perspective of any graphic you’re working with in general This is what all the things i want to do in XNA with any textures http://www.tutorial9.net/tutorials/photoshop-tutorials/using-transform-in-photoshop/ Skew: Skew transformations slant objects either vertically or horizontally. Distort: Distort transformations allow you to stretch an image in ANY

Which way to go with graphic-intense multi-touch app, XNA or WPF?

丶灬走出姿态 提交于 2020-01-24 12:59:05
问题 I am about to start development of a multi-touch application. I need to decide between WPF and XNA. Which would run faster ? WPF already has libraries to support multi-touch via TUIO input. Does anyone know a similar library or even just sample code to drag/rotate/move objects in XNA ? Thanks! SW. 回答1: Touch is just another way of getting input from the user. Whether you route this input to an XNA app or WPF app depends more on what you want to do in the app. XNA is a lower level api for