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

0
votes
2answers
36 views

Using shader for cubes

I am trying to use a shader to get an effect like this. Notice how every cube has exactly the same lightning as every other no matter where it is on the screen if you look closely the lightning is ...
0
votes
1answer
26 views

XNA draw texture/font and DrawIndexedPrimitives at the same time

When i Draw a texture2d or a font with spriteBatch and also draw GraphicsDevice.DrawIndexedPrimitives, the frame is draw weird SpriteBatch spriteBatch = new SpriteBatch(GraphicsDevice); BasicEffect ...
0
votes
2answers
38 views

Drawing 3D cubes with xna

I managed to draw a 3d cube using triangles like this: protected override void LoadContent() { basicEffect = new BasicEffect(GraphicsDevice); VertexPositionColor[] ...
0
votes
0answers
24 views

XNA sound effect loop cancel

I'm using SoundEffectInstances in XNA to play a tone. This means I have ~.005 second clips playing on a loop. It sounds fine, but I can't gracefully stop them because XNA gives a ...
0
votes
1answer
49 views

Multiple models not drawing

I got Camera, Terrain and player working, moving around, etc. When I try to add another player (another model to draw) it just dont any of the models. Here is my code; public class World { public ...
-1
votes
0answers
72 views

FPS Drops From 59 to 29

I am creating a 2d platformer and I am getting fps drops from 60 to 20. It might be my collision code, but this was the only way I could get it to work with slopes. private void CollisionCheck() { ...
0
votes
3answers
121 views

Drawing image with an angle

Edit: the images below aren't supposed to have whitespace. I am just trying to show you that i am trying to create a rectangle from a 1x64 image, positioned as shown in the second picture I know how ...
0
votes
1answer
81 views

Lightning bolt effect with particles is not continuous

I am Drawing a lightning effect animation using this image: Below the result: As you can see the outcome is not a continuous purple color as I wanted it to be, but it has black spaces in ...
0
votes
1answer
129 views

AI movement in 2D

I've got a prototype of a game I've been mocking up and found myself struggling to find a solution for AI movement in a 2D tile based game. Here's the issue: The player is free to roam throughout the ...
0
votes
1answer
54 views

XNA: How to capture precise time of button press?

I'm guessing the default XNA model encourages checking for button presses in Update(). However, I am developing a game-like application for research and need to measure reaction times as quickly as ...
0
votes
2answers
78 views

Voxel Engine in XNA - Block as Class Renders, Block as Struct Doesn't

Edit: I almost forgot to mention - when I place NEW blocks they render, but nothing triggers the originals to render (I have a button assigned to recalculate/redraw for every block surrounding (and ...
0
votes
1answer
31 views

How to order objects with the same depth in the spritebatch cycle?

I have a tilemap in a isometric 2.5 view and i have also many objects moving and static. The problem is many statics are standing in a "integer" place for obvious reasons and the depths of each object ...
0
votes
1answer
45 views

Add XNA math references to non-xna project

I'm developing some game with server/client structure, and the client will predict the movements, but it should be validated by the server. In the client part, I got it moving nice, but now I'm trying ...
0
votes
4answers
80 views

YAW not working correctly with XNA

I successfully draw the model, and made it move forward and backward, but when I try to make it rotates (yaw) its not working correctly, like its moving too instead of only rotate. Here is my camera ...
0
votes
1answer
26 views

How to rotate model 180º with XNA

I got a model, and a camera pointing at this model, I think my camera position is the problem. Its showing the front of the model, but I want it to show its back like in third person. My camera code ...
1
vote
1answer
82 views

How to position a Weapons model in a first person shooter with XNA

I am building a first person shooter and positioning the weapons is hard. I am trying to get the bat to look like you are holding it but I keep trying things and they don't appear in the positions I ...
2
votes
3answers
144 views

2D Smooth Tile Lighting

I am currently working on a 2d platformer and have the general idea of how to apply 'lighting' to my level, but I am not sure at all how to make it smooth, similar to Terraria, as you can see here. ...
0
votes
0answers
14 views

fbx file asks for fbm file in xna?

I downloaded a bat model from the internet and I went to Blender, used texture and shading as I want, then I exported it as a fbx file. Next I placed it into my content pipeline and ran it but it is ...
0
votes
1answer
14 views

Porting WP8 to IOS GraphicsDevice Error (Monogame/Xamarin)

I seem to be having a problem porting to IOS. I have my game working on WP8 and Android with any major issues but when trying to run on iPhone I seem to get an error when initialising the ...
0
votes
2answers
55 views

Stuttering Character When Colliding With Wall XNA 4.0 Help!

I'm trying to make a platformer game without tiles. I've made a collision handler to handle collision between Player and Stage(platform)and a collision checker, here's the code: public void ...
0
votes
1answer
92 views

How can I map regions on a world map image?

I am trying to use a map of the real world, but I need to have a way to break it down by countries and regions. Ideally down to a province level. I figure that I'd need to be able to define ...
1
vote
1answer
44 views

Draw multiple triangle strips in one draw call DirectX

I'm running into a bottleneck where I'm drawing many basic disconnected colored triangle strips in DirectX 9 (XNA). The problem comes with drawing them all in seperate draw calls, so I'd like to batch ...
0
votes
1answer
33 views

Array Rectangle Collision Handling Inconsistency XNA 4.0 [closed]

I made a simple collision detection prototype.Here's the code for the Player class's collision handler: public void handleCollision(GameObject OtherObject) { ...
1
vote
1answer
41 views

XNA texture garbage collection

I use a Dictionary<string, Texture2D> for storing textures and every texture in the game is a reference to a texture from this dictionary. However when all references are gone, does the ...
0
votes
1answer
45 views

Issue with fps limiting in XNA

The game I am making runs at 60 fps, but occasionally it will drop lower than that. I want to limit the frame-rate to 30 fps so that those drops will be less noticeable. I don't understand everything ...
0
votes
2answers
133 views

C# xna/monogame ghost trail effect

I would like some know how can someone make an animation like this, in Monogame specifically.Since i am completely clueless on how to go around this i how should i go about this ? I hate asking ...
1
vote
0answers
123 views

Xna 2d texture antialiasing

I've got a problem with drawing 2D texture in xna 4.0. My program generates terrain texture: The problem is in rough surface of my texture (dark-blue) that is generated by-pixel. Is there any ...
0
votes
1answer
54 views

XNA/Winforms - Nothing being drawn after calling SetRenderTarget(null)

I'm creating a basic scene/level editor using XNA/Winforms using the base classes from http://xbox.create.msdn.com/en-US/education/catalog/sample/winforms_series_1 Everything works fine and gets drawn ...
1
vote
2answers
64 views

XNA/Monogame inverting a BoundingBox

I have a box that is drawn around my game that I want to check collisions with. Currently my BoundingBox is made in a way that whatever is inside the box is colliding with it: BoundingBox bb = new ...
0
votes
1answer
156 views

MonoGame: Draw thousands of quads without hardware instancing

In my game, every bit of geometry is a textured quad billboard in 3D. I have many thousands of these things on screen at once, sometimes with overdraw. As I understand it, there are a few ways I can ...
2
votes
1answer
53 views

MonoGame SetRenderTarget is wiping the backbuffer

In my Monogame (XNA) Windowed App, compiled for Windows PC, running on Windows 7, I have public RenderTarget2D renderTarget = null; In the Inititate() function I have renderTarget = new ...
0
votes
1answer
40 views

Making multiple VertexPositionColor variables in the same class? - XNA

I have studying XNA on my spare time for about a year now and I could use some professional help on this issue. Any time given to my problem is appreciated. I have two VertexPositionColor variables ...
1
vote
0answers
48 views

Why does XNA create two GraphicsDeviceManager services?

While working with XNA today, I looked at the debugger information for Game.Services to retrieve the GraphicsDeviceManager so that a component could utilize it. Instead, I found two different objects: ...
0
votes
0answers
102 views

Help slope tile collision platformer (XNA/C#) 2D

I have been creating a platform game in C# and XNA, everything works pretty well least the slope (down left and right). This is the project that I have so far. PlatformGameEngine.rar if the ...
6
votes
1answer
825 views

How do you handle 'move to mouse', if the player is already at the mouse?

I'm making a top-down-2D game. When my player moves, the cursor does not move with it. In my game, the player moves by facing the cursor and then walking toward it. This means that eventually, the ...
0
votes
2answers
108 views

Creating Entities from Identifiers (C#)

I am writing a game in C#/XNA. Often, it's useful to have a function like this in a game engine: Entity CreateEntity(string id, Vector3 location) { ... } So that, for instance, you ...
0
votes
0answers
40 views

How can I determine the number of pixels drawn within a predefined shape on the screen?

In the image above, I want to know how can I calculate the number of pixels of the rendered players' shadows that are inside the elephant outline. An occlusion query is used to count the number of ...
1
vote
1answer
38 views

XNA Weird Alpha Blending

I recently implemented a prelighting renderer for my XNA voxel engine, but there is now a weird alpha blending glitch. When I render to the light map, I set the graphics device's blend state to ...
1
vote
0answers
30 views

XNA Texture2D GetData [closed]

this is my code for creating Texture2D from depthFrame of Kinect : private short[] depthData; private Texture2D depthTexture; Color[] depthTextureData; if (null == this.depthData || ...
0
votes
1answer
71 views

Why does RGB order differ between color formats?

On the reference page for SurfaceFormat, it indicates that the Bgra4444 format is an unsigned format which is 16-bits long, with 4 bits per color with alpha. Further down the page, it describes the ...
1
vote
2answers
149 views

How to show my XNA game in form C#

I have a game in XNA, I want to connect this game with WindowForm to show for example the distance and the position. I tried to apply many tutorials that talking about this. but here is my problem : ...
0
votes
1answer
29 views

How can I make sure custom XNA content processors find included files with relative paths?

MSDN has an example of a custom HLSL effect importer and processor. Here is the importer's code: public override PSSourceCode Import(string filename, ContentImporterContext context) { string ...
0
votes
1answer
88 views

Insufficient memory on creating vertex buffers

I'm building a voxel world generator with XNA where the voxels are rendered as polygonal cubes. The world is divided into 1024 chunks of 32x32x256 cubes each (as 32 chunks by 32 chunks), and each ...
0
votes
1answer
32 views

Texture2D.SetData Method Overload

Been reading up on various methods in the XNA framework, and found this one. I've done some Google searching, but I can't seem to find any information on how to use this particular method overload. ...
0
votes
1answer
123 views

Best way to go about collision between rectangle and bool array containing pixel data?

Basically, if I have an array along the lines of bool[] collision; Filled with a value for each pixel in the sprite I am checking collision against (pixel 1 = true, pixel 2 = false etc), how do ...
2
votes
1answer
115 views

Where to save game data?

For my game, I'm currently considering where I should save the player's information (configuration files, state saves, player generated content). 'Where' refers to the physical location on disk. I ...
0
votes
1answer
87 views

How to get display resolution (screen size)?

How to get display resolution in XNA/Monogame ? I tried these on my monitor (1600x900): The below give me 800,600 //1. GraphicsDevice.DisplayMode.Width GraphicsDevice.DisplayMode.Height //2. ...
1
vote
2answers
60 views

Better way to position objects in a Matrix/Grid shape

I am working on space a invader game and I'm trying to build levels such that in each of them, the aliens are positioned in a different shape. I have a rectangle shape, circle shape, and a grid-like ...
2
votes
1answer
48 views

Alternative Font loaders in Monogame Framework

While working on projects of mine, I have been finding that it is a huge pain to switch operating systems just to create a simple spritefont when using Monogame. I saw that the Nuclex Framework can ...
1
vote
1answer
24 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 ...