Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Open-source implementation of Microsoft's XNA 4, for Windows, Mac, Linux, Android, and iOS, among others.

0
votes
0answers
15 views

Need help on monogame screen resolution and intersection

Currently in my game i want trying to move my object towards both x axis and y axis.As I also wanted to put it into center ,I have put a camera.Here is my Camera code- ...
0
votes
0answers
37 views

2D Lighting Shader Multiple Lights

For a 2D platformer, I have a 2D lighting shader with two passes, the first one draws a shadow from the closest light to the sprite and the rest of the lights will reduce the visibility of the shadow ...
0
votes
0answers
18 views

Double buffer in Monogame

Does MonoGame has feature of creating 2 BackBuffers that can be swapped, emulating double-buffering? My suggestion was to do some tricks with RenderTargets, but looks like that targets live till ...
0
votes
1answer
46 views

Monogame Networking [on hold]

I played around with XNA in high school, and Monogame in college. I was able to make pong, first level of mario, and 1942 from the GameMaker tutorial series - all in monogame. My question is what ...
0
votes
0answers
20 views

Add tiles to both sides of TileMap List in MonoGame

This is what my tile map looks like (red highlighting added for clarity): My code: ...
1
vote
2answers
64 views

How should I be loading a player's content and its bullets content later in the game

I'm trying out Monogame because my course has a simple game programming class in it which is just going over basics. The final project will be using Monogame so I've been getting ahead and making my ...
0
votes
1answer
25 views

Using multiple textures in Monogame HLSL Effect shader?

My Monogame HLSL shaders only successfully sample one texture (besides the screen). Any additional textures I try to sample end up with the same texture data as the screen. I've found people with ...
0
votes
0answers
10 views

XNA Controls Rotation in Addition to Camera/Model

I'm relatively new to 3D programming and I'm trying to make a game where the player can control a character around a maze. My current problem isn't really getting the mouse to be centre and reading ...
1
vote
1answer
81 views

MonoGame tick cannot go lower than 16ms

I'm trying to build play with MonoGame and I'm trying basing this regarding the GameTime steps. In my main Game class that is being run in the main entrypoint of my project, I'm doing something like ...
0
votes
0answers
24 views

Monogame Screen Tearing Between Tiles

I've noticed some 'tearing' or gaps appearing between tiles when the camera moves over a tile map, and I have no idea why. I should mention, the game is being drawn to a render target (320x192), then ...
0
votes
3answers
111 views

Figuring out if two objects overlap on screen

I want to figure out if 2 3D models overlap on screen. My general idea is: Compute the bounding box of each model Transform the bounding box to the View Volume using the ViewProjection matrix Check ...
0
votes
1answer
62 views

How to raycast in MonoGame 2D?

Currently I am using a Ray class that I built myself. The following is for brevity. ...
1
vote
1answer
41 views

MonoGame / XNA Texture2D.SetData results in black texture

I use the following method to draw a box onto the screen: ...
1
vote
2answers
120 views

How can I store in-game money so that nobody can manipulate the amount?

People get coins for completed tasks(for example completing a level) in my game. In addition, they can purchase coins(they need to pay for that with real money) in the app store. With these coins, ...
1
vote
2answers
65 views

Performance in pathfinding/road calculation

I have a question about the most effective way to detect road connection in a tile based world. Some time ago I already asked for "How to improve performance for expensive functions in 2d city builder"...
0
votes
0answers
37 views

MonoGame Extended - Tiled - Spritebatch Layering Depth vs TiledMap Layer Renderer Depth

I'm drawing each of my Tiled Map Layers separately so as to create the illusion of depth. I'd like my character sprite to be between the background tiles but in front of the building tiles. I'm using "...
0
votes
0answers
22 views

Monogame - Get model triangles

I need accurate tri-tri collision detection for simulation software I'm writing, I have the physics simulated (modified verlet integration), the tri-tri intersection code (moeller), BUT am struggling ...
0
votes
0answers
11 views

Monogame 3d Camera objects in front same size than in background [duplicate]

i started to make my first 3d game but i have a problem with the camera and the projection Matrix, id like to have a view like the right image but i only got the left. How exactly look a projection ...
2
votes
0answers
50 views

Camera that follows a target with sub-pixel movement

As the title says, I have a character that moves at sub pixel movement (no, I can't change this, because this sub pixel movement happens when I normalize the vector during diagonal movements, ...
0
votes
0answers
14 views

Issue with Monogame Skybox [duplicate]

I'm new to 3D graphics and I was following one of the RBWhitaker's tutorials on setting up a skybox for a 3D XNA game. I think it was slightly outdated. The original code was something like: ...
0
votes
0answers
29 views

Monogame Skybox Advice

so I'm pretty new to 3D graphics and I was following one of the RBWhitaker's tutorials on setting up a skybox for a 3D XNA game. I think it was slightly outdated. In my .fx file for the skybox I did ...
1
vote
0answers
29 views

How to use Monogame (nez) pipeline extensions / importers on linux

I use Monogame together with the NEZ framework. NEZ proviedes some custom Content Processors. However I do not manage to get them working on Linux (works perfectly on Windows) as it seems like the ...
1
vote
0answers
28 views

Monogame Per Pixel Collision scale texture

I have a problem: I am learning the Per Pixel Collision, because I am very new to Monogame. Everything works thine, but my texture (image) is too big, so I scaled it down to 0.5f. Now it doesn't work ...
0
votes
0answers
40 views

Why do I have to set the rendertarget to null explicitly in MonoGame?

I'm using shaders in MonoGame. I have the following code, which works fine. It fills a scene with ambient light, and applies a 2-pass gaussian smoothing to the lightmask. I have one thing that bothers ...
1
vote
1answer
80 views

MonoGame Save Game Location Example

I am building a game using Monogame 3.6 and Visual Studio Community 2017. Up until this point I have been serializing the data using BinarySerialization and created a custom ...
0
votes
0answers
32 views

Camera zoom to point in Monogame

I'm currently working on a 2d isometric tile-based game with a camera and the functionality to zoom in and out. So far I'll take the center of the screen as "zoom point" using the following lines of ...
0
votes
1answer
41 views

2D Per Pixel Collision Detection using Animated Sprite

I am using MonoGame 3.6 and Visual Studio 2017. I have been trying to find a solution online to do per pixel collision detection using an animated sprite that I am drawing from a sprite sheet. Using ...
1
vote
0answers
18 views

Built in windows font wont load correctly in MonoGame

I am currently attempting to load this font in the MonoGame pipeline: I set the .spriteFont file to this: <?xml version="1.0" encoding="utf-8"?> ...
0
votes
2answers
51 views

How can I take ingame images and videos?

I’m using MonoGame and Visual Studio Community on my Mac to develop a game for iOS. I want to take ingame images and videos of the gameplay while the game is running on an iPhone/iPad. Afterwards, I ...
0
votes
2answers
96 views

C# Fastest way to iterate over certain tiles overlapping multiple chunks?

What's the fastest way of iterating over certain tiles overlapping multiple chunks in C#. Ideally without having to iterate over everything, just a specific set of coordinates? (green cubes example ...
1
vote
0answers
19 views

Effective way of transferring data to HLSL shader in MonoGame and storing it

I'm toying around with HLSL shaders in monogame. Lets say I want to use a structure in my shader which is like this: ...
0
votes
0answers
34 views

Monogame - change splash screen on IOS project

I know this seems like an obvious question, but I didn't manage to find any adequate answers for it in the net. My problem: When the game is run on my iPhone 7, there are black borders around the ...
2
votes
0answers
43 views

Viewport not matching Window size when fullscreen

I am using: GraphicsDevice.Viewport.Bounds to determine the size of the canvas / stage for my window. This works well if I am in Windowed mode, but if I launched ...
0
votes
2answers
59 views

TouchPanel.GetState() Returns wrong touch locations XNA

I am trying to make my Desktop game playable on IOS. I have a Button.cs class, which has this code in it: ...
0
votes
2answers
73 views

How to incorporate delta time into movement?

I want to use delta time in my movement code for my player, and I'm not sure how to do it. At the moment, I have this: ...
1
vote
1answer
116 views

Issue importing TileMaps/TileSets in Monogame.Extended 1.0

I've just started coding my first ever videogame using Monogame/Xna. I've reached a point where I would like to start editing maps and importing them into my game using the program Tiled. After ...
0
votes
0answers
18 views

Draw order of Texture2D vs UserPrimitive

I'm trying to use Texture2D objects and VertexPositionColor objects with DrawUserPrimitives ...
1
vote
0answers
16 views

MonoGame minimises when I click on second game window

I've problem with my MonoGame project. I have one full-screen game window and one window form with some info (part of the game too). And the problem lies in when I click on the window form, the main ...
0
votes
1answer
40 views

Difficulty with Texture Alphas - HLSL

UPDATE 3: I have fixed the issue by reordering my effects (see my answer for details.) Anyone who wants to post more information based on that answer (either in an answer or in the comments) would be ...
0
votes
1answer
54 views

Monogame - All effects in one file?

I am successfully drawing all of my geometry with an AlphaTestEffect and would like to apply shaders. I've built a shader Effect from a tutorial and can't seem to find anything on the web that answers ...
1
vote
2answers
54 views

Should tiles be referenced statically when making a map or some other way?

I'm trying to think of a way to manage tiles in my game, so far I have a Tile class that has characteristics about the tile in question, a ...
0
votes
0answers
15 views

Merging Textures outside of Draw() [duplicate]

Is there a way to premanipulate multiple textures into one Texture2D to avoid multiple .Draw()s? Like is it possible to create the complete texture inside the corresponding class. CheckBox for example ...
0
votes
0answers
33 views

Collision with a rotated rectangle

I bassically have a sword that is rotating around my white character and an enemy that I have to kill with the sword. However, making a collision with a rotated rectangle is harder than it seems. I ...
0
votes
0answers
36 views

Conversion from lat-long to Cartesian coordinates 's result is different with real location

I'm trying to put building from real lat-long in my Monogame app (4 buildings in my school, please check the image with the blue circles) But after some convert method, it went terribly wrong (please ...
0
votes
1answer
47 views

Circular Particle Effect in Monogame

I'm new to C# and Monogame, and I'm trying to create an effect of a 'psychic' ability, the user will press a key and a circular aura blast will emit from their position. I'm just trying to get the ...
1
vote
1answer
71 views

Destroying a ship removes both the ship and the bullets it has fired

So I'm making a game where you fire bullets at enemy ships which are flying past you. The enemy ships are also firing at a straight line in front of them. The bullets are made into a list of another ...
0
votes
0answers
24 views

Made a quad manually, Polygons have opposite facings?

NOTE: I'm in XNA/Monogame So I have a generalized Quad-Builder for textures that looks like this: ...
0
votes
2answers
81 views

Tile slopes and jittery movement

I'm trying to handle slopes in a tiles based world. I'm using basic linear interpolation to find the Y coordinate of the character based on his X position. But i have a problem, when the character ...
2
votes
1answer
68 views

MonoGame window is huge although it should be small

I'm using Monogame to create a simple game. In my Game1 class initializer I set this: ...
1
vote
1answer
87 views

Monogame - SpriteBatch.DrawString() won't work

Here is my Game1.Draw() method (Constants.HeroLayerDepth is equal to 1): ...