The 2024 Developer Survey results are live! See the results

# Tag Info

Accepted

### Why is sin = Y and cosine = X?

I will try to answer briefly. Why is the circle represented as 1,1 and -1,1? This thing is usually called Unit Circle, because its radius equals to 1. How it is relative to trigonometry you're ...
• 411
Accepted

### How to create shockwave of objects in other shapes than circle?

To maintain the shape while spreading, each bullet needs to have a different speed. Suppose you are going to create a "wave" of bullets originating from a centerpoint, what you need to do is to ...
• 4,067

### Why is sin = Y and cosine = X?

When you ask Why is sin = Y and cosine = X? I read your question as Why is the function that gives me the Y axis called "sin" and why is the function that gives me the X axis called "cosine"?, so I'll ...
• 27.3k
Accepted

### How to change screen resolution in XNA?

The easiest way is to set it through the GraphicsDeviceManager. ...
• 1,637
Accepted

### How to convert png images to True Type Font?

Truetype fonts are vector based. So you would have to trace the glyphs with a vector editor and then use a program like FontForge (which also is a vector editor) to build a font from that. That said, ...
• 2,248

### How to correctly enable anti aliasing in XNA?

If anyone here is using MonoGame instead of XNA, the process is ever so slightly different. Notice that we change the graphics profile to HiDef. This allows more ...
• 131
Accepted

### Position vs Destination Rectangle

The simple answer is: the Vector2 positions the sprite at the X,Y coordinates, while Destination rectangle fills the sprite to fit that rectangle. More advanced answer: Sprites are in reality quads ...
• 4,067
Accepted

### Efficiently updating building effect radius coverage

Caching building coverage The idea of caching the information which buildings are in range of an effector-building (which you can cache either from the effector or in the affected) is definitely a ...
• 121k

### 3D objects with animated bones Monogame in the year 2017, is it possible?

Finally I've found the solution to my problem. First I've created a new content pipeline by following this blog: http://community.monogame.net/t/tutorial-how-to-get-xnas-skinnedsample-working-with-...
• 105
Accepted

### Is there an advantage to creating a tileset instead of multiple content items?

Nowadays the most important reason to use a tilemap instead of separate pngs is just for organisation. Do you want a stage to have a different theme? Then you simply create a new tilemap, that follows ...
• 4,785
Accepted

### How does ECS handle systems which need to know more about the environment of the entities it processes?

My solution to this would be to create a component AITarget which marks an entity as something zombies are supposed to attack (like a player or a civilian). Now ...
• 121k
Accepted

### Is it possible to have a diagonal movement animation in monogame/xna?

Instead of directly modifying the position of the player you could add another Vector2 variable named, for example, Direction. When a player pressed W you set direction to (0,1) and if it was up & ...
• 444
Accepted

### HLSL texture sampler always returns white

The problem is this: the compiler optimizes the effect file. So in your code only ONE sampler is created. However in reality you are using TWO textures. The first one, being the Texture provided as ...
• 4,067

### Drawing huge amount of tiles in Monogame (XNA) efficiently

Graphics cards are optimised to draw a few things lots of times rather than the other way around. In your case, you have a lot of things (different textures) that you want to draw a lot of times (...
• 605
Accepted

### Why is the mana regenerating too fast?

You forgot to reset your currentTime variable. Do it like this instead: ...
• 3,126

### Monogame - Sprite sheet animation

Store your animations in an animation dictionary. You can use a Dictionary<string,Rectangle[]> or create a more elaborate construction that holds more frame ...
• 4,067
Accepted

### Get the difference between 2 matrices

Your problem is that you're trying to compare floating-point numbers for equality. The matrix inversion and multiplication, however, will inevitable introduce slight rounding errors that will make ...
• 8,347

### MonoGame SetRenderTarget is wiping the backbuffer

I'm going to post this answer as an adaptation from @James Carlyle-Clarke's comment. Because the code formatting in an answer makes it easier to understand. It has also been modified to make it ...
• 133
Accepted

### Publishing an XNA project on Windows Store

XNA games aren't directly support in the Windows Store. The "appx" file types are generated when building a Windows Store app (it's one of the project options when you are creating a new project). As "...

### Getting Sprites from a SpriteSheet with Rows and Columns

Your y-coordinate is always 0, so only the first row is used. You need to change this line: ...
• 1,325
Accepted

### Very weird C#/XNA bug, not drawing a magenta dot

What you're experiencing is the color key part from the XNA content processor. You can find the setting in the properties windows. What you want to do is disable color key entirely.
• 2,724

### 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 ...
Accepted

### How to draw Tiled map with MonoGame.Extended v0.6.266 beta?

I'm the creator of MonoGame.Extended ;) Quite a lot has changed since the 0.5 release. We've been working heavily on the Tiled renderer to solve some memory and performance issues and make it ...
• 2,418
Accepted

### How to calculate verticle normals of triangular mesh

It looks like some normals are pointing the wrong way. This means that those triangles aren't wound correctly. As a quick fix you can do: ...
• 7,461
Accepted

### Sprites With Vastly Disparate Scales

Don't represent the carrier with a single sprite. Represent it with a tilemap. So instead of having one 14000px wide sprite for the carrier flight deck, have a 32x32px sprite for runway without ...
• 121k
Accepted

### Drawing huge amount of tiles in Monogame (XNA) efficiently

I found out that SpriteBatch is not suitable for drawing tiles. One reason is that sprites are meant for dynamic objects and are used for multiple purposes. Another reason is that it's incredibly CPU-...
• 121