Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 1115 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!

Sleeper.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 131
Projects: 4
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
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 131
Projects: 4
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

Junior Member


Projects: 1



« Reply #5 - Posted 2012-11-10 18:28:51 »

This is my openGL console: https://github.com/Desmaster/Devio/blob/master/src/com/github/desmaster/Devio/cons/Console.java
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): http://gedankenweber.wordpress.com
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: 345
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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (16 views)
2014-09-21 02:42:18

BurntPizza (13 views)
2014-09-21 01:30:30

moogie (13 views)
2014-09-21 00:26:15

UprightPath (24 views)
2014-09-20 20:14:06

BurntPizza (27 views)
2014-09-19 03:14:18

Dwinin (40 views)
2014-09-12 09:08:26

Norakomi (70 views)
2014-09-10 13:57:51

TehJavaDev (96 views)
2014-09-10 06:39:09

Tekkerue (49 views)
2014-09-09 02:24:56

mitcheeb (70 views)
2014-09-08 06:06:29
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!