Skip to main content
The 2024 Developer Survey results are live! See the results
20 votes
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 ...
Joshua Light's user avatar
11 votes
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 ...
Felsir's user avatar
  • 4,067
11 votes

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 ...
Theraot's user avatar
  • 27.3k
6 votes
Accepted

How to change screen resolution in XNA?

The easiest way is to set it through the GraphicsDeviceManager. ...
Pharap's user avatar
  • 1,637
6 votes
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, ...
CobaltHex's user avatar
  • 2,248
5 votes

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 ...
Pyroglyph's user avatar
  • 131
5 votes
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 ...
Felsir's user avatar
  • 4,067
5 votes
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 ...
Philipp's user avatar
  • 121k
5 votes

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-...
J. Dove's user avatar
  • 105
5 votes
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 ...
Tom Tsagkatos's user avatar
5 votes
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 ...
Philipp's user avatar
  • 121k
4 votes
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 & ...
Mikael's user avatar
  • 444
4 votes
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 ...
Felsir's user avatar
  • 4,067
4 votes

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 (...
loodakrawa's user avatar
4 votes
Accepted

Why is the mana regenerating too fast?

You forgot to reset your currentTime variable. Do it like this instead: ...
John Hamilton's user avatar
3 votes

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 ...
Felsir's user avatar
  • 4,067
3 votes
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 ...
Ilmari Karonen's user avatar
3 votes

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 ...
Dylan's user avatar
  • 133
3 votes
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 "...
SaviorXTanren's user avatar
3 votes

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: ...
SurvivalMachine's user avatar
3 votes
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.
William's user avatar
  • 2,724
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
3 votes
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 ...
craftworkgames's user avatar
3 votes
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: ...
ratchet freak's user avatar
3 votes
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 ...
Philipp's user avatar
  • 121k
3 votes
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-...
Guguhl Pluhs's user avatar
3 votes

Efficiently updating building effect radius coverage

1. Duplicate work. Your affectedBuildings are presumably close to each other, so the different radii will overlap. Flag the buildings that need to be updated, ...
Peter's user avatar
  • 9,955
3 votes

MonoGame "couldn't find a default importer" for .txt file?

You're getting this message because the pipeline doesn't contain a content importer for a .txt file. Plain-text files generally don't require any special processing, and don't need to be converted to ...
Vassalware's user avatar

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