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

Questions tagged [monogame]

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

0
votes
0answers
17 views

Use 2 values of a mask

Let's say one has a black/gray/white mask and wants to draw picture A over the white/gray values and picture B over the black/gray values (the blacker the more B picture). The best I come up with ...
0
votes
0answers
23 views

Switch screens with MonoGame.Extended - ScreenGameComponent

I'm trying to piece together a very simple game foundation based on MonoGame.Extended from the documentation and tutorials I can find on the internet. For starters, I wanted to setup the different ...
1
vote
2answers
123 views

How to make a Blend-Effect like yomawari did?

I would like to know, how to make that effect, I have seen in the game named Yomawari. The little girl has a lamp and its cone revals the dark spirits around her. But only if they are in the light. I ...
0
votes
1answer
21 views

HLSL Manual Alpha Blending

I'm trying to do alpha blending manually because I only want to apply alpha blending on certain pixels. Underlying is the texture I'm writing to. This is what I got so far, but it doesn't give the ...
1
vote
1answer
26 views

Creating a letterbox screen for Android devices

I want that the screen looks the same on every Android device without distorting the sprites. One player should not see more of the map than another player just because they have a bigger screen or ...
0
votes
1answer
63 views

Most efficient way to remove a Rectangle ? Monogame/XNA

I have a project in which I'm trying to remove the "collision box" (Rectangle class) of one of my enemy. My game logic basically is: ...
0
votes
1answer
41 views

Element's texture is null - Monogame/XNA, C#

I have a ArgumentNullException everytime I try to call the Draw() method of my Projectile class in the Game1.Draw() method. In Game1.cs Initialize() method: ...
1
vote
2answers
159 views

How to implement ECS architecture in C#?

As C# is a strongly-typed language, I'm having great difficulties associating all my data types together so that I can have a clean, if not performant, game loop. Example #1: Keeping Components ...
0
votes
0answers
23 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
53 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
27 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
30 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
72 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
33 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 ...
1
vote
1answer
97 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
3answers
132 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
119 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
57 views

MonoGame / XNA Texture2D.SetData results in black texture

I use the following method to draw a box onto the screen: ...
1
vote
2answers
126 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
75 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
63 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 "...
2
votes
0answers
51 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, ...
1
vote
0answers
48 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
30 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
47 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
132 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
36 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
52 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
23 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
109 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
22 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
42 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
49 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
87 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
91 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
206 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
21 views

Draw order of Texture2D vs UserPrimitive

I'm trying to use Texture2D objects and VertexPositionColor objects with DrawUserPrimitives ...
1
vote
0answers
18 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
52 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
68 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
39 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
56 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
72 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
82 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
88 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: ...