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)

2
votes
2answers
3k views

Texture2D.GetData fails to return pixel colour data

Because I'm using sprite sheets instead of an individual texture per sprite, I need to pass in a Rectangle when calling Texture2D.GetData() in my collision detection for per-pixel tests. ...
1
vote
2answers
1k views

Weird behavior with XNA SpriteBatch.Draw origin

I have a texture with 256x256 pixels. Consider this piece of code: protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); ...
1
vote
2answers
358 views

Protecting XNA Assets

With so many XNA asset viewers out there, how do I distribute my XNA game for PC without having my assets open for persons to steal or manipulate? I know i can create custom asset importer/processor, ...
1
vote
1answer
404 views

Making XNA Play Nice With 3DS Max, Boundiing Spheres

I'm using 3DS Max 2010 with the KW x-porter plugin, which outputs a .X file (just downloaded the very latest version). Been getting some odd results: ...
1
vote
1answer
2k views

XNA 4.0 - Mixing 3D and 2D - SpriteBatch putting weird alpha texture over whole scene

I am working on a game in XNA 4.0 that has been entirely in 3D so far but now I want to incorporate a HUD. I have tried doing a simple test using spriteBatch as such: spriteBatch.Begin(); ...
1
vote
1answer
432 views

XNA objects not occluding properly

I have got simple 1x1x1 cube model. I draw 3 of them. They are located at: 1,0,0 2,0,0 3,0,0 I draw them in the same order every time. When I move the camera and look at them from one end everything ...
1
vote
2answers
689 views

Getting a black scene with XNA, what am I doing wrong?

I'm new to XNA (ver 4) and I'm obviously doing something wrong but I don't know what. So far I have managed to model my scene (quite simple, just a bunch of squares which are calculated--there are no ...
0
votes
1answer
222 views

XNA Arcball and moving model - the model is altered instead of the camera

I'm trying to implement an arcball type camera, I've got all controls working very nicely. I can rotate the X/Y axis with my mouse and zoom in and out with the Z/X keys. The problem is, that the ...
0
votes
1answer
152 views

Binding BoundingSpheres to a world matrix in XNA

I made a program that loads the locations of items on the scene from a file like this: using (StreamReader sr = new StreamReader(OpenFileDialog1.FileName)) { ...
0
votes
2answers
3k views

Basic 3D Collision detection in XNA 4.0

I have a problem with detecting collision between 2 models using BoundingSpheres in XNA 4.0. The code I'm using i very simple: private bool IsCollision(Model model1, Matrix world1, Model model2, ...
0
votes
2answers
267 views

What does tex1D do with a 2d texture?

If I call tex1d from my pixel shader on a texture that has been initialized as a texture2d will it treat the data as a one dimensional array and then just take the element at whichever position you ...