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]:
[i]:
[u]:
[shadow=color,size,direction]:
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. Note that when palette mode is set
to #PALETTEMODE_PEN
and the text is drawn to a palette target, the color
argument must not be an RGB color but a palette pen.
[border=color,size]:
color
and the size specified in size
. The color can be a RGB or ARGB color
specification. Border transparency is fully supported. Use [/border]
to cancel border style. Note that when palette mode is set
to #PALETTEMODE_PEN
and the text is drawn to a palette target, the color
argument must not be an RGB color but a palette pen.
Before Hollywood 9.0, this tag was known as 'edge'.
[color=color]:
color
. This color can be in RGB or ARGB
notation. If you pass an ARGB value, the text will be rendered with
blending. Use [/color] to abort rendering in the current color and
return to the previously active color.
[pen=pen]:
#PALETTEMODE_PEN
and the text is drawn to a palette
target, this tag can be used to change the drawing pen. Use [/pen] to restore
the pen that was previously active. (V9.0)
[bulletcolor=color]:
color
. Bullets are only used when TextOut()
is used in list mode. See TextOut for details. The color you pass to this tag can be in RGB or
ARGB notation. If you pass an ARGB value, the bullet will be rendered with
blending. Note that in contrast to all other tags above, this tag must
not be closed. It just acts as a directive for the format processor to modify
the current bullet color. So you must never close it using [/bulletcolor]. (V9.0)
[bulletpen=pen]:
pen
. Bullets are only used when TextOut()
is used in list mode. See TextOut for details. Note that in contrast to all other tags above, this tag must
not be closed. It just acts as a directive for the format processor to modify
the current bullet pen. So you must never close it using [/bulletpen]. (V9.0)
Please note that because of 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.