19
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 ...
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 ...
10
votes
Accepted
MonoGame 3.3 Font loading
I found out that the Content.mcgb is actually a little GUI helper and you can generate and easily load a .spritefont file with it.
Steps:
1.Load the GUI app by double clicking the "Content.mcgb" ...
9
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 ...
8
votes
Accepted
How do I measure a string that will be drawn with SpriteBatch?
Given
SpriteFont font;
Do this:
Vector2 size = font.MeasureString("Your String Here");
8
votes
How can I map regions on a world map image?
You could use polygons, or you could do a quick and dirty hack and just get a political map like this one:
(source: freeusandworldmaps.com)
. Then, pick a unique color for each country and flood fill ...
8
votes
Accepted
MonoGame 3.4 Content Pipeline Extension missing reference
The MonoGame.Extended project loads Tiled maps using a custom content importer. I wrote a tutorial about how to create custom content importers on my blog.
Of course, as @Shiro mentioned in the ...
7
votes
Accepted
Change in direction should slow down object and accelerate in new heading (2D grid-based)
I'm not familiar with xna... but I know maths. And implementing physics without understanding the math behind it is like going into politics without knowing how to ...
6
votes
Accepted
How can I handle game-state updates in an MMO while the player is logged out?
Your server would have some kind of background process (could also be implemented as a timer or a thread) which runs at regular intervals and updates all players. The process would run daily, hourly ...
6
votes
What is AABBvsAABB Collision detection?
An AABB is an axis-aligned bounding box. It is a box whose sides are aligned with the axes of the world, and which has extents along each axis.
By "AABBvsAABB" your instructor is trying to tell you ...
6
votes
Accepted
Monogame - Screen transition with fading
The problem with dealing with gamestates in an enum and a big switch statement and dealing with transitions is that you want also keep track of what the previous state was. This becomes more complex ...
6
votes
Accepted
How to change screen resolution in XNA?
The easiest way is to set it through the GraphicsDeviceManager.
...
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, ...
5
votes
Accepted
How to optimize my movement & collision code?
Step 1 - Don't check collisions in each key, test them at the end
In your example, you are checking collisions for each key independantly. This will cause some trouble and code replication. In order ...
5
votes
Accepted
Adding shadow and other effects on a spritefont Monogame
One way to do this, is to draw your text 2 times in a different color at specific offsets.
For example:
...
5
votes
Advice on how to store level design info?
I'd like it to be at least vaguely human-editable
I would take this to be your first requirement. Storing it in the colour data of a bitmap is probably not going to help here so I'd go with something ...
5
votes
Accepted
Applying texture to a 3D object
1. Creating textured model in Blender
First, add a new texture by going to texture panel on the right. Select type "Image or Movie", click "Open" and locate your texture file.
Then, move your mouse ...
5
votes
Will unlocking the framerate in XNA/MonoGame tell me how efficient my code is?
I don't see why you couldn't use it! Keep in mind that you may have to code differently to account for the differences between fixed/variable timestep, so if you're planning on making it fixed when ...
5
votes
Accepted
Can I make this physics simulation any faster?
So the first thing I noticed was that when you do
previousTouch = currentTouch;
currentTouch.Clear();
this should also clear previous touch since List is a ...
5
votes
Accepted
2D Platformer AABB collision issues
The first problem where the collisions were handled wrong, were solved with this solution posted by David. Instead of solving the two axis at the same time, the solution solves each axis individually. ...
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-...
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 ...
4
votes
How can I create a resizeable 2D camera with parallax scrolling?
The X position of the background have to be calculated with the X position of the player and a speed factor.
...
4
votes
How to have an event occur after x seconds?
There's no magic way to do this in MonoGame that I know of. The basic idea is fairly simple though; create a variable to keep track of the delay and when it gets to zero fire your method.
The ...
4
votes
Accepted
In Monogame, why is multiple tile drawing slow when rendering in "windowed fullscreen"?
I suspect your issue lies in the way a sprite batch works in MonoGame. The performance cost is coming from using different textures for each tile.
Let's take a peek into the MonoGame source code and ...
4
votes
How do I letterbox a C#/Monogame viewport within a resizeable window?
I've recently been implemented something like this in the MonoGame.Extended library. Creating a letterbox / pillarbox viewport in MonoGame is actually kinda tricky. I'll do my best to provide a good ...
4
votes
Accepted
SetRenderTarget(null) clearing previous draw calls
Having the exactly same issue here - the following code snipped works perfectly fine:
...
4
votes
Accepted
How do I get the mouse coordinates relative to my whole scene with Monogame?
I don't have a specific example for an Isometric camera, but it sounds like you are asking about the basic camera system in general.
The camera I use in my games is somewhat simple and is illustrated ...
4
votes
Accepted
Monogame [Linux] cannot resize screen
It seems that my bug report on Github has been responded to. If this is being read before the next official version is released, this fix will most likely contained in the development branch of the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
monogame × 774c# × 392
xna × 392
xna-4.0 × 51
hlsl × 45
shaders × 42
collision-detection × 38
2d × 37
windows-phone-8 × 35
3d × 24
textures × 24
camera × 21
sprites × 21
android × 20
xna-content-pipeline × 18
windows × 16
monogame-extended × 16
visual-studio × 15
directx × 14
graphics × 12
collision-resolution × 12
sharpdx × 12
unity × 11
opengl × 11
rendering × 11