Jump to content

Console


Paul Thomas
 Share

Recommended Posts

I decided to try and tackle this for the hell of it. I think just about every game I play has a console and thought it would be interesting to replicate this. Of course, initially easier thought than done. My main concern is doing it the most efficient way.

 

First I attempted to just use drawtext() to a buffer and display the buffer whenever I hit the tilde key. However, it just doesn't work out that way. Some consoles have scroll-bars and others you use the page up and down keys to view text that is hidden. So, this is my objective, to use page up and down to display more of the text.

 

I can't seem to achieve this. Once I've drawn the text to the buffer I'm not sure what to do to show different portions of the buffer. For testing I just did "Hello World #" for about twenty lines. The first five display on a height of 100. Anyone know how to display different portions of the buffer? Using a buffer to draw text onto with a height of 100 may just cut it off, so I've tried drawing to a buffer to the full window height, and when drawing the buffer it just makes the whole thing unreadable.

 

The answer to that question would be great regardless of whether that's the most efficient way of doing an in-game console or not, just because it would be helpful information for the future. My next question is, what would be the most efficient way of doing an in-game console? The method I'm attempting wouldn't be too bad once I've figured it out since I'd only have to draw the text onto the buffer whenever text is updated. The keyboard to text also wouldn't be too bad I guess. Any suggestions?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...