SlickBoard | CSS/XML Timeline (new) | XML/SWF Charts | Timeline Eons

 < previousnext > 

 

Text

 

<text x='number' 
      y='number' 
      width='number'  
      height='number' 
      rotation='number' 
      align_h='string' 
      align_v='string'
      font='string' 
      bold='boolean' 
      size='number' 
      color='string' 
      alpha='number'
      word_wrap='boolean' 
      leading='number'
      id='string'
      >text to draw</text>


Description

Text draws text with the following attributes:

  • x: The horizontal position of the rectangle's upper left corner relative to the upper left corner of the background (0, 0).

  • y: The vertical position of the rectangle's upper left corner relative to the upper left corner of the background (0, 0).

  • width: The rectangle's width. The default is 100.

  • height: The rectangle's height. The default is 50.

  • rotation: The rectangle's rotation. This works only when an embedded font is used (see font). The rectangle rotates around its upper left point (x, y). The default value is zero.

  • align_h: The text's horizontal alignment inside the rectangle. Valid values are left, center, and right. The default is left.

  • align_v: The text's vertical alignment inside the rectangle. Valid values are top, middle, and bottom. The default is top.

  • font: The font used to draw the text (see Font). The default is Arial.

  • bold: A boolean value that indicates whether the font is bold or not. Valid values are true or false. The default is true.

  • size: The font's size. The default 12.

  • color: The font's color. This is a string holding triple hexadecimal values representing the red, green, and blue components of a color. The default is "000000" (black).

  • alpha: This affects the text's transparency, only when an embedded font is used (see font). Valid values range from 0 (fully transparent) to 1 (fully opaque). The default is 1.

  • word_wrap: If the text is wider than the specified rectangle, this attribute determines whether the text is broken into multiple lines or kept in one. Valid values are true and false. The default is false (one line).

  • leading: If word_wrap is set to true, this determines the extra space added between the lines. Positive values increase the space and negative values decrease it. The default is 0.

  • id: The ID of the field, which becomes the variable name when field is used together with the submit action.

 


Escaped Characters & Multi-line Text

To display characters that conflict with the XML syntax, use the percentage symbol (%) followd by the characters' hex value.

To break a text into multiple lines, use the return's hex value %0D. Example:

<text>Show the "greater than" character: %3E</text>   
<text>Show this in%0Dtwo lines.</text>   

 

Example

<slickboard>
 
   <!-- draw a green text -->   
   <text x='50' 
         y='75' 
         width='200' 
         height='200'  
         rotation='10' 
         size='50' 
         color='88ff00' 
         alpha='.7'
         >GREEN</text>
         
   <!-- draw multi-line, red text with escaped characters -->   
   <text x='300' 
         y='50' 
         width='200' 
         height='200'  
         rotation='0' 
         size='30' 
         color='ff3300' 
         alpha='1'
         >Line 1%0DLine 2%0D%3Ctag%3E</text>     
   
</slickboard>

 

 < previousnext > 


Copyright © 2010-2017, maani.us