Questions tagged [monogame]

MonoGame is an OpenSource implementation of Microsoft's XNA 4 APIs that allows developers to build games that run on Android, iPhone, iPad, Mac OS, Linux, PlayStation Mobile (2D only), Windows 8 Store, Windows Phone 8, and OUYA, while reusing their existing XNA code that runs on Windows, Xbox 360, or Windows Phone 7. It supports both OpenGL and DirectX rendering.

MonoGame is an OpenSource implementation of Microsoft's XNA 4 APIs that allows developers to build games that run on Android, iPhone, iPad, Mac OS, Linux, PlayStation Mobile (2D only), Windows 8 Store, Windows Phone 8, Windows 10, and OUYA, while reusing their existing XNA code that runs on Windows, Xbox 360, or Windows Phone 7. It supports both OpenGL and DirectX rendering.

Recent versions of MonoGame includes a bundled content pipeline. This eliminates the need to use the XNA 4 Content Pipeline, which is not available for all platforms. The new MonoGame pipeline allows for management of assets completely independent of XNA.

Information:

Code:

Questions or Problems:

1862 questions
2
votes
1 answer

2D Shader-based shadows implementation

So I've got these two images- one of a shadow map of the objects that block light, and another of the light. Shadow Map- Light- This is what I want my final result to be- My question is, what is the best way to achieve this final result? My…
2
votes
2 answers

Monogame C# - How do I draw my sprites between tilemap layer 0 and 1?

I have a tilemap: this.TileMap = Content.Load("Maps/MyTileMap"); _tiledMapRenderer = new TiledMapRenderer(GraphicsDevice, this.TileMap); I would like to render my normal sprites between layer 0 and 1. Kinda like this: DrawLayer(0,…
Spikee
  • 3,967
  • 7
  • 35
  • 68
2
votes
0 answers

Unable to deserialize XML file after changing object class

I'm working on a level editor currently in XNA/Monogame and I'm running into an issue whenever I want to improve my "Level" class. Because my XML file is serialized as an object of my Level class, whenever I make changes to it I can no longer…
Connor
  • 51
  • 5
2
votes
2 answers

Jittering when rotating and then translating a matrix in XNA/Monogame

I'm having a problem in Monogame/XNA where I am storing the position/rotation/scale in a matrix for easier manipulation of these values with parenting. It all seems to be going well, except for when I rotate the matrix, which is when the object…
SeaPeaMe
  • 109
  • 8
2
votes
2 answers

Can I use the same Vector2 struct across multiple librarys that implement their own Vector2 structs?

I'm making a 2D game that will use one library for rendering graphics to the screen, and another for physics. The problem is that both libraries implement their own Vector2 struct. This means I have to convert between the two very often and it can…
C. Lang
  • 463
  • 4
  • 12
2
votes
2 answers

Debug Window Size not changing with preferredbackbuffer constraints

Using Monogame OpenGL with VS 2019, and I've applied the following code as per the usual to set the constraints of the size. graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth =…
2
votes
0 answers

How to create a Texture2D without corrupting video memory?

In Monogame, I'm creating a 2D texture that's a horizontal flip of an existing texture using GetData and SetData like this: private static Texture2D Flip(Texture2D art) { Color[] oldData = new Color[art.Width * art.Height]; …
Petr Hudeček
  • 1,623
  • 19
  • 30
2
votes
1 answer

Two rectangles are not intersecting when I think they should

I have an enemy rectangle public void Update(GameTime gameTime) { enemyRectangle = new Rectangle((int)enemyPosition.X, (int)enemyPosition.Y, enemyTexture.Width, enemyTexture.Height); ... I have a foreach loop, looping through a list of…
sa1addd
  • 57
  • 5
2
votes
2 answers

XNA (Monogame) I need a short way for collisions

I have a code which looks like this: /*Need help here*/ if (car1.hitbox.Intersects(parkingLoot[0].hitbox) || car1.hitbox.Intersects(parkingLoot[1].hitbox)) intersects = true; else intersects = false; where hitboxes are a…
Ufuk Bakan
  • 98
  • 7
2
votes
1 answer

MonoLauncher instance suspended after stopping my Visual Studio Debug

I have been having issues with my Visual Studio 2015 for quite a while now. I am working in C# and MonoGame. For my game I am running 3 separate instances of a MonoGame launcher. However when I stop debugging my game in visual studio it is often the…
Branden
  • 347
  • 1
  • 14
2
votes
1 answer

Loading an MGCB at runtime in MonoGame?

I haven't found a clear-cut answer for if I can do this nor how to go about it. I'd like to allow my game to load additional MGCB into content managers, thus allowing additional content to be made after I release my game. I've seen talk of building…
Cereza
  • 163
  • 7
2
votes
1 answer

Issue with rounding a vector to stay within a circle?

I'm creating a tile-based map from a circle. I'd like to add some features on the edges of the circle, and I'm currently doing this by comparing the length of a vector and checking if it's less than the radius of the circle. There appears however to…
user10278973
2
votes
1 answer

C# - Monogame.Forms: Question about getting mouse coordinates

I'm having a problem getting the correct mouse position on the control when moving the camera around. The controler has 800px width and 600px height. Lets only look at drawing method: In here, the only thing I'm trying to do is to draw a line from…
2
votes
1 answer

Cannot open assembly "path":no such file or directory -- Monogame default game not running?

I've been working in monogame for only a little bit, and I've successfully made the game of fifteen and a few other smaller projects. However, after doing a small routine update to the framework and beginning a new project, the default monogame…
2
votes
1 answer

List seems to still exist after finishing program

I have found a pretty strange thing while coding an Asteroid Destroyer minigame using MonoGame with Visual Studio 2017. In the LoadContent() method I load the textures for my spaceship in a list of Sprites which is created on the spot. Then this…
Nordellak
  • 41
  • 6