2
votes
1answer
43 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
21 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
44 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
54 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 ...
3
votes
1answer
71 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 ...
1
vote
0answers
39 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, ...
2
votes
2answers
214 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 ...
2
votes
1answer
265 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 ...
0
votes
2answers
71 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
87 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
79 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 ...
0
votes
1answer
101 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
0answers
63 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
128 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
50 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
84 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 ...
1
vote
0answers
47 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
97 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
42 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
0answers
31 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 ...
1
vote
1answer
231 views

Loading a stream/asset on Android MonoGame without ContentManager

In the game I am developing, I have created a serializable class that generates a .map file for saving and loading levels. In XNA, this works great using the following code: FileStream fileStream = ...
0
votes
0answers
145 views

Zelda-style Top-down RPG. Storing data for each tile type

I'm creating a Zelda-style RPG using Tiled, C#, and MonoGame. When my code parses the .tmx file, it will get a number to associate with each tile type based off of their position in the tile sheet. If ...
0
votes
0answers
76 views

How can I port a MonoGame Windows Phone 8 game to iOS?

I downloaded the trial version of Xamarin Studio and installed it on my iMac. In addition, I installed Xcode on my iMac so that I can use the iPhone emulators in Xamarin Studio. But I don't know how ...
2
votes
1answer
76 views

MonoGame not all letters being drawn with DrawString

I'm currently making a dynamic user interface for my game and are setting up having text on my buttons. I'm having an odd issue where, when i use a specific piece of code to determine the text ...
1
vote
2answers
135 views

How can I use voice commands to control my game?

Is it possible to use simple voice commands like "run right", "run left", "jump", "stop", "attack", "defend", "finish" to control the player in a Windows Phone 8 game? How can I implement voice ...
2
votes
2answers
446 views

Zelda-style top-down RPG. How to store tile and collision data?

I'm looking to build a Zelda: LTTP style top-down RPG. I've read a lot on the subject and am currently going back and forth on a few solutions. I'm using C#, MonoGame, and Tiled. For my tile maps, ...
1
vote
1answer
97 views

How can I scale Farseer bodies so that they work on different screen resolutions?

I created a little Windows Phone 8 game that supports multiple resolutions. If the resolution of the device is less than 720p, then the sprites and their corresponding Farseer bodies need to be scaled ...
2
votes
1answer
136 views

Does every Windows Phone 8 device have one of a fixed set of resolutions?

Does every Windows Phone have one of the following 4 resolutions? 800x480, 1280x768, 1280x720, 1920x1080 pixels Or is it possible that some devices only have a resolution of 1280x719 or 1279x720 ...
1
vote
0answers
90 views

How can I detect the screen resolution of a Windows Phone device?

I want to detect if a device uses WVGA, WXGA, 720p or 1080p resolution. In addition, I want to store the resolution of the device in a variable. For example, if the resolution is 800x480 pixel, then ...
3
votes
1answer
108 views

Obfuscating Monogame assets

I'm obfuscating spritesheets. I've already encrypted the .txt file dictionaries. Now I'd like to perform binary serialization on the image files. Texture2D does not allow for this though, probably ...
1
vote
1answer
327 views

How can I create a resizeable 2D camera with parallax scrolling?

I want to create a Windows Phone jump-and-run game with parallax scrolling. The character should always be in centered in the viewport. I use the following camera so that the viewport looks on every ...
3
votes
1answer
135 views

How should I draw the GUI if I use a 2D camera?

I have a camera in my 2D side scrolling game and I want to implement the GUI. How can I do that? For the moment, I draw everything like this: spriteBatch.Begin(SpriteSortMode.Deferred, ...
2
votes
0answers
374 views

Controlled rotation on 3D object with mouse movement

I've a scene with a cube that I can rotate around yaw, pitch and roll. I do this by click the circles and drag the mouse on x/y-axis. I want similar functionality as the Unity rotation tool in editor ...
1
vote
1answer
130 views

MonoGame ArgumentNullException in Spritebatch.End()

I switched my Project from XNA 4 to MonoGame 2.5.1. The port went somewhat unproblematic but I am stumpled across a problem i can't resolve. For your interest, the code worked on XNA: When I am ...
3
votes
1answer
74 views

Why is my cursor not working if I add a scaling matrix?

After moving the camera to any direction, my cursor isn't getting drawn on the correct position. For example: I move my camera to the right, after that I click on the screen, but the cursor isn't ...
2
votes
1answer
135 views

2D physics rotation w/ XNA

I'm creating a simple game with space ships made of blocks that are all the same size. After having looked at this: Calculating the rotational force of a 2D sprite I have created the following code ...
1
vote
1answer
134 views

How can I use a camera matrix with different resolutions?

I created a little jump'n'run game. The character(Mario) is always the center of the viewport. The game is running correctly if I use the resolution 800x480 pixel. But when I use another ...
1
vote
0answers
288 views

How can I use custom shaders in Monogame?

I wrote a shader in XNA and I want to use it in a Monogame Windows Phone 8 project. I converted my Effect1.fx file to Effect1.mgfxo. But the program doesn't work correctly. The screen of my emulator ...
1
vote
0answers
167 views

Could not load sound (MonoGame) [closed]

I am using the Window Project (in MonoGame 3.2) which is uisng DirectX instead OpenGL. If I run a game, so its show me: "Could not load wind asset as a non-content file" I think, that is no ...
0
votes
0answers
69 views

Matrix Translate Camera has some sort of spiky movement

public class Camera2D { private Vector2 _position; protected float _viewportHeight; protected float _viewportWidth; public Vector2 ScreenCenter; protected Being _unit; // the sprite camera is ...
1
vote
2answers
121 views

MonoGame - 2x2 texture scaling issue

I've just recently switched from XNA to MonoGame and now I've run into something that has never happened to me in XNA before. I've created a 2x2 texture and filled it with a color by doing this: ...
0
votes
1answer
142 views

How can I scroll my tile maps?

I've been trying to understand how I can use matrix to implement a smooth tile scrolling system but I fail miserably. So I have a pretty big world stored in a multi-dimensional array which is ...
1
vote
2answers
429 views

Adding 'xna content project' reference to monogame project(visual studio 2013 pro)?

I want to add reference to an xna content project. Which should be like the content project reference we have in an xna windows game. I am on visual studio 2013. I got the xna extensions to work by ...
2
votes
2answers
147 views

XNA: Non-overlapping shadows

I want to create an effect similar to the following in XNA / MonoGame: There's a background and a semi-transparent shadow consisting of several objects (two circles in this example). However, the ...
1
vote
1answer
116 views

Scale adaption based on distance to object

I have situation illustrated on image above, name displayed over the player. Text is rendered as 3d rectangle and rotated to face camera as billboard. (I am using this article ...
0
votes
1answer
302 views

Monogame: Why is my sprite looking the same on every resolution?

I want that my sprite(Mario) don't look the same on every Windows Phone resolution. If I use this code, the sprite is on every resolution on the right position but it also has the same size on every ...
-1
votes
1answer
135 views

Why are the coordinates interchanged in Monogame?

If I use XNA Gamestudio, I can draw a sprite on a specific position like this: spriteBatch.Draw(Texture2D, new Vector2(PositionX, PositionY), Color.White); But in Monogame, I must change the ...
0
votes
1answer
245 views

How can I support different resolutions with Monogame? [duplicate]

I want to support the following 4 resolutions in my Windows Phone 8 game: 480 × 800, 768 × 1280, 720 × 1280, 1080 x 1920. How can I do that with Monogame? If I draw a sprite with Monogame, the sprite ...
1
vote
2answers
384 views

2D AABBs and resolving multiple collisions

Okay, so this is a problem I've been trying to figure out for quite some time. Mine is a 2D platformer game with a world made up of (usually) immobile tiles and mobile sprites, both of which use AABBs ...
3
votes
2answers
480 views

Issue with Monogame resizing

I've converted my XNA project into a MonoGame one. Whenever I start the application and resize the game manually (ie - dragging the window)... this.Window.AllowUserResizing = true; ...the game ...