Text (page element)

From MegaZine3
(Redirected from Txt)
Jump to: navigation, search


The txt element can be used to display text.

Attributes

align

  • Type: {center, justify, left, right}
  • Default: left

The text alignment of the element's text.

color

  • Type: Integer
  • Default: 0x000000

The text color used.

content .

  • Type: String

Note: ignore the period in this section's name. It's just there to keep the wiki's layout from breaking.

The text to display. To display HTML formatted tag, this attribute must be added as a child node to the element, and the text must be wrapped inside a CDATA node i.e.

<txt>
    <content lang="en"><![CDATA[My <b>HTML</b> <i>Formatted</i> text.]]></content>
</txt>

Basic HTML is supported, see Adobe's documentation for available options.

height

  • Type: Number
  • Default: auto

The height of the element.

rasterize

  • Type: Boolean
  • Default: true

Determines whether the text should be rendered into an image / bitmap. This can be used to override the rasterizing to false without setting txt@selectable to true. Useful when the text contains links, but should not be selectable.

selectable

  • Type: Boolean
  • Default: false

Determines whether the text in the text box should be selectable by the user or not.

width

  • Type: Number
  • Default: auto

The width of the element.

A note on links

When putting links in the text use HTML syntax (see @content), i.e. <a href="...">bla</a>, make sure to set @rasterize to false: <source lang=xml><txt rasterize="false">

 <content><![CDATA[
   Some <a href="http://www.example.com/">link</a>.
 ]]></content>

</txt>

MegaZine3 Core-related articles
Book elements Book · Chapter · Page · Spreadpage
Page elements Area · GIF · Image · Navigation · Sound · Text · Video