News Examples Documentation Download Buy Forum Contact

Textfield Plugin textfield.swf / html5:intern Version 1.16

  • A plugin for displaying simple html/css formated texts.
  • The position and size of the plugin can by adjusted with the standard layer/plugin attributes. When no size will be set, the default size of 400x300 will be used.
  • In the krpano HTML5 Viewer the textfield plugin is directly integrated into the viewer itself. The internal HTML5 textfield plugin will be automatically used when trying to load a 'textfield.swf' file.
  • Note - there is no full html/css support - use it only for small and simple texts!

Syntax

<layer name="text"
       url="textfield.swf"
       align="lefttop" x="10" y="10" width="100" height="20"
       children="false"
       html="..."
       css="..."
       autoheight="false"
       vcenter="false"
       background="true"
       backgroundcolor="0xFFFFFF"
       backgroundalpha="1.0"
       border="false"
       bordercolor="0x000000"
       borderalpha="1.0"
       borderwidth="1.0"
       roundedge="0"
       shadow="0.0"
       shadowrange="4.0"
       shadowangle="45"
       shadowcolor="0x000000"
       shadowalpha="1.0"
       textshadow="0.0"
       textshadowrange="4.0"
       textshadowangle="45"
       textshadowcolor="0x000000"
       textshadowalpha="1.0"
       onautosized=""
       />

Plugin Attributes

  • html
    • Set the html formated text.
    • When using the < and > characters will be not possible, (because of xml limitations) then the [ and ] characters can be used instead - krpano will map them automatically. And to get the real [ and ] characters use them twice - [[ and ]].
    • There are two possiblites to set the html text:
      1. Either directly in the html attribute:
        html="[b]Bold Text[/b]"
      2. Or put the html content in a <data> xml element and refer to it via data:name:
        html="data:htmltext"
    • It is possible to create links in the html code that can call krpano actions, by using event:actions as link target:
      <a href="event:showlog(); trace('link clicked');">link</a>
    • When the text itself should be not select- and clickable, then the plugin/layer children setting should be set to false.
    • Note - the Flashplayer supports only a small and limited subset of html and css code! Don't try using 'real' html/css code here!
      Here a link to the offical Flashplayer documentation about the supported HTML elements: http://help.adobe.com/.../TextField.html#htmlText
  • css
    • Set the css styles for the html text.
    • There are two possiblites to set the css style:
      1. Either directly in the css attribute:
        css="text-align:center; color:#FFFFFF; font-family:Arial;"
      2. Or put the css styles in a <data> xml element and refer to it via data:name:
        css="data:cssstyles"
    • Note - the Flashplayer supports only a small and limited subset of html and css code! Don't try using 'real' html/css code here!
      Here a link to the offical Flashplayer documentation about the supported CSS elements: http://help.adobe.com/.../StyleSheet.html
  • autoheight
    • When set to true then the height of the textfield will be calculated automatically depending on the html content.
    • The onautosized event can be used to get informed about size changes.
    • The default is false.
    • Note - there can be a short delay when the height need to be calculated!
    • Note - the vcenter setting can NOT be used together with the autoheight setting!
  • vcenter
    • Vertically center the text within the given plugin height.
    • The setting autoheight need to be set to false for this case.
    • The default is false (=no vertical centering).
    • Tip - for horizontal centering use the css style 'text-align:center;'
    • Note - the autoheight setting can NOT be used together with the vcenter setting!
  • background
    • Draw a background behind the textfield.
    • The default is true.
  • backgroundcolor
    • The color of the textfield background.
    • The default is 0xFFFFFF (=White).
  • backgroundalpha
    • The alpha transparency of the textfield background.
    • The default is 1.0.
  • border
    • Draw a border around the textfield.
    • The default is false.
  • bordercolor
    • The color of the textfield border.
    • The default is 0x000000 (=Black).
  • borderalpha
    • The alpha transparency of the textfield border.
    • The default is 1.0.
  • borderwidth
    • The line-width of the textfield border.
    • The default is 1.0.
  • roundedge
    • Make the textfield edges round.
    • The value defines the size of the rounded edges.
    • The default is 0.0.
  • shadow
    • Put a shadow behind the textfield.
    • The value defines the distance of the shadow.
    • The value 0.0 disables the shadow. For a 'centered shadow' or 'glowing effects' use very small values like 0.01.
    • The default is 0.0 (=no shadow).
  • shadowrange
    • The blurring range of the shadow.
    • The default is 4.0.
  • shadowangle
    • The angle of the shadow in degrees.
    • The default is 45.
  • shadowcolor / shadowalpha
    • The color and alpha transparency of the shadow.
    • The defaults are 0x000000 (=Black) and 1.0.
  • textshadow
    • Put a shadow behind the text itself.
    • The value defines the distance of the shadow.
    • The value 0.0 disables the shadow. For a 'centered shadow' or 'glowing effects' use very small values like 0.01.
    • The default is 0.0 (=no shadow).
  • textshadowrange
    • The blurring range of the text-shadow.
    • The default is 4.0.
  • textshadowangle
    • The angle of the text-shadow in degrees.
    • The default is 45.
  • textshadowcolor / textshadowalpha
    • The color and alpha transparency of the text-shadow.
    • The defaults are 0x000000 (=Black) and 1.0.

Plugin Events

  • onautosized
    • This event will be called when autoheight=true is set and the size of the plugin has changed.
    • Note - due the automatic word-breaking, there can be more than one onautosized event when the width or the html content will be changed.
    • Note - when creating a textfield plugin element dynamically by actions (addplugin, ...), then the onautosized event should be set before setting the html value to avoid missing the first call of it.