Attribute name | Type | Default value |
text
html
|
String |
"" |
- Set the text/content for the textfield.
- The text can be HTML or BBCode formatted and styled by CSS styles or CSS classes.
- Note - for defining CSS styles/classes directly in the xml file, the <cssstyles> element can be used.
- BBCode encoding:
- In some cases, e.g. inside xml attributes or inside strings, some characters can't be used directly.
Here the BBCode encoding provides alternatives.
- BBCode character mapping:
- < ⇒ [ or [lt]
- > ⇒ ] or [gt]
- ' ⇒ [sq]
- " ⇒ [dq]
- [ ⇒ [[
- ] ⇒ ]]
- Escaping:
- As alternative to the BBCode-encoding, it is also possible to
escape
the html code.
- Load the content from <data> or other elements:
- Linking to krpano actions:
|
Attribute name | Type | Default value |
rawhtml | Boolean | false |
- When enabled the content of the text setting will be used directly as html code for the textfield content.
No parsing or modifications will be applied. No BBCode encoding, no escaping.
No default font, font-size, text-color.
- These settings will also have no effect when enabled: padding, txtshadow.
|
Attribute name | Type | Default value |
css | String | "" |
|
Attribute name | Type | Default value |
txtshadow |
String |
"" |
|
Attribute name | Type | Default value |
textalign | String | "lefttop" |
- Alignment of the text/content within the textfield.
- Possible values: lefttop, left, leftbottom, top, center, bottom, righttop, right, rightbottom.
|
Attribute name | Type | Default value |
padding | String | "2" |
- Padding / space in pixels around the text/content. Can be individually for each side.
- There are 4 different ways to set the paddings (same as in CSS):
- padding="25"
- all four paddings are 25px
- padding="25 50"
- top and bottom paddings are 25px
- right and left paddings are 50px
- padding="25 50 75"
- top padding is 25px
- right and left paddings are 50px
- bottom padding is 75px
- padding="25 50 75 100"
- top padding is 25px
- right padding is 50px
- bottom padding is 75px
- left padding is 100px
|
Attribute name | Type | Default value |
wordwrap | Boolean | true |
- Set if the text should automatically wrap around (line-break) to new lines when the text doesn't fit into the current line.
- This setting has only an effect when setting a width for the textfield.
- When disabled the text would get cut-off when it is larger than the given textfield width.
|
Attribute name | Type | Default value |
ellipsis | Boolean | false |
- When the text/content is larger than the given textfield width and line-breaking is not allowed or possible,
then the text will end with three dots '...' instead of a hard-cut.
|
Attribute name | Type | Default value |
interactive | Boolean | false * |
- When enabled a direct mouse/touch interaction with the textfield content is possible.
- By default this is disabled to avoid conflicts when krpano and a html inner content are both processing the mouse or touch events.
- Note - when the html content contains <a> or <iframe> elements, then this setting will be automatically enabled!
|
Attribute name | Type | Default value |
selectable | Boolean | false |
- Should the text/content be selectable by the user.
- When enabled the browsers native/default contextmenu will appear when right-clicking (or long-touching) on the textfield.
- Note - the selectable setting overrides the nativecontextmenu setting!
|
Attribute name | Type | Default value |
editable | Boolean | false |
- Should the text/content be editable by the user.
- When enabled the user can click into the textfield and edit it.
- To get informed about editing changes there are these events:
- The edited content will be stored in the text variable.
- Note that the edited content can be slightly different in each browser.
- For dynamically starting or stopping editing these actions can be called:
|
Attribute name | Type | Default value |
editenterkey | String | "stop" |
- Define what should happen when the user presses the Enter-key during editing:
- stop - Stop/finish the editing (default).
- newline - create a line-break / new-line.
- shiftnewline - create a line-break / new-line when only pressing the Shift+Enter keys, otherwise stop the editing.
|
Attribute name (only for WebGL-Hotspots usage) | Type | Default value |
oversampling |
Number |
1.0 |
- Upscale the internal bitmap rendering target by the given oversampling factor for a higher-resolution (sharper) text.
- Settings larger 1.0 are improving the text-rendering-quality, but also requiring more memory- and rendering-resources.
- Only related for WebGL hotspot rendering.
|
Attribute name (only for WebGL-Hotspots usage) | Type | Default value |
mipmapping |
Boolean |
false |
- Enable mipmapping - this reduces aliasing effects when displaying the text as scaled-down element.
- Mipmapping works by automatically upscaling the internal bitmap rendering target to the next power-of-two size (because that is required for mipmapping).
- For better image/text-quality it would be recommended to use additionally also a higher than 1.0 oversampling setting.
- Only related for WebGL hotspot rendering.
|