Questions tagged [monogame]
Open-source implementation of Microsoft's XNA 4, for Windows, Mac, Linux, Android, and iOS, among others.
791
questions
2
votes
1
answer
379
views
Getting Rendered Sprite Size
I need the rendered dimensions of a sprite, I'm calling Draw in the class below:
...
2
votes
1
answer
149
views
Frame-rate drops when drawing 2D map tiles
Update: I figured out it has nothing to do with the camera but instead framerate drops when drawing my map tiles onto the screen.
Here’s a link to a video showcasing the bug in action (For further ...
0
votes
1
answer
87
views
Game() parametters Content and Window are not pre initialized
I've been experiencing a really Strange problem since recently, Every variables of XNA Framework Game class seems not to be initialized before my extending Game1 class. Variables does not seem to be ...
0
votes
0
answers
538
views
Playing Video for Splash screens etc using Monogame
I've been searching around on internet a way to display a video using XNA/Monogame. But everything tend to go in the direction of the class Microsoft.XNA.Framework.Media.Video. Unfortunatly, my xna ...
3
votes
2
answers
806
views
Room Detection on a Tilemap
I am working on a 2D top-down game inspired by Prison Architect.
What I just can't wrap my head around is recognizing rooms built by the player.
The game is built on a tilemap, meaning the map is ...
0
votes
0
answers
244
views
Making an enemy class for monogame c#
I have been given the task to create an enemy class as well as an enemy manager. I am completely confused as to how I will attempt this. these classes will be added into one group project with my ...
1
vote
2
answers
2k
views
How does ECS handle systems which need to know more about the environment of the entities it processes?
I'm trying to wrap my head around the concept of ECS (Entity Component System). I think I grasp the concept of the different parts, Entities, Components, and Systems.
Entities: Basically just a ...
0
votes
3
answers
678
views
XNA Rotate Vector2 around Origin
I have a Rectangle and a Vector2 position, my sprite is being drawn at this position. The rectangle is meant to be a collision system with the cursor, when I rotate my sprite around the origin and ...
1
vote
2
answers
781
views
Monogame - SpriteFont Exception: Text contains characters that cannot be resolved by this SpriteFont
I'm trying to put text on the screen and if I put anything but an empty string I get "Text contains characters that cannot be resolved by this SpriteFont.\nParameter name: text"
...
2
votes
0
answers
185
views
Are there any good techniques for reducing or smoothing stutter after a longer frame?
I've been using SDL2 with OpenGL to play around with some very basic game engine development. I'm running everything on a newer laptop with Linux and Intel integrated graphics.
Regardless of whether ...
0
votes
0
answers
131
views
Fresh new MonoDevelopment install "assembly not found for framework .NET Framework 4.5"
I'm using Ubuntu 18.04.4 LTS and I went through the instructions on this page: https://www.monodevelop.com/download/ very specifically, (yes, I made sure to use the steps for the correct operating ...
1
vote
1
answer
600
views
Calculating 3D character movement based on YAW and Pitch
I'm not sure how to calculate an XYZ immediately to my characters left based on the direction they are facing.
I am learning to create a 3D game in Monogame on top of .Net Core 3.1 in c# using ...
0
votes
0
answers
354
views
Sprite Distortion (Ghosting While Moving and Artifacts when Mirroring to External Display)
I am working on my first MonoGame project. I love the framework so far!
I have implemented my own letterbox/pillarboxing to scale my native resolution by the maximum integer scale allowable on my ...
2
votes
1
answer
315
views
Sprites looks blurried on fullscreen
I'm trying to make a pixel art game and my resolution is 384 x 224, but when I change to fullscreen the sprites looks blurry and I don't know how I can disable bilinear filtering.
I tried ...
1
vote
1
answer
99
views
Monogame pipeline couldn't load Xamarin.Mac
I Try to use my ContentProcessor, which I wrote on a Linux machine, on a Mac but it crashes with an unexpected failure.
The Pipeline Tool gives me the following
It seems to be a problem with the ...
1
vote
1
answer
2k
views
Monogame/XNA - How do you resize a Texture2D and then scale it?
Problem:
It seems like the Draw() call allows us to use either Destination Rectangle for resizing (5of8) or Scale (6of8/7of8) but not both.
Purpose:
I would like to resize a button from 567x634 to ...
1
vote
2
answers
169
views
Velocity Issue With MonoGame
I'm relatively new to programming velocity and such as I used to use Unity so it was already implemented. Right now, I'm using MonoGame and have an issue with my velocity code. Whenever I decelerate, ...
0
votes
2
answers
1k
views
Monogame - Load SpriteFont using .spritefont file without using the Pipeline Tool
There is a way to load a sprite-font without using the Monogame Pipeline tool?
I am creating a Game-Engine using Monogame, i cant use the Monogame Pipeline tool because the way that Game-Engine ...
1
vote
1
answer
184
views
How to store unique keys for an infinitely generated, chunked world?
My game is made up of chunks which are identified in world space with and X and Y coordinate. Each chunk contains 16 tiles by 16 tiles by 4 layers. So that I don't have to loop over every single tile ...
0
votes
1
answer
152
views
Reconstructing Position from Depth - Inverted Y?
I am currently trying to understand the following wierd result. This is basically from deferred shading in monogame/XNA. For Comparison I also write the ViewSpace Position in a Buffer and the ...
1
vote
0
answers
38
views
How do I change a specific set of spawned buttons from gray to green?
I'm a self-taught programmer.
I have a button class runs like this:
...
0
votes
2
answers
621
views
How would you go about placing objects between chunks in a 2D game?
I have a 2D infinitely generated world which is split up into 9 chunks at a time. Three chunks are loaded and three are unloaded whenever a player moves into a new chunk (if the player moves up a ...
0
votes
2
answers
1k
views
Shaders and Distortion Effect (Monogame)
I am building a top down 2D space shooter game with sandbox elements. I am working on the shield for the spaceship now and am not having luck. I am attempting to make a distortion effect shader, but ...
1
vote
1
answer
224
views
SpriteBatch.Draw has Padding on Monogame.Android
I am using Monogame to create a small Android game.
I am trying to draw a sprite to the Android screen but it seems to have a padding of some pixels. The same game works fine on desktop.
How can I ...
2
votes
1
answer
550
views
MonoGame game running slowly
Through development I've been running my 2D game (Monogame 3.6) on my windows laptop, which has some crummy integrated graphics card and an i5. Now I try my game on my gaming PC, which has a GTX 970 ...
0
votes
0
answers
148
views
Why aren't my isometric objects where I think they are?
Background
I am creating an isometric RPG using Tiled and Monogame. My goal is to have relatively elaborate terrain and movement, with my vision for the overworld being much like the now-venerable ...
1
vote
1
answer
45
views
Enemy sprite moving to a specific way depending on how it spawns
So I have a code where the sprite spawn outside the window and I want it to move on a specific straight line depending on where it spawn say if the sprite spawn at the top it goes at the bottom and ...
1
vote
1
answer
743
views
Monogame sprite rotation issue
I'm having interesting problem with rotating a sprite in MonoGame. Here is how origin, destination rectangle and scale are created:
...
2
votes
3
answers
1k
views
How do I get the full path of Content?
To display an image from Content in a .NET Forms Dialog, I'm trying to make a function that loads an image through .NET's Image.FromFile(string fileName) function, ...
1
vote
0
answers
46
views
Monogame - How to correct “brightness-additivity” while using Alpha-Blend-State
When using
GraphicsDevice.BlendState = BlendState.AlphaBlend;
in monogame
following happens:
Is there any avaible method to keep the color brightness ...
3
votes
1
answer
179
views
MonoGame: Music does not stop playing upon exit of game
I use MediaPlayer to play the background music. Sometimes, the music does not stop playing when I exit the game. This is even though I use the following code:
...
0
votes
0
answers
231
views
MonoGame - Model not rendering properly
I'm trying to render a model made in Blender. I export it to .fbx and import it in the content pipeline, load and draw it, but it displays like this:
And this is what it looks like in Blender:
Code ...
0
votes
1
answer
350
views
In Monogame, can/should SpriteBatch be instantiated in the Initialize method as opposed to the LoadContent method?
By default the SpriteBatch instance used is instantiated in the LoadContent method of Game1.
...
2
votes
1
answer
3k
views
Server game loop
I'm trying to setup a very simple multiplayer game that allows some users to join and walk around. The game is 2D and the players will have a position, the direction they are looking in (it's a top-...
0
votes
1
answer
809
views
Rendering to Texture with Transparency in Monogame?
Please forgive me if I'm asking a question that has been answered before, but for the life of me, search as I might, I couldn't find a problem exactly like this anywhere.
I'm trying to render a ...
0
votes
1
answer
720
views
How to use styles in Monogame.Extended.GUI?
So i was looking at the Monogame.Extended.GUI Project and used this instructions to set it up in a .net Core Project. So far everythings works fine. I followed the example of the demo and created a ...
0
votes
0
answers
61
views
Game input display is slow
I'm trying to build a very small example to run input logic but i'm facing a small issue. The code below is runnable with MonoGame v3.7.0.1708.
My problem is that whenever you press a key (here the ...
2
votes
1
answer
222
views
Rendering colors from a texcoord output
I'm trying to implement a faster alternative to super-sampling for my isometric 2d monogame game (for when the view is zoomed out). The idea was that I would render the texture coordinates to the ...
1
vote
1
answer
454
views
Monogame - Collision not working and invisible walls
I have recently been experimenting with Monogame and XNA (moving from Gamemaker) and decided to work on a simple collision system. Problem is shown in the GIF.
Main Collision
Each entity (Quick name ...
2
votes
1
answer
520
views
How do you write Texture2DContent and read it as Texture2D in the XNA content pipeline?
I'm trying to create a custom Monogame content pipeline extension that packs a bunch of individual sprites into a single sprite. I need help figuring out how to write and read the texture in the ...
0
votes
0
answers
180
views
How can I make the screen scroll only when the character is close to the edge?
On the internet, I saw videos and tutorials about screen scrolling. But those only show how to keep the player always in the center of the camera.
I want my camera to scroll over the level, following ...
1
vote
0
answers
656
views
Implementing a scrollable Panel in XNA/MonoGame
I am trying to create a scrolling Panel for my game. The code I've shown below works but there is a problem.
I read Andrew's answer here and decided to implement the scrolling effect by using a ...
1
vote
1
answer
192
views
How to add a animation to myPlayer
I'm currently making a shoot em up in monogame.
I want to add just one animation to my object. No commands or transitions between animations for different actions: just an object swapping between ...
0
votes
1
answer
97
views
Blender export does not render correctly in Monogame
I am using Monogame 3.7.0.7 on Linux and Blender.
I have exported my model using the "FBX 7.4 Binary" exporter. Here is a render from Blender:
However, when ...
1
vote
0
answers
161
views
C# 2D game collision detection huge problem
I'm making my first game using C# and Monogame and I have a huge problem with collision detection.
The entire code is in a link below:
My game code
So, I use Vector2 to keep position and dimensions ...
0
votes
2
answers
835
views
Storing user input into a queue
I am currently creating a small game using C#, and I am having some trouble working out how to handle user input.
I can move my model around the map normally, however I am looking to implement a ...
1
vote
1
answer
367
views
1
vote
1
answer
288
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
1
answer
341
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
1
answer
172
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 ...