Tagged Questions

Implementation of Microsoft's XNA 4 APIS for Android, iOS, MacOS and Linux.

learn more… | top users | synonyms

0
votes
0answers
20 views

How set window position?

How set window position? Monogame version: https://www.nuget.org/packages/MonoGame.Binaries/3.2.2-alpha This dont work because OpenTKGameWindow is internal: ...
0
votes
1answer
45 views

Loading Song in MonoGame Windows

I cannot load the song into my game. I got error in both templates WindowsDX and WindowsGL. Monogame Develop Build 1252 Both files .wma and .xnb are exist in Content folder and Build Actions are sets ...
0
votes
0answers
14 views

Monogame. Xml files not included on deployment

We are making a XNA game and porting it with MonoGame. The game works fine on deployment, it finds without a hitch the xml files we need for the content. On publishing however, the files are never ...
1
vote
1answer
35 views

TypeLoadException when running a Monogame Windows Phone 8 game

Using Monogame, I'm trying to port a game to Windows Phone 8, but I'm having issues getting a basic example to run. When I create a basic Mono project and run it on my phone (to check everything's ...
1
vote
1answer
59 views

Monogame Windows Phone 8

I want to port a WP7 XNA game to WP8 using MonoGame. The thing is that I have Windows 7. So here's the questions (if some sound dumb, please bare with me). Do I need to have Windows 8? Do I need to ...
0
votes
1answer
120 views

How do I get the mouse coordinates relative to my whole scene with Monogame? [duplicate]

I am making a topdown isometric real time game using Monogame. I know how to get the mouse position for my camera view. How do I get the mouse coordinates relative to the entire scene? My game's ...
0
votes
1answer
52 views

Varying spritefont quality depending on string

I'm using Kleymissky font size 26 made via Nuclex font renderer (Hinting Method: AutoHinter) - download Why the thickness of the font drawn on screen depends on the string itself? What can I do to ...
2
votes
1answer
49 views

How can I tint a Texture2D with a gradient?

I am working on a lighting system for my game. Instead of lighting each tile completely with only one color, I want to create a gradient on that tile so to make the lighting look more dynamic and ...
1
vote
1answer
38 views

XNA Texture.GetData “Size of the data passed in is too large or too small for this resource.”

I am attempting to retrieve the color data for a given sprite located on a texture atlas by creating a new color and passing a source rectangle width and height for the given sprite. I am then passing ...
1
vote
1answer
47 views

How to handle input in Monogame

I've just switched over to MonoGame from XNA. Since MonoGame is supposed to have the same API (implying that any copied code should work as usual), I've run into a strange issue- input doesn't seem to ...
1
vote
1answer
49 views

Use of SpriteFonts without installing on host machine

I am working on a Windows game for my university project. In this project I am using a custom TrueType font which is not installed on any university computers. For submission my game is required to ...
1
vote
1answer
83 views

How to draw a diagonal fade-in and fade-out?

How to draw a diagonal fade-in/fade-out in 2D using MonoGame draw API? For a simple (non-directional) fade-in/out drawing the background with alpha variation do the tricks, but what is the standard ...
1
vote
1answer
54 views

RenderTarget2D moves with scene

I encountered a strange RenderTarget issue, in XNA/Monogame. I am currently updating my render target at every frame, just to test to see what is happening. When I move the camera around, the ...
0
votes
0answers
30 views

HLSL Shader Relative Positioning

I've got a shader that does the texturing, lighting, etc. for my game engine (written on top of MonoGame, in case that's relevant) for my block-terrain-based game (everything is rendered as triangles ...
1
vote
1answer
48 views

How to deform 2D tileable texture in XNA/MonoGame

I'm looking for a way to deform tillable texture in a 2D game I'm building using MonoGame but I'm not sure how this effect is called and searching the internet for "deforming textures" gives me mostly ...
3
votes
1answer
77 views

How do I edit a Texture2D at run-time to visually indicate connected tiles?

I'm making a 2D sandbox game in C# and MonoGame, and I have a couple of tile sprites. These tile are loaded in-game as Texture2Ds. I want to have blocks visually connect to adjacent blocks. An ...
2
votes
1answer
120 views

XNA/MonoGame/SharpDX: Pixel shader with sprite sheet

I've searched around for two days now on the internet but cannot find a solution. I've also read up on Pixel Shaders on MSDN with no luck. I'm trying to apply a simple pixel shader to a sprite batch ...
1
vote
0answers
55 views

Deploying MonoGame on Android

I've developed a game using MonoGame for Android (with Xamarin). When deploying to my Android device (via the Xamarin Studio IDE) it installs 3 apps - Monogame-Android-8-support, ...
0
votes
0answers
50 views

SetRenderTarget(null) clearing previous draw calls

I'm not sure if everything's working as it should be or whether I'm just not doing something properly, but I couldn't find anything that discussed this so I thought I'd ask here. I'm using Monogame ...
2
votes
2answers
226 views

Processing periodical operations on the database [duplicate]

I program MMO strategy game (C# monogame) like Goodgame Empire or Travian for Windows Phone. The server part of the game will run on Windows Server and MS SQL database. I'm trying to figure out a ...
1
vote
1answer
46 views

Trying to implement bounding box collision

I've been trying to do collision detection using the Intersects() function with two rectangles. I've got a player and multiple enemy's. When the player intersects with an enemy a bool var is set to ...
2
votes
1answer
278 views

Handling game-state updates in an MMO while the player is logged out

I have a plan to build MMO strategy game like Goodgame Empire or Travian for windows phone. I want program it in C# Monogame (because I have some good experiance with it). But I still can't figure ...
1
vote
1answer
92 views

MonoGame SharpDX Error 'The Parameter is Incorrect' when using graphics.DrawUserPrimitives [closed]

Below is a small section of code that is meant to draw a multicolored triangle to the middle of the screen in a MonoGame game. This uses the basic function DrawUserPrimitives to draw the triangle. ...
0
votes
2answers
72 views

HLSL Shadow Mapping occurs only around player

I've recently begun playing around with Monogame (OpenSource "remake" of XNA). My current task is to write a simple shadow mapping shader. After following Riemer's XNA Tutorial I got the shadows to ...
2
votes
2answers
91 views

Multi-colored text and kerning

Drawing multi-colored text or highlighted text in XNA/MonoGame is pretty annoying, and the standard way I've seen to do it is to just to make multiple SpriteBatch.DrawString calls, and place them ...
0
votes
2answers
92 views

Depth of overlap between circle and rectangle

I have a circle and a rectangle one of the two objects is moving the other is static. How can I prevent them from overlapping each other? For now there is only one thing that I don't know how to ...
1
vote
1answer
77 views

Inventory management syncronized network

I'm implementing an inventory system with items in 1x1 slots in a open-world multiplayer game. But I can't decide how I want to synchronize the item management with the server. I see two options here. ...
4
votes
1answer
118 views

How do I letterbox a C#/Monogame viewport within a resizeable window?

I am making a 2d game with xna/monogame. I want the main view area to always show 15x15 tiles, or 480x480px. I've got something that sort of works, following this guide. It expands the view range ...
2
votes
2answers
97 views

MonoGame - Get the 2D area of a 3D object

I'm writing a 2d game, but decided to make some 3d objects that my 2d character can pick up. I've got them displaying on the screen - but can't work out how to get the 2d area that the 3d object is ...
0
votes
1answer
133 views

Multiple tile drawing in monogame is slow

So I have this drawing function (which is by the way recomended as an solution here). It draws tiles on the whole window with no problem but my game slows down to ~30fps after maximizing it to ...
0
votes
1answer
97 views

How do you create a .XNB Font file for use with CocosSharp?

I know the .XNB file format is an XNA thing and that CocosSharp inherits this from its MonoGame roots. However there doesn't seem to be any information on how to create your own .XNB fonts to use with ...
0
votes
0answers
79 views

graphics.IsFullScreen resetting to false after game constructor and graphics.ApplyChanges()

This is a MonoGame 3.2 Windows (DirectX) Project. I've tried setting graphics.IsFullScreen to true in the game's constructor and in the game's initialize function, both times running ...
0
votes
1answer
179 views

How to have an event occur after x seconds?

I want a method to run after every 10 or 15 seconds. My timer is set to: timer = (double) gameTime.ElapsedGameTime.TotalSeconds; What would be the logic to check for every 10 or 15 seconds?
1
vote
1answer
53 views

How do I measure a string that will be drawn with SpriteBatch?

Is there a way to measure width and height of an ever-changing string (a player's score, specifically)?
0
votes
1answer
87 views

Find world matrix

I'm making my first 3D-game with XNA (MonoGame) and have come to a point where I wish to add a crosshair for the player. To do this I need the on-screen coordinates of the location where my fighter ...
0
votes
1answer
134 views

Save Texture2D to file in Monogame

I'm working on a tilesheet builder tool for my game to speed up tile creation, and I need to save a generated texture2D as a png. I've tried using the .SaveAsPng function but it isn't implemented in ...
-1
votes
1answer
48 views

Can a sprite(batch) have multiple “costumes” monogame [closed]

I am relatively new to game development and would like to know if a sprite can have multiple "costumes" similar to that of MIT's scratch or do I need a different sprite for each costume
0
votes
1answer
96 views

Optimizing Draw calls in MonoGame Android platformer

I am working on a 2D platformer that is in the final stages of optimization. I have a few different devices for testing, and I am trying to get the best possible framerate on the weaker ones. On a ...
4
votes
2answers
298 views

Conditional Defines and HLSL

Is it possible to use project level conditional defines in hlsl code? I'm trying to conditionaly compile a shader using MonoGame Content Procesor. Depending on project type (ie. Windows, Windows8...) ...
1
vote
0answers
53 views

How do I setup scoring system for my game? [closed]

I've created a simple endless game. And I want the scoring system to be something like the one in flappy bird. My aim is to publish my game to app stores in the end. How do I save/keep a high score? ...
1
vote
1answer
130 views

MonoGame hosted in a control/form

I would very much like to host my monogame window inside a Form so that I can take advantage of the nice gui elements in the C# framework when creating a simple level editor. I have looked online, but ...
0
votes
1answer
118 views

2D terrain with midpoint displacement and collision

I followed this theory Here to implement a simple scrolling 2D terrain for my running game. I am used to dealing with collision via a tile system but am looking for a good theory on how to perform ...
0
votes
1answer
167 views

Issues compiling .fx shader to MGFX

I've been trying to port Catalinzima's 2D lighting example over to MonoGame to try and get some basic understanding around it and adapt it for use in my engine. I've been trying to convert the two .fx ...
0
votes
1answer
44 views

Is there a build-in function to count the amount of sprites drawn by SpriteBatch per frame?

I'm hoping to find out how many sprites are on the screen at any given time. In other words, is it possible to find out how many times spriteBatch.Draw(); is called between spriteBatch.Begin(); and ...
1
vote
1answer
132 views

Resolution independent game world in 3D

I'm developing a game similar to Don't Starve - 2D billboards in a 3D world. Now I have encountered a problem with resolutions. I want the player to be able to change resolution, but I don't want to ...
0
votes
0answers
89 views

MonoGame - Fuzzy Pixels When Drawing (2D)

I apologize if this has been answered somewhere; I spent quite awhile searching but couldn't find an answer. I have any issue with my 2D sprites being drawn to the screen - either the non-moving or ...
1
vote
0answers
32 views

Monogame render between constraints

I have, in MonoGame, a project for which I require the game to not use the full screen depending on the resolution. The game elements etc all behave as they should (So they bounce off for example ...
3
votes
2answers
206 views

Tons of stuttering in XNA?

As stated in the title, my program stutters like crazy, even though my program for the most part runs for 60 fps. During the moments it stutters, FPS momentarily drops down to 59(stats from FRAPS). ...
0
votes
0answers
127 views

MonoGame: Can't compile effect

I'm having trouble compiling a very simple pixel shader using the content pipeline in MonoGame 3.2. Whenever I compile the shader using "ps_3_0" it works but when I try to load it using the ...
0
votes
1answer
82 views

XNA 3D cube rotation problem

I am new to game programming and still trying to clear up my basics. I am stuck with a problem and unable to resolve on my own knowledge. I am trying to rotate a 3d cube in MonoGame (Similar to XNA) ...