How do you print or output text in Monogame?
I googled how to display text in monogame and was led to this: Debug.WriteLine
Which says: "By default, the output is written to an instance of DefaultTraceListener."(and that page just confused me more).
So, if someone could direct me to a method of displaying DefaultTraceListener, or another method of outputting text in monogame, I would appreciate it.
Write(thing in here); or Console. WriteLine(thing in here); to write to the console window.
WriteLine(String) Writes a message followed by a line terminator to the trace listeners in the Listeners collection. WriteLine(Object) Writes the value of the object's ToString() method to the trace listeners in the Listeners collection.
I found it!
Using Debug.WriteLine writes to the debugger, which is in the output window in Visual Studio(by default at the bottom). It appears when you close the program(press F5 to start, Esc to close) by default in an OpenGL project.
If you like, you can use Console.WriteLine
like you would in a normal C# console application, assuming you're developing a desktop application. There are a couple of steps.
Your application should run as normal, only a console window should appear when you start the game.
Alternatively, you can use Debug.WriteLine
, which will write to the output window in Visual Studio (it should appear when you start debugging your game).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With