Screens:
The scrollbar isn't part of the element, but another element I made which I called CGUIPanel. It simply adds a scrollbar to scroll through the elements inside it.
So how does it work? I invented a simple syntax that lets you add "control tags" in the text. So if I write:
It will look like this:This is an armor: #img:armor#. This #col:red#text is red#col#.
These are all the tags supported:This is an armor: . This text is red.
- #img:(name):(anchor)# : Displays an image. If anchor is specified (optional) it will be anchored to either left or right.
- #col:xxxx# ... #col# : Changes text color. #col# returns to original color.
- #font:xxxx# ... #font# : Changes font. #font# returns to original font.
- #tab# : Indents the text. Similar to pressing the TAB key.
- #hline# : Inserts a horizontal line. Uses the text color. Width can be specified by writing #hline:2# for a 2-pixel thick line.
- #align#: Changes text alignment. #align:center# is centered text and #align:right# is right-aligned text. #align# makes it left-aligned again.
NOTE: It uses the core::map<> class from the SVN version, so I included "irrMap.h" in the download (so you don't need SVN to use it). I hope that's OK with everyone.
Now that I see what can be done with this, I think I'll now take it one step further and make an HTML-like GUI component. I'm thinking I could make an entire GUI out of HTML-like code. That would be awesome! That would pretty much obsolete this component, but I thought I'd share what I found anyways.
If you like it, please tell me what you think
If you don't like it, please press Alt+F4.