Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Creating an ingame chat/console.  (Read 1554 times)
0 Members and 1 Guest are viewing this topic.
Offline Sleeper

Junior Newbie

« Posted 2012-11-10 14:43:48 »

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!

Online Jimmt
« League of Dukes »

JGO Kernel

Medals: 162
Projects: 5
Exp: 3 years

« Reply #1 - Posted 2012-11-10 15:48:36 »

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.
Offline Sleeper

Junior Newbie

« Reply #2 - Posted 2012-11-10 16:02:11 »

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?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online Jimmt
« League of Dukes »

JGO Kernel

Medals: 162
Projects: 5
Exp: 3 years

« Reply #3 - Posted 2012-11-10 16:08:37 »

Overlay? Do you need it to be transparent?
Offline Sleeper

Junior Newbie

« Reply #4 - Posted 2012-11-10 16:15:47 »

Not necessarily actually, I just don't want it to be visible at any given time.
Offline tdegroot96
« Reply #5 - Posted 2012-11-10 18:28:51 »

This is my openGL console:
Offline h3ckboy

JGO Coder

Medals: 5

« Reply #6 - Posted 2012-11-12 13:40:46 »

try using setVisible(false or true);

Or am i misunderstanding something?
Offline Varkas
« Reply #7 - Posted 2012-11-12 14:34:51 »

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

if (error) throw new Brick(); // Blog (german):
Offline Sleeper

Junior Newbie

« Reply #8 - Posted 2012-11-12 20:36:26 »

^ 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!
Offline ra4king

JGO Kernel

Medals: 389
Projects: 3
Exp: 5 years

I'm the King!

« Reply #9 - Posted 2012-11-13 00:28:17 »

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

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Agro
« Reply #10 - Posted 2012-11-13 00:32:07 »

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

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

bilznatch (26 views)
2015-08-04 11:03:17

SHC (44 views)
2015-08-01 03:58:20

Jesse (25 views)
2015-07-29 04:35:27

Riven (48 views)
2015-07-27 16:38:00

Riven (26 views)
2015-07-27 15:35:20

Riven (28 views)
2015-07-27 12:26:13

Riven (19 views)
2015-07-27 12:23:39

BurntPizza (42 views)
2015-07-25 00:14:37

BurntPizza (56 views)
2015-07-24 22:06:39

BurntPizza (35 views)
2015-07-24 06:06:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!