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
4
votes
1 answer

Monogame - Change the size of a sprite

I have created a background image for a game that is 300x135 pixels. When loaded into my game, I need it to start at point (0,0), which it does: position = new Vector2(0, 0); However I want to enlarge this image so it spreads to 1200x540 pixels,…
toadflax
  • 375
  • 4
  • 17
4
votes
1 answer

MonoGame 3.5 Templates won't install with Visual Studio

When installing the MonoGame Framework for Windows you may encounter an error where in the MonoGame installer all the boxes for the templates for each Visual Studio version are grayed out. To fix this you need to make this…
Zintom
  • 184
  • 2
  • 12
4
votes
1 answer

How does the playback duration of sound files change when changing pitch in XNA/Monogame?

Using the SoundEffects class in XNA (or alternative implementations of XNA like MonoGame or FNA), a sound effect has a certain playback duration equal to the length of the sound file which is stored in: SoundEffect.Duration However, when the pitch…
ares_games
  • 1,019
  • 2
  • 15
  • 32
4
votes
1 answer

Seeing "Wrap" texture when using "Clamp" mode in MonoGame (Pictures incl)

I am rendering a tile map in my MonoGame project using a sprite batch. Here is the rendering code: protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); …
Goose
  • 1,307
  • 2
  • 14
  • 28
4
votes
2 answers

MonoGame porting to linux

I have developed a game on Windows 7 (64bit) in Visual Studio 2015 with the language C# and the MonoGame framework. The game works fine on Windows, but I also wanted to make the game to be playable on Linux. Therefore I installed VirtualBox with…
Momatime
  • 41
  • 3
4
votes
2 answers

Using Monogame without Xamarin

I want to develop mobile game using monogame. Is it necessary to use xamarin? Can I create game without xamarin, like in unity3d? Thanks for answers.
Anewil
  • 119
  • 1
  • 14
4
votes
1 answer

MonoGame / XNA Draw Polygon in Spritebatch

i am currently writing a game with MonoGame and I need to draw textured shapes. I want to draw polygons with 4 corners. All my renderstuff is done with the spritebatch. I tried to use TriangleStripes, but it does not work very well for me, because I…
mick
  • 127
  • 2
  • 11
4
votes
1 answer

OpenTK.Graphics.GraphicsContextException after a few seconds of running

The error I get is "An unhandled exception of type 'OpenTK.Graphics.GraphicsContextException' occurred in OpenTK.dll Additional information: Failed to make context 131072 current. Error: 0" I've searched around and I can't find what's causing it and…
Liru
  • 43
  • 7
4
votes
1 answer

The type 'FileMode' exists in both MonoGame.Framework and 'mscorlib'

I'm working on moving my XNA game to MonoGame. I have finally reached an issue with System.IO.FileMode and System.IO.FileAccess. Both of these are in both mscorlib and monogame.framework. I have tried the following and none of them work. I'm using…
jefpadfi
  • 183
  • 1
  • 17
4
votes
2 answers

Monogame rotating a sprite

I am trying to rotate a sprite in Monogame, but for some reason I can't get it right! I would be really grateful if someone explains the mystery of rotation! This is the line of code that I am using to draw and rotate my sprite, just a note the…
Darkbound
  • 3,026
  • 7
  • 34
  • 72
4
votes
2 answers

Monogame XNA transform matrix for a single object?

I have read a few tutorials explaining transform matrices for XNA/Monogame. The problem is that these matrices are applied to SpriteBatch.Begin(...matrix); This means that all Draw code will be transformed. How do I apply a transformation matrix…
Kokodoko
  • 26,167
  • 33
  • 120
  • 197
4
votes
1 answer

Function of base.Update and base.Draw in Monogame?

I am following the basic Monogame tutorial from this website. What I can't figure out is why Game1.cs includes calls to base.Update and base.Draw? If I remove these function calls, it does not seem to affect my game in any way... Code Game1.cs …
Kokodoko
  • 26,167
  • 33
  • 120
  • 197
4
votes
1 answer

Convert XNA + VB.Net game into MonoGame

I'm writing a strategy game in XNA and VB.NET. This technology combination looked like quite a good choice, right until I decided I would like to switch to MonoGame (but keep my game logic in VB.Net intact). The problem is that MonoGame currently…
Arides
  • 111
  • 7
4
votes
2 answers

Can’t play SoundEffects with Monogame 3.2 for Windows 7 Desktop (DirectX)

For some reason I cannot get Monogame to play any sounds through SoundEffect or SoundEffectInstance. With a workaround I can get Songs to play, but still not SoundEffects or SoundEffectInstances. If I run my example below through “native XNA”…
Pantzar
  • 41
  • 6
4
votes
2 answers

MonoGame application says SDL.dll is missing, even though it's there. Why?

I have a MonoGame application built using the Linux Game template in Visual Studio. It runs on Windows using either .NET or Mono, but it fails on Linux. The error is a DllNotFoundException concerning SDL.dll but the SDL.dll is always in the binary's…
Theodoros Chatzigiannakis
  • 28,773
  • 8
  • 68
  • 104