text input boxes

posted in Gaiiden's Scroll
Published December 02, 2004
Advertisement
The GUI expansion continues!




Here I have a text input box set up. I've always had text that you can change, but I've never wrapped it up into something like this. Meaning the input text (standalone) only accepts input after the text itself is clicked, not a certain area (like a box). Obviously this had shortcomings (like what happens if there's no text to click??). It's good I was finally able to make the input text object "whole" by placing it in the text box widget, which now lets you click anywhere on the text box to enable input, and also automatically handles input clipping.

input clipping? Well, the way this text box is set up, you can enter in as much text as you want - when you reach the end of the text box the text will scroll. When you finish input, the text will snap back to the beginning, showing all the text it can inside the box. The when you start input again, the text snaps to the end so you can add text. You can also set the text box to stop allowing input when the text string reaches the end of the box, rather than letting it continue and scroll.

Note that the text box itself is just the rectangular area of the image. The text box widget can have its border a different color than its background.

As usual, you can run the test app yourself by downloading it. Source is included, as always.

Let me know if you discover any bugs/issues!!
Previous Entry Barrel Rolling
Next Entry LOL
0 likes 6 comments

Comments

rick_appleton
Looking slick. Makes me want to continue work on my own GUI.
December 03, 2004 02:55 AM
johnhattan
Cool, I get to type my name on the side of Thunderbird Two. Shouldn't it be green?
December 03, 2004 06:22 AM
Karelian
Trailing underscores seem to be deleted one by one with every blink of the cursor.

Also (you're probably aware of this) it doesn't support some language specific special characters, such as umlauts (åäö). :)

But otherwise, it's nice.
December 03, 2004 11:08 AM
HemoGloben
Hmm, looks nice. Highlighting, and selecting text in the box would be cool.

Bugs:
Just one that I found, when I typed about 59-60 characters into the box, it broke.


See? Not sure what's doing it.

ATI Radeon 9700 Pro

Error log didn't show any errors...

*************************
Katana Engine Error Log
-------------------------
Log Opened: 17:44:55
            12/3/2004
*************************



*************************
Katana Engine Error Log
-------------------------
Log Closed: 17:45:11
            12/3/2004

Runtime: 0:0:16
*************************

December 03, 2004 04:36 PM
Roboguy
you didn't include the full code
December 04, 2004 03:51 AM
Gaiiden
Quote:
Looking slick. Makes me want to continue work on my own GUI.

Thx man. You should! Post pics!
Quote:
Cool, I get to type my name on the side of Thunderbird Two. Shouldn't it be green?

eh? [smile]
Quote:
Trailing underscores seem to be deleted one by one with every blink of the cursor.

Also (you're probably aware of this) it doesn't support some language specific special characters, such as umlauts (åäö). :)

But otherwise, it's nice.

Yea, the cursor isn't smart enough to tell whether the underscore entered is itself or not. But I plan on eventually changing the cursor to | and allowing for character insertion within the text anyways, so that won't be an issue for long.
Quote:
Hmm, looks nice. Highlighting, and selecting text in the box would be cool.

Bugs:
Just one that I found, when I typed about 59-60 characters into the box, it broke.

I prob won't do highlighting or selection. As for the bug, thanks - I'll look into it.
Quote:
you didn't include the full code

You mean the engine source? Sorry, that's still closed off for now [smile]. I'm only releasing the app source
December 05, 2004 04:23 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement