Sign in to follow this  

Implementing an in game debug console (WebGL/Threejs)

This topic is 1279 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do I implement a console popping up on the game canvas to take in commands and affect the game in real time?

 

Some searches I've done have not really helped me in the right direction. I understand it will be a gui element of some sort and parsing the input strings is relatively straightforward so no need to explain that bit. This may be a complex question so I appreciate all positive input.

Share this post


Link to post
Share on other sites

There's not a ton to it -- you can create the UI with normal HTML elements, style them with CSS, and fancy them up with jQuery or other libraries. But, you need to write your game such that your game loop includes console-handling, and can then pass the commands down into your game control structures. You also need to be able to read out various stats/data from your game. Its hard to tell you how to do that last part -- its where most of your effort will go, and it completely depends on how your game works.

 

One good bit of news is that basically all debug consoles work in the same way, regardless of language or UI technology. any information you find on debug consoles can apply to your particular situation in a fairly straight-forward way.

Share this post


Link to post
Share on other sites
Sign in to follow this