Stack Exchange Network

Stack Exchange network consists of 175 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
13 views

How to Define XML Map in Monogame.Extended.Animations

I am very new to the Monogame Framework, and am trying to get started by using the Monogame.Extended.Animations library. However, when reading through the documentation on the official documentation ...
1
vote
1answer
16 views

Spine + MonoGame > viewMatrix / camera offset

we switched from frame by frame animations to Spine (this animation software). The issue I am facing now, that it am unable to fit it in our coordinate system. (simple 2D game) I guess there is an ...
0
votes
1answer
18 views

Vertices in index buffer not rendered

I'm beginning with the 3D rendering in Monogame and i'm facing not a real issue because i already find a way to bypass it but more of a question. I'm rendering a simple cube with 8 vertices like that:...
0
votes
0answers
17 views

How should I go about handling nonuniformed sprite sheet with JSON data?

This might be a lenghty question so bare with me. I'm developing a 2D game i Monogame framework and I'm stuck with it comes to handle large sprite sheets with different frame width, height and ...
1
vote
0answers
9 views

Reflection shader (orginated from XNA 10 years ago) doesn't work - Model is just black?

can anyone help me with this one. I'm creating a 3D game. For my game, i have created a lot of 3D objects. Im everything works as intended so far, but I'm trying to implement a "Chrome Reflection" ...
0
votes
1answer
34 views

Simplify Matrix math code- Sun billboarding

If was trying to set the correct position of my sun billboard in my 3d game. I tried long until it worked correctly, but I wonder why this code must be so complicated: ...
0
votes
3answers
134 views

Is there an advantage to creating a tileset instead of multiple content items?

I'm using MonoGame to build my first game (yes, I'm new to game development). I'm trying to start by creating a 2D platformer so I want to have different "tiles" for the ground, walls, ceiling, etc. ...
1
vote
1answer
44 views

Split tiles into Chunks [2D]

I'm trying to make a Chunk class for my Tile class creating Chunks of 25 Tiles each, But for some reason it doesn't work correctly Tile.cs extends Sprite.cs ...
0
votes
1answer
45 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
41 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
61 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
61 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
32 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
31 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
22 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
21 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
33 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 ...
1
vote
2answers
155 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
37 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 ...
2
votes
1answer
46 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
91 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
90 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
633 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
1answer
41 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
82 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
56 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
127 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
184 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
279 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
127 views

MonoGame / XNA Texture2D.SetData results in black texture

I use the following method to draw a box onto the screen: ...
1
vote
2answers
132 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
108 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"...
2
votes
0answers
60 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
66 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
37 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
60 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
205 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
54 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
74 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
36 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
123 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
27 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
52 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
126 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
141 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
200 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
388 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 ...
1
vote
0answers
21 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 ...