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
30 views

Object coming from far away effect in 2D

I have a path made using segments of sine wave interpolation put together that is drawn flat on the screen. And I would like to give the path the effect of coming towards the player. I tried to draw ...
0
votes
1answer
22 views

XNA 4.0 How to combine triangles vertices 3D

Preview for the problem: I'm making a similar game to Minecraft (a game that it's world is made by cubes), but the fps of the game is getting low only by rendering a little amount of cubes in the ...
2
votes
0answers
40 views

Trying to get Vertexshader to work Monogame 2D

If I don't use the vertex shader, it gives me white textures which is what the default color is. Once I add the vertex shader, the screen is black. I figure it is something wrong with the Matrices I ...
1
vote
1answer
58 views

What are the semantics of these quaternion functions in XNA/Monogame?

I am having trouble understanding the semantics of some members of the XNA/Monogame Quaternion class. The docs are not helpful, and tutorials trying to explain ...
0
votes
0answers
13 views

Cannot deploy MonoGame project to BlueStack (ADB0000: closed)

I'm using MonoGame 3.6 with Visual Studio 2017 Community and I'm trying to deploy to BlueStack as Android emulator. VS can see Bluestack and permit me to launch deploy but ends with this error: ...
0
votes
0answers
27 views

Smoothing runtime generated shapes edges with Monogame

I'm working on a game with the Monogame engine and I can't find a proper way to generate basic shapes with smooth edges, even after trying to dug all the Internet... Currently, I'm generating all my ...
0
votes
1answer
27 views

Orthographic Viewport whose bounds are equal to screen Window bounds?

Ive been rattling my head trying to figure out how to do this. I am not working on a 3D application so I did not expect to need to understand transforms, projections, or viewports. Essentially what I ...
0
votes
1answer
21 views

Changing Hitbox from a single spritesheet

I have different animation in a single spritesheet. I wonder how do you guys assigning these hitboxes?
1
vote
1answer
20 views

Tiled tmx format into 3d Texture

I am thinking of making 3d games with 2d pixels feel. So far, i have been playing around in tiled and monogames. I learned some xml and managed to import and render tmx into my game. This is maybe a ...
0
votes
1answer
29 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
37 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
144 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
27 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
34 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
73 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
54 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
279 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
28 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
76 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
44 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
35 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
79 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
40 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
104 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
148 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
185 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
87 views

MonoGame / XNA Texture2D.SetData results in black texture

I use the following method to draw a box onto the screen: ...
1
vote
2answers
127 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
83 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
86 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
53 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
56 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
32 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
50 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
161 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
42 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
64 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
28 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
113 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
24 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
47 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
69 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
105 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
116 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
283 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
20 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
55 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
71 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 ...