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

-4
votes
2answers
91 views

Is it possible to render controls inside controls in XNA?

I want to know if there is an easy way to render sprites in XNA inside other sprites or something similar (I don't know if sprite is the best or unique way to draw in XNA). For example, I want to draw ...
0
votes
0answers
98 views

Body is pushed back from the wall sometimes

I have a strange issue with the collision between the wall and my player. If I press W and D or W and A to move up and right respectively up and left, the player sometimes gets pushed back from the ...
0
votes
1answer
127 views

Implementing a 2d Selection Box

I'm in the process of implementing a selection box for my simulation and am having difficulty with something which appears simple. At the moment, I can draw the selection box and accurately select the ...
1
vote
1answer
201 views

XNA soundEffectInstance set to loop, does not loop

Using the code below I can play background music, this works. Eventhough I've set 'IsLooped' to 'true', the sound won't loop. What Am I doing wrong? protected override void LoadContent() { ...
2
votes
1answer
200 views

Resize texture in code

I need to change texture size from for example 800x600 to 80x60. I have two ideas of how to do that, but i have problems with both approaches. 1) changre render target then draw and save resized. the ...
2
votes
1answer
145 views

xna model scaling - model is bigger than world

I'm having trouble scaling my model in XNA with C#. The model is bigger than the world itself and I can't seem to scale it down. Below is the code I'm using and an attached screenshot. How can I scale ...
2
votes
3answers
131 views

XNA: Auto-populate content within the content project based on current folder/file structure and content management for large games

1) Is it possible to implement a system where I can simply drop a new image into my content project's folder and VS will automatically see that and bring it into the project for compiling? 2) ...
7
votes
3answers
486 views

Reusable top-down collision class

I've recently picked up monogame and am working on a simple top down game to get me started and learn the basics. I've got the movement and the rotation to follow the mouse sorted out but I'm stuck ...
0
votes
1answer
130 views

Xna menu navigation with controller

I have a menu that you can navigate with the keyboard, but I also want it so you can navigate it with the controller thumb sticks. But my problem is that if you push down or up on the thumb sticks it ...
0
votes
1answer
174 views

render sprites with a transparent background (XNA)

For my game I want to make a map of the world. Per country I made a file with the border of the country and the rest of background is transparent. This way all my files have the same width and height. ...
2
votes
1answer
102 views

How to open prerequisite retrieval application

I have an application that cannot use OneClick publishing. I still want to access those nice prerequisite (applications?) that install .NET and XNA for you when you create a OneClick publisher. I ...
0
votes
1answer
83 views

Rectangle collision doesn't work on WP 8

Collision detection is not working correctly when my 64x64 pixel block touches a bigger block. The big(rect2big) block measures 128x128 pixel. The falling block should change it's color to black when ...
0
votes
1answer
66 views

Items failing to cast as Image Items in GLEED2D

When I try to cast an Item as an ImageItem in fails to convert and returns null, hence skipping the code I want to use to extract the texture data. I have already down cast my Item to an ImageItem, ...
-3
votes
1answer
146 views

How to shoot lasers from Ship(XNA)?

I want a code which allows me to shoot multiple lasers from my Ship. Its a 2D game and the laser TEXTURE2D moves in a straight line. My Solution: I use List<> class of my Laser Class. ...
1
vote
1answer
55 views

Shared Texture2D in XNA

I am trying to define texture2d objects as shared. The reason of why I am trying to do is, I made an xna user control and my project loads unlimited (as much as the user wants) my XNA User Control. ...
0
votes
1answer
140 views

How can I make a clickable menu in WP 7/8?

I'm trying to make a clickable menu for my XNA Windows Phone game. If the player makes a tap gesture on a button(rectangle), something will happen. For example, the game will start if you touch the ...
2
votes
2answers
146 views

XNA hlsl tex2D() only reads 3 channels from normal maps and specular maps

Our engine uses deferred rendering and at the main draw phase gathers plenty of data from the objects it draws. In order to save on tex2D calls, we packed our objects' specular maps with all sorts of ...
0
votes
1answer
142 views

XNA ModelMesh.Draw vs GraphicsDevice.DrawIndexedPrimitives

I am using XNA 4.0 and I wonder if drawing models with multiple meshes is better by filling the vertex and index buffers first and calling GraphicsDevice.DrawIndexedPrimitives() or by simply using ...
1
vote
2answers
354 views

Vertical Scrolling In Tile Based XNA Platformer

I'm making a 2D platformer in XNA 4.0. I have created a working tile engine, which works well for my purposes, and Horizontal Scrolling works flawlessly, however I am having great trouble with ...
1
vote
1answer
103 views

XNA Strange Lighting, Shader

Hey guys, i have strange lighting problem. I've written my own "deferred lighting" shader and this happend: Pic: Normal-Map Pic: Light-Map As long as i only use one big mesh everything seems ...
0
votes
1answer
188 views

Collision Issues

When I run the collision code, there are no errors, but when I shoot the enemy nothing happens..... Any problems that are blindingly obvious? Class Level Variables public Model model { get; ...
-1
votes
1answer
551 views

Xna tile map collision

I finally found a tutorial on tile maps and loading them in from a file that I understand (http://circlessuck.blogspot.co.uk/2012/09/xna-tutorial-basic-tile-engine-part-2.html), however the tutorial ...
0
votes
1answer
122 views

Orbiting a camera around the Y axis whilst remaining up

I've been having difficulty with a problem which I thought was going to be a simple solution. I have a camera facing downwards on a character. The can camera be lowered and when it's lowered it ...
1
vote
2answers
204 views

How to tile multiple procedurally generated textures?

I'm trying to develop a procedural tile generator for a game, mostly for the ground tiles, instead of using "hand-drawn" tiles. To achieve this I'm using Perlin noise and a sine wave with multiple ...
1
vote
1answer
100 views

Should I be using Reach or HiDef profile if I have large spritesheets?

I'm working on a platformer in monogame, that I want to use a large number of sprites for making up items and objects in the background. The main spritesheet I've created is 4095x3734, when I tried ...
0
votes
1answer
185 views

.dat files in 2D Games: Spritesheets vs Individual Images

I've been doing some research and I found that the game RollerCoaster Tycoon uses .dat files to store all the animations/images for each ride. Basically we're talking hundreds of images (per ride ...
1
vote
2answers
293 views

Rotate around the centre of the screen

I want my camera to rotate around the centre of screen and I'm not sure how to achieve that. I have a rotation in the camera but I'm not sure what its rotating around. (I think it might be rotating ...
0
votes
1answer
197 views

XNA & HLSL - rendering a model with its original materials (colors)

I am currently trying to code my own HLSL effect file, in order to render an FBX model I made with Autodesk maya, and to which I have applied some materials (colors). before trying to write an effect ...
1
vote
2answers
136 views

Rotating sprite 180 deg

I should say first, that I have the rotation down. Its just that I want my square to rotate exactly 180 degrees. Currently, it will rotate but it will rotate but by less each jump. So after several ...
2
votes
1answer
69 views

Write colors with alphablending but don't write into the alpha channel

I am using XNA 4.0, hence DX9 and HLSL. I have a RenderTarget2D "MAIN" that I want to add semi-transparent objects "TRANS" to. I want them to blend with MAIN using the TRANS's alpha and inverseAlpha ...
1
vote
1answer
160 views

HLSL Textured Light: outputs only a specific part of the texture (new problem)

Problem 1 I am trying to create a spotlight that instead of giving the circle within the spotlight a simple color, applies a texture to it. However, where the texture is supposed to be is only a ...
0
votes
1answer
761 views

HLSL Gaussian blur pixelshader: blur is not occurring

I am trying to use postprocessing to create a gaussian blur, however, no blur is to be seen, what am I doing wrong? I have included the full code at the bottom of this post in a google docs link, but ...
-1
votes
1answer
109 views

XNA changing color alpha

I know I can take a color and multiply it by a float to reduce its alpha like that: Color color = Color.Green * 0.15f; But how do I return the color's alpha to it's original value? I tried doing ...
-1
votes
1answer
193 views

3d Wall sliding collision

I'm working on collision for walls in my game and the way I currently have it I get stuck walking into a wall. I'm trying to make my character slide on the walls but still collide. My character moves ...
0
votes
4answers
214 views

How can I render a model on top of another model regardless of their relative Z positions?

I was wondering if there's any way to render models over other 3D models regardless of their relative positions? Kind of like how it works in 2D graphics, you set a render order and it renders them ...
2
votes
1answer
102 views

Minimal Projection Matrix

i hope you can help me. I'm currently stuck at the creation process for projection matrices used by shadow maps. The problem is the following: I got the spot/directional light ...
0
votes
1answer
74 views

Creating your own vertex element in XNA

I needed to create my own VertexElement with the follow - Position, Color & Normal. I found a tutorial explaining how to do this here ...
2
votes
2answers
272 views

How do I rotate a single object in HLSL?

I have a World with a 3D model of a head in it and that World rotates, like such: protected override void Update(GameTime gameTime) { //other stuff angle += 0.00005f; //more other stuff ...
0
votes
2answers
250 views

Pause and Re-Enter Game Component Update (XNA)

I'm currently working on a (trading) card game in XNA and I'm having some trouble with returning results from a popup and immediately using them. I'm able to make a popup screen (see this tutorial) ...
0
votes
3answers
313 views

Why is my client laggy despite 60 update packets a second? [closed]

I am developing a small multiplayer game with XNA. It's a usual client-server architecture -- I have a server and many clients communicating with it through UDP (via .NET's Socket class). These ...
1
vote
0answers
265 views

Windows 8 C# Compile spritefonts for MonoGame without XNA

Hello Stack Exchange community. Recently, I've been attempting to in some way generate sprite-fonts into XNB files for use with MonoGame. The issue is however, as you may be aware, XNA is very ...
0
votes
1answer
51 views

In XNA, what symbols are available for conditionally-compiling platform-specific code?

In XNA, what defines are set to allow me to determine if my code is running on a PC with Windows, Xbox, or Windows Phone? Right now I am assuming it is these three: WINDOWS_PHONE WINDOWS XBOX360 ...
-1
votes
1answer
159 views

Difficulties with zoom point

I want to zoom about an arbitrary zoom point. For example, if the player tabs on a place on his windows phone display, this place(position) should get the new center of his viewport. In addition, the ...
2
votes
1answer
74 views

What is the best way to follow this book using XNA 4.0 instead of XNA 2.0

I found a reference to this book on the Microsofot Indie games forums: http://www.amazon.com/dp/1430209798/ref=pe_385040_30332200_pe_309540_26725410_item I'm really interested in it, because the ...
8
votes
4answers
704 views

Detecting “Any Button Press”

I'm trying to allow the player to press any button to continue from the main page. I was able to do this by making a List of Buttons and looping through these and checking for one of them being down; ...
0
votes
0answers
56 views

XNA HLSL no model textures

I am using XNA and HLSL to render all the models in my game, so far there is only one, a flashlight. My flashlight model is a .fbx file type, and it loads the model in the game perfectly fine. ...
3
votes
1answer
175 views

Outlining external edges on a complex shape made of cubes?

A gallery of my problem can be found here. I had to do it this way as it won't let me post more than 2 links due to my reputation. I'm trying to use 3D cubes to generate an isometric cube world. I ...
0
votes
2answers
225 views

XNA Multiple Key Input

I'm using the KeyboardState state way (if there are any others) of handling key presses for a PC game. It has been working fine for single key presses but now I am trying to handle multiple key ...
0
votes
2answers
349 views

Algorithm to find all tiles within a given radius on staggered isometric map

Given staggered isometric map and a start tile what would be the best way to get all surrounding tiles within given radius(middle to middle)? I can get all neighbours of a given tile and distance ...
5
votes
2answers
1k views

How to draw texture to screen in Unity?

I'm looking for a way to draw textures to screen in Unity in a similar fashion to XNA's SpriteBatch.Draw method. Ideally, I'd like to write a few helper methods to make all my XNA code work in Unity. ...