Rendering text


The example below shows a simple TextBlock component with no style applied.

OUTPUT

SMXML
<!DOCTYPE composer SYSTEM "http://dtd.samplemath.com/smxml.dtd">
<composer>
    <box id="background" width="100%" height="100%" alpha=".1" rounded="24"/>
    <textblock x="100" y="50" width="420" height="-30" textformat="leftTextFormat"><![CDATA[Vivamus consequat consectetur dignissim. Cras rhoncus orci quis nibh sagittis lobortis.]]></textblock>
</composer>





Applying Styles


Styles that can be applied on a TextBlock component.

Style typeAttribute nameDescription
textformattextformatThe textformat describing the TextBlock.
filterfilter or filtersThe filter(s) applied to the TextBlock.

You pretty much control all text style and interaction aspects of the TextBlock using the textformat style.

OUTPUT

SMXML
<!DOCTYPE composer SYSTEM "http://dtd.samplemath.com/smxml.dtd">
<composer>
    <style>          
        <textformat style="leftTextFormat">
            <align>center</align>
            <autosize>0</autosize>
            <color>0x000055</color>
            <embedfonts>0</embedfonts>
            <font>Times New Roman</font>
            <leading>0</leading>
            <letterspacing>0</letterspacing>
            <selectable>1</selectable>
            <selectedcolor>0xffffff</selectedcolor>
            <selectioncolor>0x000055</selectioncolor>
            <size>16</size>
            <wordwrap>1</wordwrap>
        </textformat>
    </style>
    <box id="background" width="100%" height="100%" alpha=".1" rounded="24"/>
    <textblock x="100" y="20" width="400" height="-30" textformat="leftTextFormat"><![CDATA[Vivamus consequat consectetur dignissim. Cras rhoncus orci quis nibh sagittis lobortis. Maecenas velit arcu, vestibulum in tristique sed, lacinia non lorem. Donec iaculis ultricies feugiat. Sed sollicitudin consectetur dolor, ut facilisis sapien pharetra ut. Etiam sit amet massa a eros fermentum luctus. Fusce vitae consequat ligula. Nullam eu elit lorem, ut hendrerit dui. Nam convallis lorem at sapien egestas tincidunt. Lorem ipsum dolor sit amet, consectetur adipiscing elit.]]></textblock>
</composer>





TextBlock in AS3


TextBlock essentially wraps an AS3 textfield class to be used with SMAF. For convenience it exposes both text and htmltext properties as well as a textfield property to obtain hold of the TextField instance wrapped inside TextBlock.




See the SMAF reference for more information on the TextBlock component.

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki