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.
2
votes
2answers
1k views
Alpha in model XNA
OK been googling nonstop for ages...
My problem is, i need transparent models in my game. After a lot of annoying fiddling around with my code, i changed the blendstate to alphablend. This allowed ...
6
votes
2answers
2k views
Learning XNA 3.1 Vs XNA 4.0
I am starting out learning XNA and its going smoothly. However I wonder if I am shooting myself in the foot by learning 3.1 not 4.0?
I am also aware Microsoft obviously has a conflict on interest in ...
10
votes
1answer
5k views
Ultimate beginner's tutorial to 3d game dev using XNA Framework?
I'm looking for a tutorial that starts at square 1 for game development and moves up through intermediate/expert levels of 3D game development. I really want to get into 3D game dev and I've been ...
7
votes
4answers
3k views
Should I use Events in a XNA Game?
I created a button class which draw a button on the screen. When I click on it, I want to see something happening. In WinForm, I would simply use the event OnClick of the button. What about XNA?
...
1
vote
2answers
2k views
Rotate the camera around the model in XNA?
How can I rotate my view around a model? My model has a rotation. If this rotation changed, my view should also change.
The camera should be behind the model everytime.
Thank you very much!
2
votes
1answer
1k views
Reusing a render target to create multiple Texture2D's (XNA)
i want to be able to loop through a hole bunch of textures, and render them on an object. I then want the rendered image to be placed onto a texture2D.
The point? well hopefully i will end up with an ...
5
votes
3answers
2k views
A cool way of doing Z-index for XNA components?
I am trying to render some elements in my game. First, I render the textures (the textures of the textboxes themselves etc). Then I render the primitives (borders around controls etc). Then I render ...
2
votes
1answer
293 views
XNA Framework and looking around relative to the world instead of camera?
So I've been toying around with creating a game in the XNA framework. A great place to start is simply being able to move and walk around.
I kinda have looking around...
I start off with the camera ...
3
votes
1answer
240 views
Write to one channel of R16G16 texture on Xbox
I was going to draw my shadow map into one channel of a 16 bit texture and then draw a different shadow map into another channel of the same texture.
I realized that this might not be possible to do ...
2
votes
1answer
233 views
JiglibX addition to existing project questions
Got a very simple existing project, that basically contains a lot of cubes. Now I am wanting to add a physics system to it and JiglibX seemed like the simplest one with some tutorials out there.
My ...
4
votes
2answers
693 views
Execute code at specific intervals, only once?
I am having an issue with XNA, where I want to execute some code in my Update method, but only at a given interval, and only once. I would like to avoid booleans to check if I've already called it ...
1
vote
2answers
1k views
How to make animated 2D texture on 3D cube with XNA 4
I'm looking for how to make 3D gauge on Windows Phone 7, that's mean a 3D object (a watch for example) with a basic 2D texture (= Numbers of my watch) and a rotating 2D texture (=neddle of my watch). ...
3
votes
2answers
370 views
Render only some of graphics?
In XNA I am building my own textbox, and listbox.
For the textbox, I want it to render all text it can, and then cut off at the end of the textbox. But I don't want it to cut whole letters. I want it ...
2
votes
2answers
858 views
Fastest way to get all adjacent tiles?
What is the fastest way to get all adjacent tiles in a two-dimensional array of tiles, converted into a single-dimensional array?
If you don't know the answer, then the fastest way to do it in a ...
2
votes
2answers
977 views
When applying Bloom postprocess, error: “XNA…requires TextureFilter to be Point when using texture format Single.”
I have an almost unmodified copy of the bloom sample in my project. I pass it a texture to apply the bloom post process on.
The only modification is that, instead of calling BeginDraw() (to set a ...
3
votes
1answer
322 views
Skin Editing/Overlaying bullet holes
You see, especially in FPS games, when a bullet hits a wall or a character, etc. You end up with the bullet hole.
Is this usually done with the actual skin temporarily changing, or just an overlay of ...
8
votes
4answers
719 views
Which is better, one big level model or multiple smaller level models?
I am writing a game in XNA 4 and I want to have something like a corridor. Do you think that is better to use one big and solid model, or to use multiple small parts (window, stairs, door...)?
4
votes
1answer
585 views
Drawing a texture of arbitrary size in XNA
I wish to know if there is a way to load a texture which is not in powers of 2, for example 100 X 56 in dimension, in XNA 4.0 and draw it using VertexPositionColorTexture.
3
votes
1answer
709 views
Configuration management in XNA
I come from a .net web background so I am accustomed to using xml .config files. What is the XNA equivalent? It seems to me that using the same practice of a xml config leaves your game open to easy ...
2
votes
1answer
455 views
Model in Blender GLSL to XNA HLSL
Is it possible to make model in Blender, with enabled GLSL, add multiple textures, etc, and then just load it in XNA, where's own HLSL? Will it work?
4
votes
3answers
1k views
XNA VertexBuffer.SetData performance suggestions
I have a 3d world in a grid layout where each grid cell contains its separate vertex and index buffer for the mesh/terrain of that cell.
When the player moves outside the boundaries of his cell, i ...
3
votes
1answer
673 views
XNA Video Playback on XBOX “Invalid operation exception”
I am able to play a video in windows in my project, but the same code fails on the XBOX at the _player.Play(_logo) line. The error message is:
"An unhandled exception of type ...
5
votes
2answers
549 views
XNA Sprite mouse selection with layered/overlapping sprites
If I use mouse coordinates to select a sprite does XNA provide a built in way to return the top-most sprite on the screen at a coordinate?
I am trying to highlight the selected sprite, but when ...
5
votes
2answers
498 views
Efficiency of the SpriteBatch
Does SpriteBatch in XNA draw to the screen only when a sprite would appear on the screen?
Say I have 5 identical sprites placed exactly on top of each other, is SpriteBatch able to determine that ...
3
votes
4answers
822 views
using odd number of sprites in multi-row spriteSheet?
Using XNA it's pretty easier to loop through a sprite sheet, I tell it how many rows and how many columns it has and I have a method that loops through the whole set.
I usually use this method in my ...
2
votes
1answer
2k views
Custom effects on Model in XNA
If I have a Model that is drawn with a different effect occasionally, what is the typical approach to this?
Models have effects stored in each of their meshes, and you seem to be forced to use those.
...
3
votes
2answers
2k views
XNA - Am I screwing up the LoadContent for Texture2D?
I've read forum threads and questions and I done just about everything. I need to know what am I screwing up here.
Here's the code in the constructor.
Content.RootDirectory = "GameStateContent";
...
2
votes
1answer
1k views
Create shadow for SkinnedEffect model
I've followed a tutorial that uses the XNA 4 SkinnedEffect for my animation on that model . How can i also make a shadow for my SkinnedEffect model ?
Thanks !
3
votes
1answer
3k views
Including Microsoft.XNA.Framework.Input.Touch in a project?
So after running through tutorials by both Microsoft and www.xnadevelopment.com I feel very confident in my ability to get to work on my first game using the XNA Framework. I've manipulated sprites, ...
3
votes
2answers
1k views
How do I import my first sprites?
Continuing from this question (new question - now unrelated)
So I have a thorough background in programming already (algorithms, math, logic, graphing problems, etc.) however I've never attempted to ...
5
votes
3answers
3k views
When should a bullet texture be loaded in XNA?
I'm making a SpaceWar!-esque game using XNA. I want to limit my ships to 5 active bullets at any time. I have a Bullet DrawableGameComponent and a Ship DrawableGameComponent. My Ship has an array of 5 ...
40
votes
3answers
7k views
Optimizing an XNA 2D game
Does it make sense to implement the logic to skip rendering objects outside the viewport or should I not care about it and let the Framework do it?
7
votes
3answers
752 views
Inverted textures
I'm trying to draw textures aligned with this physics body whose coordinate system's origin is at the center of the screen. (XNA)Spritebatch has its default origin set to top-left corner.
I got the ...
12
votes
2answers
2k views
Playing a Song causing WP7 to crash on phone, but not on emulator
I am trying to implement a song into a game that begins playing and continually loops on Windows Phone 7 via XNA 4.0. On the emulator, this works fine, however when deployed to a phone, it simply ...
2
votes
2answers
354 views
Why doesn't this ContentLoader project (VS2010 e) recognize Microsoft.Build.dll?
I am working with an XNA content loader sample. In the references for the project (VS 2010 Express) there are:
Microsoft.Build
Microsoft.Build.Framework
//as well as the standard XNA framework and ...
13
votes
2answers
3k views
Creating an electricity/lighting/tesla coil effect in a 2D XNA game?
I'd like to create beams of electricity between two points very similar to this video: http://www.youtube.com/watch?v=eMJ8-56L3Lc. The effect is so dynamic, with varying lengths and pseudo-random ...
14
votes
4answers
3k views
What are the differences between XNA 3.1 and 4.0?
I have been away from XNA for a couple months and want to get back into it. I had a game I was currently working on, but it was done in XNA 3.1. What are the differences between the two, and is it ...
3
votes
2answers
660 views
Spritesheets From Individual Images in Content Pipeline?
My main goal is avoid using an external program like SpriteSheetPacker.
I would like to just use sequenced PNGs and have the sprite sheets be made, updated, and saved automatically when I build my ...
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. ...
7
votes
1answer
3k views
Resolution Independent 2D Rendering in XNA
I am trying to figure out the best way to render a 2d game at any resolution.
I am currently rendering the game at 1920x1200. I am trying scale the game to any user selected resolution without ...
4
votes
2answers
1k views
C# XNA - Sky Sphere Question
I have been banging my head against the wall trying to get a sky sphere to work appropriately in XNA 4.0. I have the sphere loading correctly, and even textured, but i would like something a little ...
7
votes
2answers
4k views
How do I disable texture filtering for sprite scaling in XNA 4.0?
I have a sprite that I'm trying to scale up in XNA, but XNA is applying some sort of texture filtering that smooths it and makes it look ugly. I'd like it to just do pixel doubling instead of ...
2
votes
1answer
321 views
Why are my polygons not opaque?
A newbie to XNA here. This is a followup to my previous question that showed me part of what I was doing wrong but I'm still not getting what I want. I'm setting up a BasicEffect thus:
Effect = new ...
1
vote
2answers
630 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 ...
3
votes
2answers
324 views
Handling sound effects for Multiple Collisions
How can I generate somewhat realistic sound effects for collisions in a physics engine that simulates lots of objects?
E.g. take >10 marbles that are bouncing off walls and off each other.
If I ...
4
votes
1answer
2k views
How do I get an XNA 4.0 game to run on other machines?
Whenever I try and run a game made in XNA 4.0 on a machine other than one used for development, it just won't run. I've followed the instructions here to ensure that all the dependencies are present.
...
1
vote
1answer
449 views
Porting an HLSL 3.0 shader to 2.0?
I have a couple of .fx files from a Shader-Based 2D Shadows example. I want to utilize the same kind of technique with XNA 4.0's Reach profile, which if I understand correctly needs to have HLSL 2.0 ...
10
votes
2answers
1k views
In-Game Level Design with XNA?
I am wondering about in-game level design. My current situation revolves around Tiled - I have many different layers with different types of objects in them (for anyone who isn't familiar with Tiled, ...
12
votes
1answer
2k views
Disposing only certain resources in XNA?
The ContentManager in XNA 4.0 only has one Unload() method that Unloads all Assets.
I want to have some "global" Assets that are always loaded, but then I want per-Level Assets which should be ...
6
votes
1answer
1k views
XNA 4.0 Post-Processing Libraries?
Are there any free XNA 4.0 post-processing libraries that are easy to hook into projects? I am looking specifically for a glow effect (although anything is great), and I should also mention that I'm ...