2 Replies - 928 Views - Last Post: 21 January 2015 - 09:48 AM Rate Topic: -----

#1 Jordy2254  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 45
  • Joined: 18-October 14

[Java] game dev in game console?

Posted 21 January 2015 - 04:36 AM

Hello everyone:

I am currently working on a game engine from pure java and so far it is working incredibly well, i am wanting to implement an in game console similar to how the Minecraft one works with a box you can type in. push anter and you can see everything:

I cannot think of how to do this but have already done the code for processing commands an currently call them from an improper UI.

how is rendering done:
The rendering is done on a can canvas using a buffered image so i could always use java's built in rect's and stuff. Anyone have any good idea's on how to implement this nicely if so give me some hint's doesn't necercerily need code just like what you would personaly do. So far all i have is a boolean to say if it's open or not, and a string.

Any help would be greatly appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: [Java] game dev in game console?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,476
  • Joined: 12-June 08

Re: [Java] game dev in game console?

Posted 21 January 2015 - 08:35 AM

Use a textbox.. or roll your own by mimicking the functions of a console window but deal with buffering text and such to the screen. Typically arrays or collections work well for storing the text.. then deal with drawing it to the screen. User input is something that can be stored in a string and buffered to the screen as well. The user type's a character it saves to the input string, the 'on draw' event happens, that string is shown to the screen in a designated area.. and the user thinks it's a text box or something. When the 'enter' is triggered the text goes to the array which is sent to the screen with the 'on draw' event.
Was This Post Helpful? 1
  • +
  • -

#3 Jordy2254  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 45
  • Joined: 18-October 14

Re: [Java] game dev in game console?

Posted 21 January 2015 - 09:48 AM

Eventually sussed it used my GUI class i made an made a textbox for it that updates input and convert's a keyevent to a char to a string, seems to work now obviously a couple more things to do, But all seems to be working. Thanks for the help :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1