XNA Game Studio 4.0 is a programming environment that allows you to use Visual Studio to create games for Windows Phone, the Xbox 360 console, and Windows-based computers.

learn more… | top users | synonyms (1)

0
votes
1answer
21 views

Adding SpriteFont in Monogame

My question is probably something you guys have heard before - "How do you add SpriteFont's in Monogame's content manager?" The simple answer to this is, right click the 'Content' folder, go on 'Add ...
0
votes
0answers
23 views

DrawBone Angle variable using Kinect

when we want to draw Bones into XNA (using KnectSDK and C#), you have to calculate differences between two joints and draw bones between them. this is the function for drawing Bones: private void ...
1
vote
3answers
136 views

2D HLSL World position

I'm trying to get world position from my vertex shader to my pixel shader so that I can disable the shader once a preset X coordinate has been passed (no shading once I'm over X). Getting the screen ...
1
vote
1answer
19 views

Missing texture coordinates for channel 0 Fbx and XNA 4.0

I'm getting this error while trying to load a model in XNA 4.0 : Error 2 The mesh "transform1", using SkinnedEffect, contains geometry that is missing texture coordinates for channel 0. The model ...
-1
votes
1answer
65 views

How do I make my sprite freeze on a frame? [closed]

I'm trying to make a working duck animation but the animation keeps looping, how do I make it so that the duck animation freezes on a sertain frame? Right now I use a variable to loop it so that it ...
0
votes
0answers
43 views

How to draw Farseer destructable terrain XNA

XNA: 4.0 Farseer Physics: 3.5 I am struggling with drawing my Farseer Phyics terrain. Due to the fact that this terrain is destructable, I need to have a way to update the drawing of the terrain to ...
0
votes
0answers
26 views

Monogame. Xml files not included on deployment

We are making a XNA game and porting it with MonoGame. The game works fine on deployment, it finds without a hitch the xml files we need for the content. On publishing however, the files are never ...
0
votes
2answers
54 views

Issue implementing proper collision in XNA Game Studio 4.0

I am building a game in XNA 4.0, where a player moves about a 2 dimensional (vertical perspective) map consisting of blocks. My issue is creating proper collision between the payer and the blocks ...
0
votes
0answers
12 views

3D Model in the midst of tracking state inferred and tracked

I am developing Kinect motion capture application by using XNA framework.My 3d model's bones are sometimes at the state inferren and tracked ,so for example the hand is being at the very unrelated ...
0
votes
0answers
14 views

how to add .tif importer to skinned model pipeline

I have model which is occuring .tif components but XNA can not import .tif.Because of that I should add a .tif importer to my skinned model processor. How can ı add this? My SkinnedModelProcessor into ...
0
votes
0answers
49 views

Having trouble getting shader to work with sprite batch in XNA #4

I found a neat "CRT screen" effect shader on the web, but I've never used shaders before and I can't seem to get it working properly. If I do the second sprite batch in my code here normally without ...
4
votes
1answer
104 views

Odd Behaviour XNA Game Component

Inside of my main class file I am initializing a number of game components which are used to represent game scenes i.e. main menu and game. I am initilizing each component inside of XNAs LoadContent ...
0
votes
0answers
39 views

Handling menu input in the GameStateManager sample

I've been trying to get more customization out of the GSM sample and i'm a bit lost. I've made a new method in InputState.cs that returns true when a key is being held down. This is for scrolling ...
1
vote
1answer
55 views

XNA Texture.GetData “Size of the data passed in is too large or too small for this resource.”

I am attempting to retrieve the color data for a given sprite located on a texture atlas by creating a new color and passing a source rectangle width and height for the given sprite. I am then passing ...
1
vote
1answer
53 views

Use of SpriteFonts without installing on host machine

I am working on a Windows game for my university project. In this project I am using a custom TrueType font which is not installed on any university computers. For submission my game is required to ...
2
votes
1answer
87 views

Is it bad practice to add GameComponents and DrawableGameComponents outside of the main initialization method?

I'm working on a snake game that has multiple game objects (snakes, apples, obstacles), and game modes (classic, adventure), that are DrawableGameComponents. Is it OK that I'm adding them as needed ...
0
votes
0answers
109 views

2D animated sprite jumping and gravity physics

I'm currently writing a Megaman clone for my school project. So far all I did was making the character run and stay put when needed. Know I want to be able to make him jump using the 'X' button. I ...
0
votes
0answers
60 views

SetRenderTarget(null) clearing previous draw calls

I'm not sure if everything's working as it should be or whether I'm just not doing something properly, but I couldn't find anything that discussed this so I thought I'd ask here. I'm using Monogame ...
0
votes
2answers
43 views

Can you save a png in XNA larger than the backbuffer width?

I'm looking at using the 'savetopng' method of the texture2D class to draw out custom textures. My problem is that my viewport is quite small (the application runs in a window) and the textures will ...
0
votes
0answers
119 views

How do I open/edit a *.xnb file in XNA Game Studio 4.0?

I've downloaded a *.xnb font sprite, but I don't know how to open/edit it. I installed XNA Frameword 4.0 in VS 2010. Thanks for your help!
-1
votes
2answers
69 views

Speeding up sprite the second time it passes the screen [closed]

I'm a student studying Games Development. I want a sprite to speed up on it's second passing of the screen. How do I do this? Code I wrote so far: public class Game1 : Microsoft.Xna.Framework.Game { ...
1
vote
0answers
100 views

Collision detection implementation suggestions

I'm working on a simple 2D game involving a rotating octagonal ring where a sphere sprite moves up/down avoiding objects as the ring rotates faster and faster. I'm having a difficult time with the ...
0
votes
2answers
250 views

Water Physics In top down 2D game

I have been making a game like Minecraft or Terraria in which you add blocks and such to the world, and I came across this interesting debacle, the game is in a top down 2D perspective, and I would ...
1
vote
3answers
117 views

Get highest (Y-axis) vertices from primitive d20 dice in xna

I have created a d20 dice (icosahedron) in xna and used BEPU physics to roll it. But now I'm trying to get the value from the dice after its rolled. I was thinking about looking for the 3 vertices ...
0
votes
0answers
110 views

How to block Kinect rotation

I'm developing a Kinect Project using C# and XNA 4.0. Now facing a problem that I couldn't solve. When the player turn around himself, the avatar doesn't turn, but its arms and legs are trying to ...
4
votes
2answers
217 views

The XNA redistributable isn't in the prerequisites list; how do I include it when publishing?

So I created a small project in XNA 4.0, and wanted to try and publish it, and so I did. Yet when attempting to install it on a different computer it didn't seem to work. I've read and studied about ...
0
votes
0answers
104 views

graphics.IsFullScreen resetting to false after game constructor and graphics.ApplyChanges()

This is a MonoGame 3.2 Windows (DirectX) Project. I've tried setting graphics.IsFullScreen to true in the game's constructor and in the game's initialize function, both times running ...
0
votes
1answer
89 views

Find world matrix

I'm making my first 3D-game with XNA (MonoGame) and have come to a point where I wish to add a crosshair for the player. To do this I need the on-screen coordinates of the location where my fighter ...
1
vote
1answer
30 views

XNA Texture2D storage question

Are Texture2D objects stored on the graphics card or on system memory? I am thinking that the backbuffer is located on the graphics card (by default) and that the textures are on the system memory. I ...
0
votes
1answer
36 views

XNA - Autodeploy .exe of game upon succesfull commit to GIT

I know of ClickOnce which creates an .exe file so a user can play my XNA game. However, I have to manually go through a wizard in order to create this file. I would like for the new .exe to be ...
1
vote
2answers
81 views

Loading and storing content efficiently

So for example I have a class called TypingKeyboard. It allows you to display a string while it's being typed by the computer with sounds. I need one in the menu, for the title. And one for the ...
1
vote
1answer
68 views

How can I determine whether a unit is in range or not?

I'm programming a small game that's going to be somewhat like a tower defence. I was playing around with how I determin whether a unit is in range or not. public void Update(GameTime theGameTime) ...
0
votes
1answer
36 views

Should I Open/Close SpriteBatch with different settings?

I'm still new in game developpement, and I'm trying to complete my 1st game. Its a simple 2d game, but i'm trying to add lots of differents techniques in it. It's all good when you take a single ...
1
vote
0answers
60 views

Any easier way to add networking to an XNA game? [closed]

I know that the MSDN has an article on this but I'm not developing for Xbox so I'm not sure if I should use NetworkSession or LocalGamer etc etc because I think they are Xbox only. But I haven't tried ...
1
vote
3answers
125 views

Removing something on Collision?

I have my collision detection code working so how would I tell my HealthPickup to disappear when my Player collides with it? I haven't played around with it yet but I think I may have to somehow ...
1
vote
2answers
221 views

Detecting Hitbox Collisions (Rectangle)

So I have some Hitboxes set up on 2 classes, HealthPickup and Player. public static Rectangle Hitbox; public override void Initialize() { Hitbox = new Rectangle(Pos.X, Pos.Y, 32, 32); } That's ...
1
vote
2answers
149 views

How to Calculate Velocity in a 2D space game

I am currently using screenpos.X = (float)(screenpos.X + velocity * Math.Sin(r)); screenpos.Y = (float)(screenpos.Y - velocity * Math.Cos(r)); For my Movement with r being the Rotation in Radians. ...
0
votes
1answer
83 views

XNA 4: RenderTarget2D textures getting transparent on fullscreen

I'm generating a Texture2D object using RenderTarget2D as in the following code public static Texture2D GetTextTexture(string text, Vector2 position, SpriteFont font, Color foreColor, Color ...
1
vote
1answer
98 views

How do I temporarily pause an XNA game?

Collision with an enemy should pause the game for 1.5 seconds. My failed attempt: bool tPause; float timer; public ovveride Update(GameTime gameTime) { if(!tPause) { // ... ...
1
vote
3answers
339 views

Rotation matrix for a 3D vector

I have a direction vector on which I have to apply some rotation to align it to positive z-axis. To use Matrix.CreateRotationX(angle) of XNA, I need the angle for which I'd have to compute cos or tan ...
0
votes
1answer
52 views

Sprite sheets, Clamp or Wrap?

I'm using a combination of sprite sheets for well, sprites and individual textures for infinite tiling. For the tiling textures I'm obviously using Wrap to draw the entire surface in one call but up ...
0
votes
2answers
238 views

How can I make an object's hitbox rotate with its texture?

In XNA, when you have a rectangular sprite that doesnt rotate, it's easy to get its four corners to make a hitbox. However, when you do a rotation, the points get moved and I assume there is some kind ...
0
votes
1answer
56 views

Applying textures to 3D models

I want to apply textures to a 3D Model in XNA 4. Whatever I saw on the internet was to apply the textures in the modeling tool and then load the model (*.fbx) into XNA. Is it possible to load the ...
0
votes
0answers
56 views

XNA Windows Resolution / Mouse Position Bug

In XNA, when in windowed mode and resolution (set via PreferredBackBufferWidth/Height) is close to the resolution of the display, the view is distorted (zoomed in a bit)and the mouse coordinates are ...
1
vote
1answer
63 views

RenderState in XNA 4

I was going through this tutorial for having transparency which can be used to solve my problem here. The code is written in XNA 3 but I'm using XNA 4. What is the alternative for the following code ...
0
votes
0answers
34 views

Transparency in XNA-4 primitives

I'm using XNA 4 with Visual Studio 2010. I'm trying to create a simple 3D world with walls and doors in which the user to free to roam around. A wall is just a rectangle which is currently being ...
3
votes
1answer
409 views

XNA, how to draw two cubes standing in line parallelly?

I just got a problem with drawing two 3D cubes standing in line. In my code, I made a cube class, and in the game1 class, I built two cubes, A on the right side, B on the left side. I also setup an ...
2
votes
1answer
127 views

XNA 4.0 HLSL - strange depth map

I want to draw my pre-rendered depth map to the scene. I get my depth value in the following way: basically (Pixel Shader) // Depth is stored as distance from camera / far plane distance, 1-d for ...
2
votes
1answer
127 views

SpriteBatch, trying to reduce draw calls

This my main draw call: Matrix Camera_transformation = player_camera_.GetTransformation(); // Background - AlphaBlend spritebatch.Begin(SpriteSortMode.Deferred, ...
0
votes
1answer
46 views

When to get input state: multiple times or one time in a static class?

Let's say I have these classes: Player Here I want to make the player jump: current_state_ = Keyboard.GetState(); if ((current_state_.IsKeyDown(Keys.Space) || ...