XNA is a game framework by Microsoft that allows deployment for Xbox Live Indie Games as well as Windows Phone 7.

learn more… | top users | synonyms

1
vote
2answers
136 views

XNA blurring moving images

Why does XNA blurs the images which moves less than 1px in between two draws? It is quite annoying, because everything looks really blurry. Is there a way to disable it? I have tried to set the ...
1
vote
1answer
131 views

Tile Based Sprite Collision With Lots of Sprites [duplicate]

I am running into lag when loading many sprites onto the screen. If I have less than 12 on the screen it runs smoothly until I add a couple more and then it bogs down. I currently have this as my ...
0
votes
0answers
25 views

Farseer Physics, mass affecting velocity

I have just started with Farseer Physics, so I am kind of a newbie in this theme, so not a surprise that I have encountered something that is not involved by the engine, or I just don't know about it. ...
0
votes
1answer
114 views

Creating a gradient for a texture - Why is the color becoming dark on one side?

Updated While debugging I looked at the lerp and it was calculating into a negative number at the start. So I added in checks for to low or high a value, and that seems to have fixed it. I'll answer ...
0
votes
1answer
75 views

How do you calculate a gradient value within multiple colors (gradient stops)

In WPF/Silverlight XAML you can have a brush with multiple gradient stops at different points along the color line. I was able to replicate this behavior with two colors, a single color lerp, from ...
1
vote
1answer
126 views

How do I find two points at an angle on opposite sides of a circle?

With reference to my previous question: I'm using micklh's answer, which works perfectly. However, it calculates the gradient based on two points, a starting point and an ending point. I want to ...
1
vote
4answers
213 views

Cell Lighting Propagation Problem

I have in place a cell-based lighting system that works basically like this: (Not my actual code) //Light moves up for (int x = 0; x < width; x += 1) { for (int y = 0; y < ...
0
votes
0answers
41 views

Need Help with the Syntax for a Simple 3D Effect to Manipulate Quad Points/Vertices for PSM

I have been porting a game made in XNA, a 2D RPG, to PSM using Monogame. Unfortunately, I use a simple 3D effect that cannot be translated because Monogame did not write translation code for the ...
0
votes
1answer
142 views

XNA 2D Camera, zoom into player

My 2D camera follows the character fine without any zooming. However, when I tried adding a zoom feature using the Matrix.CreateScale(), the camera no longer follows the character properly. public ...
2
votes
1answer
124 views

2D lighting causes black rings to appear

A year ago I implemented 2d lighting in XNA using sprites. The sprites I used were created by placing a soft white photoshop brush on a transparant background. The result was this: (lights only) ...
1
vote
1answer
134 views

GameTime Replacement / Wrapper for Pausing , Slow-mo and 'Fast-mo'

I'm looking to change the way in which my game uses GameTime to run the game so that I can easily pause the game (elapsedTime = 0) or change how slow/fast the in game elements interact as a scaler of ...
1
vote
0answers
70 views

Using obj file in an XNA game [closed]

Sorry if this is a bit novice but I am far more into engineering than game development but I just want to make a small 3D game for fun with XNA (well actually MonoGame). The thing is that I don't have ...
1
vote
1answer
175 views

Sprite collision with color?

Is this possible? To elaborate, I am making a PacMan offshoot. Essentially it is a "zoomed in" version of the game, but the board is randomly generated. I have 11 .png files each to be used as a ...
0
votes
0answers
31 views

FBX animation file - Fixing Multiple Roots

I have a collection of nicely animated fbx files that all have the same issue explained here http://www.unwrap3d.com/u3d/quicktip_xna.aspx under 'Fixing multiple roots' section. This requires ...
0
votes
1answer
97 views

Farseer: How can I calculate the needed velocity in this case?

I have two platforms and one ball. The ball should fly from the red platform to the blue platform. The ball should land somewhere in the purple rectangle of the blue platform. How can I know how ...
0
votes
2answers
380 views

Simple 2d tile based lighting in xna

I am currently trying to implement simple lighting into my game. My world is represented in a 2d array of numbers, each number being a certain tile. I am changing the color parameter in the ...
1
vote
1answer
46 views

A Sensor’s ContactList Keeps Old / Ignores New Contacts, When That Contact Is still

Okay this is a hard one to explain so I’ll try my best. Basically every time my enemy class updates, it runs a SightCone Sensor Contact List test, so this is every single frame it checks for all the ...
1
vote
3answers
181 views

Code to generate a color gradient within a texture using a diagonal line

I want to generate a color gradient between two colors from x1,y1 to x2,y2. I'm unsure how to do this though. I can use Color.Lerp to get all of the color steps, but the problem is that I don't ...
0
votes
0answers
17 views

XNA 4.0- Help with firing projectiles at the mouse cursor [duplicate]

I'm making a Zelda-esque RPG in XNA and I'm confused on how to fire a projectile from the location of the mouse cursor? I've been trying to find a solution on the internet but to no avail.
-2
votes
1answer
50 views

Clamp the scroll wheel value [closed]

I'm having something like an inventory bar at the bottom of the screen. However, when the highlight square (indicates what object you are going to place) reaches the end. The value of the scroll wheel ...
1
vote
1answer
81 views

Update Camera manually after Camera's target updates, bypassing the game loop. Is this a good or bad practice?

This question may be suited better for codereview.stackexchange.com? I've been experimenting with a camera implementation / matrix SpriteBatch transformations and have run in to a bit of a snag. The ...
1
vote
2answers
174 views

Anti-aliasing a sphere

I render everything in my game in 2D with SpriteBatch with the exception of a spherical entity (orb) that I render as a spinning and dynamically lit (custom effect) sphere in 3D. I capture the sphere ...
0
votes
0answers
38 views

Matrix transforms with SpriteBatch overloading - how do you rotate/zoom around a point? [duplicate]

I have a transform matrix which works as intended for game objects I want to be completely controlled by my camera: _transform = Matrix.Identity * Matrix.CreateTranslation(-_position.X, ...
0
votes
2answers
59 views

If SpriteBatch.Draw's SourceRectangle is null does a rectangle still get created?

If you use the following SpriteBatch.Draw overload, does a Rectangle get created for the texture? spriteBatch.Draw(texture, textureRectangle, null, Color.White, 0f, textureOrigin, SpriteEffects.None, ...
-1
votes
2answers
97 views

How can I add a bullet every time the player clicks?

I'm not understanding how to dynamically add object instances in my games. I'm really having trouble understanding the general concept. If I want to quickly generate unknown numbers of objects, going ...
0
votes
1answer
85 views

How to loop through objects in class (XNA)? [closed]

In my game I have an Enemy class, and in that I have a constructor which I use to make Enemy objects. How do I add all Enemy objects to a list or loop through all of them using a foreach loop? I ...
2
votes
2answers
174 views

How can I provide a scrollable inventory list?

Does XNA have a built in method for drawing a scrollable list? There would be a scroll bar on the right that can be selected and moved up and down to scroll the list inside the inventory screen. The ...
0
votes
2answers
61 views

Attaching a Body to another, without the new body impacting the physics of the first in ANY WAY

Basically I want to add a vision / sight cone to an enemy body, So I have the sight cone body, and enemy body, but every joint or weld I have tried so far has caused the sight cone to severely ...
2
votes
1answer
230 views

Scaling textures with nearest neighbour without having to use seperate sprite batches

I'm interested in being to scale textures up via nearest neighbour. I can do this via a SpriteBatch.Draw() overload however this means that any other sprites drawn within that batch will also have the ...
0
votes
2answers
139 views

“Fading” effect between different screens?

I'm not sure what the correct word for it is, but I'm thinking like the fading effects when you move between different screens in Powerpoint or Keynote; that the screen fades black before the new ...
2
votes
1answer
112 views

How to smoothly track and draw player movement?

I am currently using C# XNA Framework to simply connect some development concepts that I've learned/used over the past few months. Right now I have a Web Service that keeps track of connected clients ...
0
votes
1answer
59 views

In an XNA game object, what should I use to represent a texture for serialization?

While trying to save to a file a list of objects needed to run my game, I noticed that Texture2D is not serializable. Why? What was the purpose? The object I want to serialize looks like this: ...
0
votes
1answer
137 views

XNA 3D Unable to Position Bounding Sphere

I have a collision method which seems like it would work, and it does, but the bounding sphere is always at 0, 0, 0. How do I fix this? Any more code and or details are avaliable upon request. Any ...
4
votes
4answers
564 views

How can I develop in MonoGame without relying on .xnb files?

I'm new to game development, and MonoGame seems like a beginner-friendly framework, so thought I'd start with that. However, as I started reading tutorials on it, I noticed a common theme: That at its ...
0
votes
1answer
49 views

how to make a onMouseEnter events in xna

I have been trying different things all day to get the answer. What I need is a sound to play one time when I enter a given rectangle I need the sound to fire one time and never fire again until I ...
1
vote
1answer
109 views

Is setting the render target back to backbuffer supposed to take long?

I am creating a game in Monogame (XNA extension). I draw to a render target to display menu items for my game. Everything works fine, however... Whenever I set the render target back to the back ...
3
votes
2answers
340 views

What's wrong with using a static class to load and expose all of my assets?

What are the pitfalls associated with loading and storing all references to all of your content/assets within a single static class? I've been trying to ask myself why I would want to instantiate an ...
0
votes
1answer
87 views

Blurry Background Images When Player is moving

So I've been developing a platformer and the when the player moves around the world the background images and tiles become really blurry. I've tried a number of fixes. I've made sure that the position ...
1
vote
1answer
72 views

XNA Render Targets Depth Testing

I imagine this is a problem that gets asked quite often, but reading up on it I can't seem to get a definitive answer on how to solve it. I've got two HLSL shaders (I've simplified them in the ...
1
vote
1answer
83 views

Better way to handle ordering and visibility of renderable objects?

I'm just wondering whether there is a more effective way to handle the ordering and visibility of renderable components that fits into the design of my already existing engine. How I do it now: In ...
0
votes
1answer
92 views

What is the value of gameTime.ElapsedGameTime.TotalSeconds?

I was wondering what is exactly the value of gameTime.ElapsedGameTime.TotalSeconds in a second? Please explain it to me completely and as great as you can.
1
vote
3answers
212 views

In a semi-infinite procedural (chunk based) map, how do you handle objects larger than a single chunk?

I'll use an example to try and be more specific. Assume this is for a 2D top-down game. Chunks in this are made up of 32x32 tiles. If procedural buildings were to be generated based on some kind of ...
2
votes
2answers
120 views

Is the GraphicsDevice.Clear call in XNA necessary in 3D?

It's a touch embarrassing to ask I think, but I've just never paid it any attention before and used it as I've seen in tutorials or the like in the past I believe. Is there a need to use ...
2
votes
2answers
157 views

How can I measure the velocity of a drag gesture?

I want to measure the velocity of a drag(FreeDrag, VerticalDrag, HorizontalDrag) gesture on my Windows Phone. For example, if the measured velocity of a drag is 40 km/h, the player will shoot a bullet ...
0
votes
1answer
106 views

How to rotate model, around its own center?

I have a 3d Model that it wasn't made from the origin of the 3d program, lets say that it was built at (100, 100, 100), I know how to rotate a model, but around the model origin point, (0, 0, 0), now ...
0
votes
1answer
130 views

Was my horizontal drag performed from left to right or from right to left?

I want to determine if a horizontal drag was performed from left to right or from right to left. In addition, I want to do the same with the vertical drag. How can I do that? How can I check if the ...
0
votes
0answers
94 views

Encapsulating variable elements into one drawable object - XNA/MVVM

Ok so I'm building a game and there is a class for an Object which gets the Values of a specific card from a XML Table and stores them in varibles. Note: I will have many "Card"'s instantiated at any ...
3
votes
1answer
89 views

Cant get a Farseer Physics body’s rotation to follow the mouse

Here is what’s in my HandleKeyboard() method that is called from the Game1 Update method. MouseState mState = Mouse.GetState(); // the Vector2 that will hold the angle from the player ...
1
vote
0answers
95 views

Xna GraphicsDevice.IsFullScreen causes strange resolution stretching artifacts

Sorry for the non-descriptive title. So I've been trying to implement fullscreen mode into my xna-game, and I've hit a couple of roadblocks. My basic code setup for this functionality is the ...
1
vote
0answers
96 views

What is safe to do with the graphics device on a different thread in MonoGame and how to detect physical limitations of the memory?

I'm working on a UI system that does it's processing on a separate thread. However, the results of this processing must end up on the GPU eventually. A simplified overview of the system boils down to ...