Creating an ingame chat/console.

Hello JGO developers,

I have been following this website on and off since the start of my Java development career (~1 year ago),
but only recently I have started developing my own little game.

Now I’m stuck with what I guess is going to be a newbie question:
How do I create a proper ingame chat/console?

I’m using a JFrame & a Canvas at this point, but how can I render/toggle a console over/in these containers.
I have tried searching these forums but with no luck.
Any example implementations/guidance would be greatly appreciated!

Thanks in advance guys!

Sleeper.

JTextField to post stuff, JTextArea to display chat? You can just add the components to the panel (canvas).
Or JTextPane if you want to be able to post images, styled text, etc.

Yeah I kind of thought about doing it like that, it’s just that I would like to be able to show/hide the chat,
and I want it to overlay the screen (read: Canvas) partially instead of stretching the screen (JFrame)

Any suggestions?

Overlay? Do you need it to be transparent?

Not necessarily actually, I just don’t want it to be visible at any given time.

This is my openGL console: https://github.com/Desmaster/Devio/blob/master/src/com/github/desmaster/Devio/cons/Console.java

try using setVisible(false or true);

Or am i misunderstanding something?

Use a JNI Com bridge and embed your favorite IRC client :wink: (not a serious suggestion, but it could even work …)

^ Haha, nice!

I’ve implemented a really really bad Graphics2D chatbox.
It works but it’s implemented pretty sloppy.

I’ll think about it a little more, thanks for the help everyone!

A simple JTextArea + JTextField should be all you need! Why are you overcomplicating things? XD

I usually make one with Graphics. Its not that hard if you know what you’re doing. Its basically simulating a JTextfield.c