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.

1
vote
1answer
76 views

My position is “changing” when handling animation

I'm trying to learn Monogames(Old XNA) and how to develop a 2d game. I'm in the process of animating my sprites. It works but there are somethings that are weird to me. For some reason when ...
0
votes
0answers
39 views

How can I do a Metroid like transition between two tilemaps with Monogame Extended?

I want to do a transition like those in the Metroid games. Here is an example of what i mean: https://www.youtube.com/watch?v=RKJ3MAi0ZI0. You enter the door, the screen fades to black and the camera ...
0
votes
0answers
11 views

How to check if a custom Control is focused?

So I am building custom UI for my MonoGame project. I've gotten pretty far already, having created Controls such as: Button Panel TextBox Form ComboBox CheckBox etc. All of these controls obviously ...
0
votes
1answer
28 views

How to fix Corner Collision with SAT algorithm?

I am making a platformer game, my way of handling collision works most of the times, but when I jump on a platform's corner I get pushed away, it probably happens because my function returns right or ...
0
votes
0answers
18 views

How can I debug my game on mobile device?

I've been creating this game on my computer for months and everything works fine. But when I built the project and installed it into my android device, it doesn't run as smoothly. I don't wanna use ...
0
votes
1answer
45 views

How can I create online leaderboards for iOS and Android?

I'm developing a racing game for iOS and Android phones/tablets and I want to implement online leaderboards. My game has a singleplayer mode(no multiplayer features) but I want to implement online ...
0
votes
1answer
77 views

MonoGame - correct overloads for SpriteBatch.Draw flipping horizontally

I want to flip my sprite horizontally while drawing and I can't figure out how to use the correct parameters without either an error or a warning about the method being obsolete. This is what I ...
0
votes
0answers
12 views

Transform Vector3 into Vector2 with PerspectiveFieldOfView Matrix

If I understand correctly, Matrix.CreatePerspectiveFieldOfView(…) creates a Matrix that projects a ...
2
votes
1answer
49 views

Why does my sprite shifts position on specific animationframe?

I have created a spritesheet to create animation. Everything is working fine untill I come to a specific frame in one animation. I have currently 3 animations loops Idle Animation Moving Animation ...
0
votes
0answers
30 views

Draw a texture2D at specific coordinates on another Texture2D

I have a ShipTexture and a Sail Texture. I need to draw the sail texture at a specific location on the shipTexture (call it the sailMountPoint) regardless of the location vector associated with the ...
1
vote
0answers
24 views

MonoGame game does not work on other pc, when installed by WiX

I made a simple tetris game. I wanted to give it to my friend, so that he could test it. I made very fast WiX project and setted up every file from bin/Debug. On my ...
1
vote
0answers
29 views

Load/generate new resources on start up in MonoGame

I've a question about loading resources at the beginning of my game written in MonoGame. I've several spritesheets which I'm loading at the beginning of the game. This take about 5-10 seconds on my ...
1
vote
1answer
27 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
20 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
30 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
13 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
37 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
144 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
57 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
51 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
68 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
68 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
38 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
33 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
29 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
24 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
24 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
179 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
57 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
59 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
112 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
124 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
972 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
46 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
92 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
70 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
165 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
242 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
397 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
168 views

MonoGame / XNA Texture2D.SetData results in black texture

I use the following method to draw a box onto the screen: ...
1
vote
2answers
134 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
125 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
64 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
73 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
43 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 ...
1
vote
1answer
246 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
70 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
96 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 ...