Skip to main content
5 votes

How to force XNA to render model very far away as a light dot?

Problem is two-fold: Determine how many pixels the model will take when rendered Replace model with a dot Suggestions: Pick the cut-off distance by eye. So when the model is this big and this far - ...
Kromster's user avatar
  • 10.7k
3 votes
Accepted

Reading a text file and changing each digit into a value inside an array c#

With int.Parse(SR.ReadLine()) you are trying to convert the whole input line (consisting of 300 digits) into one single int. ...
Olivier Jacot-Descombes's user avatar
3 votes

How Should I Go About Updating My XNA Game?

As David already mentioned, get a website and program an auto-updater for your projects. It works as follows: When your game starts check for the server version located on your website in a file. If ...
Byting Games's user avatar
2 votes

When drawing text, numbers appear as D1 or NumPad1 rather than just numbers

Since the Keys class is an enum, ToString simply converts the names into strings. Enums can't have names, like ...
Bálint's user avatar
  • 14.9k
2 votes
Accepted

Vector for bullet direction XNA C#

You can use trigonometry: x = cos(angle) y = sin(angle) Make sure angle is in radian
Bálint's user avatar
  • 14.9k
2 votes

How do I target a tank turret with an offset barrel?

Here I am over 10 years later providing another answer, hopefully this will help someone. If we look at the tank image below, we know we can calculate the angle A° pretty easily with atan2. Rotating ...
CustomCalc's user avatar
1 vote

When drawing text, numbers appear as D1 or NumPad1 rather than just numbers

I used this code: string key = e.KeyCode.ToString(); if (key.Length > 1) key = key.Replace("NumPad", "").Replace("D", "");
Carlos Ferreira's user avatar
1 vote
Accepted

Handling input from an ECS input system into actions in another system/actions on a entity?

This is just a short answer, since many details of your engine are unknown to me. You need to remember that your InputSystemshould not cause the movement directly, ...
PSquall's user avatar
  • 1,332
1 vote
Accepted

How do you write Texture2DContent and read it as Texture2D in the XNA content pipeline?

Well, the answer was simple and something else entirely. It dawned on me that maybe I was packing too many individual textures into a single texture; it turns out I was. I'm not sure what the texture ...
Scott Lin's user avatar
  • 131
1 vote

XNA: Classes with Texture2D to be treated as one

You can either just extend Texture2D, which would allow you to cast it down to a Texture2D if you want or (in my opinion preferably) extend the spriteBatch with a draw that accepts Animations. To be ...
Bálint's user avatar
  • 14.9k
1 vote

XNA 4.0 How to combine triangles vertices 3D

It's not possible sadly to have multiple textures without also dividing it using vertices. However, improvements can be made. Don't divide the cubes into faces, the overhead of this approach ...
Bálint's user avatar
  • 14.9k
1 vote

What is a Linker Map Address ()

So looking at your other post on the subject, it looks like this is relating to doom. Doom uses maps with the extension .map. However, many programs use the .map extension. What you are seeing is ...
CobaltHex's user avatar
  • 2,248
1 vote

Monogame Effect World Translation Z and alpha in objects not visible behind

Following and advice from @CaitVonSith, I changed the drawn order, first draw the triangle and then the rectangle and it is working like expected Case Rectangle Z = -10 Case Triangle Z = -10 Also ...
Juan Pablo Garcia Coello's user avatar
1 vote
Accepted

Xna Spritefont from installed fonts

When a font is located in the content folder, and you keep the content folder along with your game, then it shouldn't be much of a problem. Spritefonts are treated similair like images, They both ...
Steven's user avatar
  • 885
1 vote
Accepted

How Should I Go About Updating My XNA Game?

If you want a website for free, then you can use Github Pages(*.github.io) to get a free static(you don't handle the server side) website. I once built a launcher that you could download that would ...
UDXS's user avatar
  • 141
1 vote
Accepted

Any good pattern for managing user input in XNA

A common way is to have a controller base class. This can be an AI controller or just an input controller that is looking at gamepad or keyboard input. In general adding an extra layer of abstraction ...
Nils Ole Timm's user avatar
1 vote

How can i show all edges in monogame?

Perhaps you could change the RasterizerState fill mode. ...
Chris Clements's user avatar
1 vote
Accepted

understanding image rotation XNA C#

The WMRotation variable you have here is being used to drive the rotation. The rotation is changing in response to the thumbsticks because you have some logic in your update that is modifying the ...
Bryan Robertson's user avatar
1 vote

TileMap collision detection

Here is some code that I pulled up for you from my XNA coding days. This is how I would handle collisions with XNA. This method works strictly with Rectangle colliders. The first function I will ...
jgallant's user avatar
  • 8,424
1 vote
Accepted

Crouching Up and Down XNA C# Controller

Try implementing a property to keep track of your previous pressed state. So then you can do something like this instead: ...
jgallant's user avatar
  • 8,424
1 vote

Why do I get this error when converting an XNA .fx to a MonoGame .fx?

The type of vertex you're passing in is not consistent with what is expected. The vertex has the types SV_Position0, NORMAL0, TEXCOORD0, whereas the shader expects ...
TreDubZedd's user avatar
1 vote

Using a Windows forms Textbox control in an XNA game

You can't use a Textbox control in XNA, as XNA doesn't support drawing Windows Forms. You will need to write your own Textbox control in XNA, or use one of the freely available XNA control libraries ...
jgallant's user avatar
  • 8,424
1 vote

XNA / MonoGame - render transparent background using stencil buffer problem (3d)

Hey mate the best way to do it is with alpha test, that way no sorting but it still helps to sort and u can do lighting, render with opaque blend state, cull mode to none. I do my grass like that, ...
Justin William Stanley Bryant's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible