7,292 questions
1
vote
0
answers
59
views
Issue on drawing object on top of moving platform
I'm developing a 2D game and I ran into a problem implementing the logic for a movable platform. These are the ones where the player stands on top of the platform, and the platforms move, and the ...
1
vote
0
answers
66
views
Fake Road 3D Effect in C# Monogame
currently I'm trying to achieve a fake road 3D effect in monogame. I used this tutorial so far:
https://www.youtube.com/watch?v=xTyURl8qjZw
I successfully translated the first part where the road goes ...
0
votes
0
answers
50
views
Slowdown in 2D tile based platformer
I'm trying to make a 2D tile based platformer in monogame. In fulscreen mode, when too many tiles are on screen the frame rate goes down and the game is moving slow. I don't know what causes these ...
0
votes
1
answer
184
views
Game States in MonoGame
I'm a beginner to Monogame and I'm trying to find an efficient way to change game states. For example, when the player dies, the screen changes to the menu screen. When the player clicks a button, the ...
0
votes
1
answer
93
views
MonoGame - trouble switching between scenes without creating useless windows
I'm solo working on a video game as a hobby and decided to give MonoGame a try. I'm a beginner so I'm not very knowledgeable. Everything works fine for now, except the game creating a totally useless ...
1
vote
1
answer
110
views
Repeating portion of a Texture2D in a single SpriteBatch.Draw call
I have a large Texture2D with many sprites and I want to draw one of these sprites repeatedly. I'm currently making a for loop to do this and a trim logic to get the exact desired length and not only ...
1
vote
1
answer
118
views
(XNA/MonoGame) Implementing the screen dragging camera movement
I'm making a strategy with top-down 2D graphics. I implemented the way to move the view by holding LMB and then "dragging" the screen. It works fine with the exception of the movement being ...
2
votes
1
answer
116
views
Rotating a Camera in Microsoft XNA Framework (MonoGame)
I'm trying to create a First Person Controller in XNA (MonoGame). However, I'm unsure on how I can rotate my 3D Camera
I've been told to make a Rotation Matrix but I'm unsure on how I can implement ...
1
vote
1
answer
60
views
XNA Dispose function causes visual error when switching render targets
Currently working on a game using XNA with MonoGame but have run into a visual error while trying to render the background where it'll appear above sprites when it should always appear behind.
The ...
0
votes
1
answer
93
views
How can I fix the normals in this instanced lighting example? (Monogame/XNA)
The models in my game are instanced to reduce draw calls, which basically means I'm passing in a 4x4 transform as part of a custom vertex definition. I am trying to get basic lighting working but can'...
0
votes
1
answer
272
views
Monogame : Which case would run faster? Texture2D.SetData()
I'm writing a Falling Sand Simulator and I'm trying to determine the best way to draw on the screen.
I noticed Texture2D.SetData is pretty slow but Im not sure what is making it slow.
I trying to ...
0
votes
1
answer
113
views
How can I transform billboarded sprites into y-axis aligned billboarded sprites?
I'm looking at Shawn Hargreave's old xna tutorials about billboarding 2D sprites, and in the last example he shows how its possible to use spritebatch to draw all of the billboarded sprites within a ...
0
votes
1
answer
195
views
Why is my .txt file not being read in my monogame game?
I am trying to read a highscore .txt file that is located in my debug folder for my monogame game. The directory is also there. I am using System.IO's read function to read the file and it keeps ...
0
votes
2
answers
314
views
Is there a way to dynamically create a generic Texture2D?
I am currently developing an ECS within Monogame as a personal project and I want to set a default Sprite for my Sprite Components. However, I do not want to load in a file from the ContentManager, I ...
0
votes
1
answer
52
views
C# XNA 4.0: How to get the tangent and binormal of the model?
There's this code snippet I have that I used to try to get those:
VertexBuffer vtxBuffer = new VertexBuffer(graphics.GraphicsDevice, typeof(VertexPositionNormalTextureTangentBinormal), meshPart....
1
vote
1
answer
337
views
Multiply Matrix and Vector4 XNA
How do I multiply a Matrix by a Vector4 in XNA/monogame?
Matrix a = Matrix.Identity;
Vector4 b = Vector4.Zero;
b = a*b;
This gives an error. This should be allowed afaik. Do I ...
1
vote
0
answers
33
views
How to apply transformation to imported Assets?
I am trying to make a simple program that displays 3 different imported assets at different locations in the world. They are all rendering properly, but I can't figure out how to apply transformations ...
0
votes
1
answer
76
views
How does MathHelper's Smoothstep() fuction work, and how could I use it to animate things?
I am trying to animate something for a mod I'm making in c#(Disclaimer: I don't think that knowing what game it is will be important). I would like to know how MathHelper's Smoothstep() function works ...
1
vote
1
answer
117
views
3D audio not working in 2D game after switching from XNA to MonoGame
This is a problem I have never managed to solve for a 2D game I have ported to MonoGame 3.7.1 from XNA 4.0.
The project is set up as DesktopGL, and uses .NET Framework 4.8.
In the XNA version, 3D ...
1
vote
0
answers
55
views
Xna Monogame C# Keyborad input issue with German keyboard
I would like to program a text input with xna, everything works, only the German letters "ö, ä, ü" are not recognized and there is no enum for these keys on the keyboard. When I enter it, ...
0
votes
1
answer
48
views
How to draw a Texture2D sprite appear as if it's growing upwards out of another Texture2D? MonoGame/XNA
I was wondering how to draw a Texture2D sprite to appear as if a vine is growing upwards, like in Super Mario Bros. Are there any options to make this work?
I found this and this but it's not quite ...
1
vote
1
answer
229
views
Monogame, XNA measure FPS
Please could me someone explain to me how does work this calculation?
this formula works (its derivation)? I do not get it :(
framerate = (1 / gameTime.ElapsedGameTime.TotalSeconds);
From ...
1
vote
0
answers
161
views
Monogame - repeat texture on mesh when scaled
currently I'm developing a first person shooter with 3D meshes building my world. My meshes can have a texture on each side (front, back, left, right, top, bottom). That works very well. This is the ...
0
votes
1
answer
277
views
Microsoft.Xna.Framework.Content.ContentLoadException on VideoPlayer in Microsoft.Xna.Framework.Media (Monogame)
I'm trying to play a video in Monogame. I was having a bit of trouble because the easiest way is to use VideoPlayer, which is not in my Microsoft.Xna.Framework.Media for some reason. So I pointed my ...
0
votes
2
answers
139
views
C# Monogame Code Skipping Ahead While Calculating Next Move (Chess)
I'm currently programming a chess AI and I'm using Monogame for the graphics. I want to add an animation of the computer's pieces sliding to the square they moved the piece to, but my code won't work. ...
0
votes
1
answer
91
views
How to change Texture coordinates in MGFX Shaders in Monogame
I'm trying to change texture coordinates from Effect class in Monogame, how can I do that?
this is code in C#:
lighting.CurrentTechnique = lighting.Techniques["LightDrawing"]
lighting....
2
votes
2
answers
318
views
Problem with RenderTarget and Transformation Matrix in MonoGame
I've been trying to reach a good solution on different resolutions, but none have been working very well, either the sprites get distorted, everythings gets offset, or a variety of different ...
0
votes
1
answer
59
views
Reuse similar constructors without the use of inheritance
This is a code for MonoGame 3.8.1 and .NET 6.
public interface IEntity
{
int Size { get; }
Vector2 Position { get; }
}
public class Player : IEntity
{
public int Size { get; } = 32;
...
0
votes
1
answer
170
views
MonoGame Problem with renderize Texture2D on camera movement
First, sorry for my bad English, English is not my native language.
I have a problem when I draw a Texture2D in screen. When I move a Texture in screen,
colors in border of the texture flickers. This ...
0
votes
1
answer
450
views
Microsoft.Xna.Framework.Content.ContentLoadException
So I'm creating a commercial game with monogame and monogame extended and one of the biggest thing in monogame extended is it's ease of creating animations with sprite sheets but whenever I try to ...
0
votes
1
answer
2k
views
XNA studio is not working for my install of Visual Studio Community 2022
I can't use XNA studio with my install of Visual Studio 2022, version 17.4.0.
Whenever I try to install XNA game studio 4.0.vsix I get this error
XNA Game Studio 4.0
This extension is not installable ...
0
votes
1
answer
63
views
Arabic Character Support - Html (ASCII) - XNA
What is the extent of Arabic letters in HTML?
<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:Graphics="ReLogic.Content.Pipeline">
<Asset ...
2
votes
1
answer
440
views
Monogame - sprite not rotating around origin point
I'm trying to rotate a sprite around its center with following code:
Vector2 origin = new Vector2(position.Width / 2, position.Height / 2);
s.Draw(position, origin, angle, ...
0
votes
1
answer
571
views
Monogame - Rotate Sprite around centre of screen and itself
I have a problem and although I serached everywhere I couldn't find a solution.
I have a stacked sprite and I'm rotating this sprite around the center of the screen. So I iterate over a list of ...
0
votes
1
answer
469
views
Need help modifying existing A* Algorithm to disallow diagonal movement in specific scenario
I'm currently using this pathfinding algorithm found here on GitHub written by Gustavo Franco in 2006 (specifically PathFinderFast.cs). It's wicked fast and works fantastic. The only issue is that I ...
0
votes
1
answer
114
views
Only one object in an array is drawn
I'm trying to learn Monogame / XNA by creating a little Terraria-like game. I currently want to create a world, which is completely filled with dirt. My problem is that only one block from an block ...
-1
votes
1
answer
373
views
How to properly convert keys of digits to string in Mongame?
I'm trying to update player text input in real-time.
In Monogame / XNA, the Key class does have toString() method, but their return is not exactly what I wish to have. For example, if I press 2 on a ...
0
votes
1
answer
617
views
Monogame / Xna basic 3D Vector rotation math
I am struggling with some basic vector rotations in Monogame.
I have a 3D forward facing unit vector (0, 0, -1) and simply want to rotate them 180 degrees around the Y axis (up). Here is the code:
[...
0
votes
1
answer
2k
views
2D Continous Collision Detection in Monogame/Xna Framework
I'm working on a custom physics engine for a potential game - based in Monogame/the XNA framework. While the physics itself works pretty well, I'm running into an issue with collision. When the player ...
0
votes
2
answers
199
views
C# XNA An object reference is required for the non-static field, method, or property
I'm trying to create egg spawner but this error comes out.
Tried to fix this error but unlucky I can't.
I know that XNA Framework is outdated but I use it for learning.
Would someone help me?
Thanks.
...
0
votes
0
answers
644
views
"Microsoft.Xna.Framework.Graphics.GraphicsDevice.GraphicsDevice" giving me AccessViolationException
So, recently I was following a tutorial on how to make a game with FNA in Visual Studio.
Everything worked fine until I added these four lines of code (in cs):
graphics.PreferredBackBufferWidth = 1280;...
0
votes
1
answer
472
views
How do I check if a sprite is at a specific location on Monogame XNA C#
I am making a game and am fairy new to this language and I need to detect if a sprite has reached a certain location for the game to have some sort of response.
something like;
if ( /* position of ...
0
votes
1
answer
2k
views
Trying to install MonoGame for mac and VS Code
I'm trying to install MonoGame for mac and VS code. I followed the instructions at https://docs.monogame.net/articles/getting_started/1_setting_up_your_development_environment_macos.html, but I am ...
0
votes
1
answer
478
views
XNA Project Dependencies not working/loading - monogame
Started a monogame project yesterday, was working perfectly fine, loaded up the project this morning and Visual Studio has decided that Xna doesn't exist:
the type or namespace name 'xna' does not ...
2
votes
1
answer
676
views
Monogame Content not building from VS
I was working on a game on my laptop which I now copied to my desktop (on which I installed Monogame 3.7.1). I can run the build from my laptop on my desktop, but when building it on my desktop (from ...
0
votes
1
answer
482
views
FMOD C# Wrapper unable to find fmod.dll (from Monogame 3.8)
I'm attempting to bring FMOD Core 2.02 into my Monogame 3.8 project using the dll's and C# wrappers (which appear to be auto-generated from the C++). I've set the .dll's to Copy to the output ...
2
votes
1
answer
3k
views
How to draw on the fly 2D pixel-by-pixel in MonoGame/XNA?
I was wondering how to draw on the fly pixel by pixel in XNA/MonoGame and could only find this. Problem is, the question wasn't centered about how to actually draw pixel by pixel but rather manage ...
1
vote
1
answer
583
views
Cloning and drawing Objects in monogame
How do I clone an object then pick a random position, then draw it.
This is the code I have for the object:
public class Trash : ICloneable
{
private Texture2D _texture;
private ...
0
votes
1
answer
113
views
Slow update time with tiles and MouseState MonoGame
Very new developer here.
In my program I have a randomly generating world map using a simplex noise library. On top of this I am attempting to draw a tilemap of transparent 4x4 tiles that appear ...
0
votes
1
answer
873
views
Monogame not drawing png images
I'm trying to draw a sprite to the screen in monogame but does not work. Does not give any errors. I've tried other images and it works with them. Maybe it has something to do with the image being ....