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
1answer
35 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
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 ...
1
vote
1answer
28 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 ...
0
votes
0answers
17 views

OcclusionQuery for certain part of screen

As you see on the Image above, I want to know how can I calculate the number of pixels of players inside the elephant ? because OcclusionQuery is used for count number of pixel for whole screen but ...
-1
votes
0answers
20 views

2D Sprite movement XNA [on hold]

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 [on hold]

this is my code for creating Texture2D from depthFrame of Kinect : private short[] depthData; private Texture2D depthTexture; Color[] depthTextureData; if (null == this.depthData || ...
2
votes
1answer
56 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 ...
3
votes
2answers
2k views

2D Collision masks for handling slopes

I've been looking at the example at: http://create.msdn.com/en-US/education/catalog/tutorial/collision_2d_perpixel and am trying to figure out how to adjust the sprite once a collision has been ...
0
votes
1answer
92 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 ...
0
votes
1answer
62 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
1answer
89 views

Monogame Windows Phone 8

I want to port a WP7 XNA game to WP8 using MonoGame. The thing is that I have Windows 7. So here's the questions (if some sound dumb, please bare with me). Do I need to have Windows 8? Do I need to ...
0
votes
1answer
287 views

How can I disable mipmapping on textures loaded from .X files?

I'm trying to render a plane mesh textured with a simple grid pattern. The problem is that XNA keeps mip-mapping the texture in horrible, horrible ways. What I'm trying to achieve is to get this ...
3
votes
1answer
419 views

Controlled rotation on 3D object with mouse movement

I've a scene with a cube that I can rotate around yaw, pitch and roll. I do this by click the circles and drag the mouse on x/y-axis. I want similar functionality as the Unity rotation tool in editor ...
0
votes
2answers
55 views

XNA - Card Game - 3D vs 2D vs Primitives [on hold]

I'm starting a new project in XNA which will be a card game. What is the best way to implement my cards? Since I want to rotate these, they'd have to be somehow displayed 3D. The game itself will be ...
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 ...
1
vote
1answer
261 views

How can I prevent text rendering from looking ugly when in motion?

I'm drawing a name above the player's head in a 2D top-down view game. The code to draw the string looks like this: Vector2 textPos = new Vector2( (positionX * 2 * world.Map.TileWidth + (16 ...
0
votes
1answer
82 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
24 views

raise an event when an object appears using HLSL and XNA

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
108 views

XNA C# 3D game Wall collision response glitch

I have been working on a reliable physics system in my code and so far it's ALMOST working. :D I am aiming for wall "sliding" style of collision response, like you'd expect it to work in commercial ...
0
votes
1answer
17 views

XNA custom effect importer

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 ...
1
vote
2answers
422 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
1answer
289 views

Disappearring instances of VertexPositionColor using MonoGame

I am a complete beginner in graphics developing with XNA/Monogame. Started my own project using Monogame 3.0 for WinRT. I have this unexplainable issue that some of the vertices disappear while doing ...
2
votes
1answer
289 views

How do I create a player movement system in Farseer?

My group of students is helping produce a a 2D platformer. We tried making a pixel-based collision system which fell through. Now I am trying this physics engine on for size and see new ways to create ...
0
votes
0answers
53 views

Efficient way of drawing 80 000 models in XNA (have tried hardware instancing and octrees still get 5 fps) [closed]

So I'm currently working on a 3D game in xna 4.0 and am in the city development phase (it's being done procedurally). The issue is is that once I get to 22 000 buildings (80 000-100 000 models ...
3
votes
1answer
424 views

Spritebatch Vertex shader world matrix change after each draw

I have a spritebatch where I draw some textures transformed in 3d space. The easy way was just Begin with the transformation matrix, draw, and end it right after. But that is silly, so I'm trying ...
0
votes
1answer
82 views

Emit light from items

In order to create a day/night cycle in my game, I decreased the r,g and b values of the Color variable after a certain amount of time has passed. This worked as expected. I am wondering in order to ...
0
votes
1answer
20 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. ...
5
votes
2answers
551 views

XNA 3.1 to 4.0 Vertex Shader Not Drawing [closed]

I have recently been converting our XNA 3.1 game to XNA 4.0 and am stuck on the shaders. I have the game running, but nothing is drawing to the screen, except things not using a shader. This is only ...
0
votes
1answer
71 views

Creating refraction map problem [closed]

I'm reading riemers tutorial on how to make a water effect and trying to translate it from xna 3 to xna 4. So far I figured out I have to create a shader in order to clip the planes for my refraction ...
1
vote
1answer
733 views

3DS Max MassFX — Animation to XNA without bones/skins?

I made a model in which a number of cobble stones fall into a hole using the rigid bodies in 3DS Max 2012 MassFX. They are just editable polys, no skin, no bone. I want this to play (Take 001, 0-100 ...
0
votes
1answer
87 views

Remove item after crafting

I'm having one last problem with my crafting system. Say an item takes 2 rocks, 1 twig, and 1 vine. When I craft the item, only 1 of each item is removed instead of the correct amount of items related ...
1
vote
1answer
94 views

How to gradually decrease opacity of model?

I have been searching for this matter for a long time and slowly I begin to think that this option is not available in XNA for Windows Phone. I am trying to get a 3D-Model to be drawn at 50% ...
0
votes
1answer
63 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
99 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
2answers
79 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
40 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 ...
0
votes
1answer
43 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
90 views

Incomplete mesh using DrawIndexedPrimitives after rotating mesh

Through help on this site I was able to draw the triangles of an unrotated, nonscaled nontransformed mesh created in Blender and exported to OBJ, accurately imported through Assimp and rendered in XNA ...
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 ...
0
votes
0answers
47 views

Basic .FBX Animation for the Complete Novice [on hold]

okay, so in terms of 3D in XNA, I am pretty much a total beginner. I know all my matrices, basic lighting, transforms etc, but I'm finding 3D animation very confusing. I have been looking a bit at the ...
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
64 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
70 views

How to deform 2D tileable texture in XNA/MonoGame

I'm looking for a way to deform tillable texture in a 2D game I'm building using MonoGame but I'm not sure how this effect is called and searching the internet for "deforming textures" gives me mostly ...
0
votes
1answer
61 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 ...
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
25 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
0answers
80 views

C# Monogame & Farseer Physics: Collisions [closed]

I am a begginer. I am using Monogame and Farseer Physics Library in C#. (latest versions) In my game, whenever my ball (circle) hits the corner of a rectangle, (or even another circle), it is ...
3
votes
1answer
244 views

XNA windows phone release black textures [on hold]

i just made a 3d game in XNA for windows phone 7. I build it in release mode on visual studio 2010 and suddenly when I run game there is no textures on models - 2 models are black and one is ...