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
0answers
7 views

Model not rendering in XNA

I've used the code from the Going Beyond 1 tutorial on MSDN and have succeeded in rendering two spaceships. I moved the rendering code into a base class, and have a list of this class and just do a ...
0
votes
0answers
19 views

XNA Pixel Collision Detection

I've been working on a platform game and I'm trying to get the player to move diagonally on a tiled surface using pixel detection but for some reason I can't get it to work. here is the code (very ...
1
vote
0answers
37 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
58 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
762 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
87 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
36 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
31 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
votes
0answers
21 views

2D Sprite movement XNA [closed]

I'm using XNA to make a 2D game. How would I use keyboard input to move a simple sprite around the screen? Any help would be greatly appreciated.
1
vote
0answers
29 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
65 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 ...
0
votes
2answers
110 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
0answers
27 views

raise an event when an object appears using HLSL and XNA [closed]

I've written an HLSL code to make transparency of player using depth view of Kinect on the background image. this is my HLSL code : sampler stream : register(s0); sampler back : register(s1); sampler ...
0
votes
1answer
23 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
80 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
21 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
66 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
103 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
53 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
58 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
42 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
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 ...
1
vote
1answer
58 views

XNA: “TextureCoordinate0” missing, but I'm not using textures

I'm trying to create a voxel game using XNA, but I'm getting a somewhat bizarre error when calling DrawIndexedPrimitives(): InvalidOperationException was unhandled The current vertex declaration does ...
0
votes
1answer
26 views

Drawing in a static location when using a camara transform

I'm using a matrix transform to move a 2d camera in Monogame, and I was wondering: How, if I initiated my spritebatch with a matrix transform, can I draw something in a static (non-moving) position? ...
0
votes
1answer
38 views

Why is 2D light ray collision result getting inverted at specyfic angle

recently i've been working on 2D lighting for my game. I've created new little project, and I've encoutered a problem. The collision between light ray and the object is fine at angles 316-360 and ...
0
votes
1answer
44 views

Draw my array at a position defined with Vector2

I'm developing a space invaders game in C# using XNA Game Studio. So I got some of the invader logic complete: An array holds the invaders and draws them on the screen, animated and moving.But I can't ...
0
votes
1answer
64 views

How do I avoid going through objects at high speed? [duplicate]

I am quite the beginner in XNA. I have only recently started using GameComponents. I have a multiplayer game called Better Pong. I move the ball (which is an object) by incrementing the Vector2 (the ...
-1
votes
1answer
83 views

Sprites get terribly scaled

I've been making a Space Invaders game in XNA for a while. I got the invaders animated and contained within an array. But when I call spriteBatch.Draw and debug the invaders sprites get a huge ...
0
votes
1answer
36 views

Is there a way to use the ContentManager with full directory paths

So i want to figure out a way to use the ContentManager.Load method with full directory paths, so lets say Content.Load<T>(@"Images\SomeImage"); becomes ...
0
votes
2answers
43 views

Loading content into an Winforms/XNA Editor's content project

So i am bulding a game editor/engine basically for teh lulz but i have encountered a problem i cannot seem to fix, i cannot load any new content through the Winforms UI during runtime. I tried using ...
0
votes
2answers
12 views

Setup VertexPositionTexture array for a texture2D at a location

I am trying to adjust the following code to render a quad on a 2D texture at a specific location and specific size. Currently this code will render a fullscreen quad, which makes sense since the ...
0
votes
2answers
82 views

Transparency using HLSL in XNA

I currently working on Depth Data on Kinect SDK v1.8 on XNA and I wanna show an Image Inside the Depth view of Human body. the image below is just an example of what I wanna do : ...
2
votes
1answer
63 views

How does XNA's KeyboardState represent all keyboards?

I already understand how to work with Keyboard and KeyboardState, but when debugging I happened to take a look at the KeyboardState's non-public members via the VS debugger. I expected to see a large ...
8
votes
2answers
326 views

How do I perform an xBR or hqx filter in XNA?

I'd like to render my game scaled up with one of the hqx filters (hq2x, hq3x or hq4x) or an xBR filter in a shader. How can I do this in XNA 4.0 and SM3? Side note: this question has been heavily ...
0
votes
1answer
94 views

Rendering a fullscreen quad is leaving a one pixel line on the left and top

I am rendering a fullscreen quad using XNA. I am having an issue where the top pixel line and left pixel line are not rendered. It should be black in the picture. Can anyone tell me why this might be ...
-1
votes
1answer
149 views

C# XNA - How to animate using Texture Atlas/ Sprite Sheet

I have a problem which I need to resolve. I am making a Space Invaders game in C# XNA. I've been following this tutorial for the Invaders: ...
0
votes
2answers
109 views

How to Create a New Instance of a Game Object

Alright, please don't scald me here haha. I'm very new to XNA, C#, and game development as a whole. I have done web-design, but that is my main experience with programming. It is a Space Invaders ...
0
votes
1answer
66 views

Loading Song in MonoGame Windows

I cannot load the song into my game. I got error in both templates WindowsDX and WindowsGL. Monogame Develop Build 1252 Both files .wma and .xnb are exist in Content folder and Build Actions are sets ...
3
votes
2answers
65 views

In XNA 4, how can I access SpriteBatch's transformMatrix in my shader?

I would like to use a custom effect with a regular XNA SpriteBatch. I have a 2D camera which computes a transform matrix, so I need my shader to take this into account. I have put a world matrix ...
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
90 views

Layers with parallax in a game with zoom out by a transformation matrix

I'm trying to implement a parallax rendering to my multi layered backgrounds. It's a classic 2d fighting game like The King of Fighters and Street Fighter. It may have a stage composed by 5 layers. ...
0
votes
0answers
41 views

C# XNA Weird black line behaviour of sprite animation spriteBatch.Draw()

So I've been making a Space Invaders game in XNA. I have my ship spritesheet (sprites are left-to-right - horizontal). The spritesheet has 6 sprites. Here's my class: playerShip.cs using System; ...
0
votes
0answers
56 views

XNA C# - Get original rotation from parent bone transform

I have a 3DS Max made model, exported into FBX and imported into XNA project. The parts I am working with have NOT been rotated in Max (specifically, collision mesh is made of Axiz-Aligned boxes). ...
1
vote
1answer
45 views

TypeLoadException when running a Monogame Windows Phone 8 game

Using Monogame, I'm trying to port a game to Windows Phone 8, but I'm having issues getting a basic example to run. When I create a basic Mono project and run it on my phone (to check everything's ...
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 ...
1
vote
2answers
162 views

How can I create an aperture-closing effect?

I'm looking to create an effect like this in a game I'm making: I would describe it as a camera aperture closing. I have the following requirements: I need to be able to reverse the fade (open ...
2
votes
1answer
45 views

XNA: How do I match Spritebatch View/Projection Matrices with BasicEffect Matrices?

I'm rendering a bunch of 2D content using SpriteBatches to a default XNA viewport. A simple 2D camera is used to move around the scene, which generates a transformation matrix passed to each ...
0
votes
0answers
56 views

How to move vertices of matrix in order to cast a 2d shadow?

I am trying to add shadows to my 2D xna game. Currently I have created a "shadow" using the texture of the caster with a transparent gray color, rotated, and stretched using a matrix. This, though, ...
1
vote
0answers
44 views

XNA and Json.Net - Recognizing types when deserializing with inherited classes [closed]

The title may seem a bit confusing, so let me explain. I am using Json.Net and XNA. I have an entity class, that has a virtual update method. I also have a class named Monster, which inherits the ...