DoubleDeez / MDFramework

A multiplayer C# game framework for Godot 3.4 Mono.
https://discord.gg/UH49eHK
MIT License
77 stars 13 forks source link

On Screen Debug #18

Closed Beider closed 4 years ago

Beider commented 4 years ago

I added an onscreen debugger to my own fork of MDFramework,

The class is here

This video shows it in action

This is an example of how it works, it is very easy to use. By default I bound it to F12 in my fork.

AddOnScreenDebugInfo("FPS", () => Engine.GetFramesPerSecond().ToString());
AddOnScreenDebugInfo("Static Memory", () => MDStatics.HumanReadableSize(OS.GetStaticMemoryUsage()));
AddOnScreenDebugInfo("Network Active: ", () => MDStatics.IsNetworkActive().ToString());
AddOnScreenDebugInfo("PeerId: ", () => MDStatics.GetPeerId().ToString());

Is this something that would fit into the framework? I personally think it is very useful for printing information to the screen during runtime.

DoubleDeez commented 4 years ago

This is great, I was planning on adding something like this so I think it would be a great addition.

DoubleDeez commented 4 years ago

Adding a field for specifying the color I think would be helpful too.

Beider commented 4 years ago

I will add this, do you think we need color per line or just overall color for the whole thing?

DoubleDeez commented 4 years ago

I think per line would be ideal

Beider commented 4 years ago

Added color per line on my branch. Will be in next pull request.