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

Method accessing a method confusion

I am using Monogame for C# and I noticed a line of code that is confusing me. if (Keyboard.GetState().IsKeyDown(Keys.W)) { } Ok so from my understanding "Keyboard" is the class and "GetState()" is a method within the "Keyboard"…
2
votes
0 answers

XNA/MonoGame - Shine light through quads

My question: Is there a way in MonoGame to specifiy a light source, and let it shine through a quad/texture, effectively reducing the remaining light, and then let that shine trough the next layer, just like a light behind real paper sheets, laid…
Fasin
  • 21
  • 3
2
votes
1 answer

C# - How can I improve method override performance in a Behaviour Tree?

I’m using a custom-built behaviour tree that utilizes abstract/virtual method overrides to control the AI of a large number (1000+) of in-game creatures. This component is critical to the performance of the game, and I am looking for ways to reduce…
Quasar
  • 172
  • 1
  • 13
2
votes
1 answer

How to use or make "Effects" in monogame?

I've been studing how to use monogame. So far the only thing I can't understand is what are effects. I just can't find any complete tutorials on how to make or use them. I know that they are stored in .fx files and they are writen on some sort of…
Ruslan
  • 53
  • 1
  • 8
2
votes
1 answer

Texture2D Coordinates Not Displaying In Proper Location

I have been rendering some custom "buttons" using SpriteBatch.Draw(). However today I realized that the coordinates at which I was supposedly drawing my buttons at was not consistent with the coordinates that my mouse claims they are being rendered…
SneakyTactician
  • 130
  • 1
  • 14
2
votes
3 answers

How to get the "edges" of a single dimensional array

Explanation I'm generating textures for UI elements that have a single pixel outline on the edge of the texture. The method of setting the color data in the texture is limited to passing a one dimensional array of color values. These textures are…
Spool
  • 77
  • 7
2
votes
1 answer

Return nested class inherited from base class

I am working on a UI system for a MonoGame project. I created one large class called UserInterface. Inside this class, there are nested classes such as Button, Checkbox, Scrollbar, etc. which all inherit from one base class called UIObject. Every…
GHC
  • 339
  • 4
  • 13
2
votes
0 answers

Showing ppt in unity or converting to image

Can anyone explain how I can show ppt presentation in unity application? I did many research on that but found that unity does not support ppt. So think to convert ppt into an image but not get any success so want to know that Is it possible to…
Jaydeepsinh
  • 83
  • 1
  • 8
2
votes
0 answers

When a sprite is rotating to follow an angle, how to prevent it from reversing direction after a point?

Below is a section of my code which handles a player's sprite rotating towards an angle after a user touches the screen: touchState = TouchPanel.GetState(); Vector2 touchPosition; if (touchState.Count > 0) { touchPosition = new…
roguedev
  • 175
  • 1
  • 1
  • 12
2
votes
1 answer

RequestProductPurchaseAsync throws “Cannot change thread mode after it is set”

I'm using monogame as a framework for games and I'm trying to implement a in-app-purchase-functionality in an UWP-App which throws an exception when I'm calling RequestProductPurchaseAsync. It states: Cannot change thread mode after it is set.…
harryh100
  • 37
  • 5
2
votes
2 answers

GameTime is always 0 - MonoGame (XNA) - C#

Currently, my sprites loop at the same speed that MonoGame loops through it's code. I want to slow this process down by creating a delay using GameTime. It never worked, however, so I decided that I would use debug.WriteLine() to check if GameTime…
MyNameIsGuzse
  • 273
  • 1
  • 5
  • 23
2
votes
1 answer

How to set the mouse cursor to hidden in a UWP application?

In a C# UWP application I use Window.Current.CoreWindow.PointerCursor = null to try and set the mouse cursor to stop rendering which used to work a few windows 10 updates ago but recently the cursor no longer disappears. What is the correct method…
Daniel Armstrong
  • 829
  • 9
  • 22
2
votes
1 answer

Getting data out of a textfile and feeding it into a 2d array

I have want to make the levels in my game load from a textfile and load it into a 2d array, this is what the level textfile…
Stan
  • 3,659
  • 14
  • 35
  • 42
2
votes
0 answers

C# - Monogame draws only last letter in array, and doesn't previous ones

I have an array of objects Letter, and if keyboard key A is pressed it adds Letter to an array. static Letter[] letters = new Letter[50]; // all letters to be shown static int letterCounter = 0; // last array element public static Vector2 Cursor…
2
votes
1 answer

What is the correct appxmanifest certificate for a UWP application for Windows 10?

In the package.appxmanifest for a UWP Windows 10 application, under Packaging, a testing certificate must be provided to build packages for store publication. MyApp_TemporaryKey.pfx When associating an application with the store, a second…