50.31 Text format tags

Since version 2.5 Hollywood is able to do text formatting on-the-fly. The Print(), CreateTextObject(), and TextOut() commands support special format tags that allow you to change the text color and style without calling SetFontStyle() or SetFontColor().

The following format tags are currently available:

[b]:
Change font style to 'bold'. Use [/b] to cancel 'bold' style.

[i]:
Change font style to 'italic'. Use [/i] to cancel 'italic' style.

[u]:
Change font style to 'underlined'. Use [/u] to cancel 'underlined' style.

[shadow=color,size,direction]:
Change the font style to 'shadow'. The new shadow will then use the color specified in color. It will run for the pixel distance specified in the argument size and it will be oriented according to the direction specified in direction. Please use any of the 8 directional constants as the direction argument. The color can be in RGB or ARGB notation. Shadow transparency is fully supported. Use [/shadow] to cancel 'shadow' style.

[edge=color,size]:
Change the font style to 'edge'. This style will render a border of size around the text. The border will be painted in the color specified in color. This can be a RGB or ARGB color specification. Border transparency is fully supported. Use [/edge] to cancel 'edge' style.

[color=color]:
Change font color to color. This color can be in RGB or ARGB notation. If you pass an ARGB value, the text will be rendered with transparency. Use [/color] to abort rendering in the current color and return to the previously active color.

Please note that due to these format tags you have to use two square brackets if you want to have a square bracket in your text. If there is only one square bracket Hollywood will always expect a format tag.

Here is an example how you can use these format tags with the commands of the text library:

 
Print("Normal [b]Bold[/b] [i]Italic[/i] [u]Underlined[/u]")

As you can see, using format tags is really easy and makes the Hollywood text processor very powerful for advanced text formatting.


Show TOC