Text Box: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Jmarshall
No edit summary
No edit summary
 
(25 intermediate revisions by 9 users not shown)
Line 1: Line 1:
The text box is used for showing a large multipage piece of text in XBMC. You can choose the position, size, and look of the text.
<section begin="main content" />
===Example===
The text box is used for showing a large multipage piece of text in Kodi. You can choose the position, size, and look of the text.
<xml>
=== Example ===
<syntaxhighlight lang="XML" enclose="div">
<control type="textbox" id="2">
<control type="textbox" id="2">
      <description>My first text box control</description>
  <description>My first text box control</description>
      <posx>80</posx>
  <left>80</left>
      <posy>60</posy>
  <top>60</top>
      <width>250</width>
  <width>250</width>
      <height>200</height>
  <height>200</height>
      <visible>true</visible>
  <visible>true</visible>
      <colordiffuse>FFFFFFFF</colordiffuse>
  <colordiffuse>FFFFFFFF</colordiffuse>
      <font>font13</font>
  <font>font13</font>
      <textcolor>FFFFFFFF</textcolor>
  <monofont>mono30</monofont>
      <pulseonselect></pulseonselect>
  <textcolor>FFFFFFFF</textcolor>
      <pagecontrol>13</pagecontrol>
  <pulseonselect></pulseonselect>
      <autoscroll delay="3000" time="1000">!Control.HasFocus(13)</autoscroll>
  <pagecontrol>13</pagecontrol>
  <scrolltime>200</scrolltime>
  <autoscroll delay="3000" time="1000" repeat="10000">!Control.HasFocus(13)</autoscroll>
  <label>Text to display goes here [CR] next line...</label>
  <align>center</align>
</control>
</control>
</xml>
</syntaxhighlight>
===Available Tags===
 
In addition to the [[Default Control Tags]] the following tags are available. Note that each tag is '''lower case''' only. This is important, as xml tags are case-sensitive.
=== Available tags ===
{| class="dtable"
In addition to the [[Default Control Tags]] the following tags are available. Note that each tag is '''lower case''' only. This is important, as xml tags are case-sensitive.
|- class="userrow"
 
| class="usercell" | '''font'''
{| class="prettytable"
| class="usercell" | Font used for the items first label. From fonts.xml.
! Tag !! Description
|- class="userrow"
|-  
| class="usercell" | '''textcolor'''
| '''height'''
| class="usercell" | Color used for displaying the text. In AARRGGBB hex format, or a name from the [[Colour Themes|colour theme.]]
| <height>auto</height> is supported in textbox controls
|- class="userrow"
|-
| class="usercell" | '''shadowcolor'''
| '''font'''
| class="usercell" | Specifies the color of the drop shadow on the text. In AARRGGBB format, or a name from the [[Colour Themes|colour theme.]]
| Font used for the items first label. From fonts.xml.
|- class="userrow"
|-  
| class="usercell" | '''pagecontrol'''
| '''textcolor'''
| class="usercell" | Specifies the <id> of the page control used to control this textbox. The page control can either be a [[Spin Control]] or a [[Scroll Bar Control]].
| Color used for displaying the text. In AARRGGBB hex format, or a name from the [[Colour themes|colour theme.]]
|- class="userrow"
|-  
| class="usercell" | '''autoscroll'''
| '''shadowcolor'''
| class="usercell" | Specifies the timing and conditions of any autoscrolling this textbox should have. Times are in milliseconds. The content is delayed for the given delay, then scrolls at a rate of one line per time interval until the end. It does not wrap or reset to the top at the end of the scroll. You can use any [[List of Boolean Conditions|bool condition]] to specify when autoscrolling should be allowed.
| Specifies the color of the drop shadow on the text. In AARRGGBB format, or a name from the [[Colour themes|colour theme.]]
|-  
| '''pagecontrol'''
| Specifies the <id> of the page control used to control this textbox. The page control can either be a [[Spin Control]] or a [[Scroll Bar Control]].
|-  
| '''scrolltime'''
|  The time (in ms) to scroll from one item to another.  By default, this is 200ms.  The list will scroll smoothly from one item to another as needed. Set it to zero to disable the smooth scrolling.
|-
|  '''align'''
|  possible values for text alignment: left, right, center, justify
|-
| '''autoscroll'''
| Specifies the timing and conditions of any autoscrolling this textbox should have. Times are in milliseconds. The content is delayed for the given delay, then scrolls at a rate of one line per time interval until the end. If the repeat tag is present, it then delays for the repeat time, fades out over 1 second, and repeats. It does not wrap or reset to the top at the end of the scroll. You can use any [[List of Boolean Conditions|bool condition]] to specify when autoscrolling should be allowed.
|-
| '''monofont'''
| Monotype font. For use in the TextViewer dialog only.
|}
|}
[[category:Skin Development]]
 
<section end="main content" />
 
== See also ==
'''Development:'''
* [[Add-on development]]
* [[Skinning]]
 
[[Category:Skin development]]

Latest revision as of 00:56, 13 July 2020

The text box is used for showing a large multipage piece of text in Kodi. You can choose the position, size, and look of the text.

Example

<control type="textbox" id="2">
   <description>My first text box control</description>
   <left>80</left>
   <top>60</top>
   <width>250</width>
   <height>200</height>
   <visible>true</visible>
   <colordiffuse>FFFFFFFF</colordiffuse>
   <font>font13</font>
   <monofont>mono30</monofont>
   <textcolor>FFFFFFFF</textcolor>
   <pulseonselect></pulseonselect>
   <pagecontrol>13</pagecontrol>
   <scrolltime>200</scrolltime>
   <autoscroll delay="3000" time="1000" repeat="10000">!Control.HasFocus(13)</autoscroll>
   <label>Text to display goes here [CR] next line...</label>
   <align>center</align>
</control>

Available tags

In addition to the Default Control Tags the following tags are available. Note that each tag is lower case only. This is important, as xml tags are case-sensitive.

Tag Description
height <height>auto</height> is supported in textbox controls
font Font used for the items first label. From fonts.xml.
textcolor Color used for displaying the text. In AARRGGBB hex format, or a name from the colour theme.
shadowcolor Specifies the color of the drop shadow on the text. In AARRGGBB format, or a name from the colour theme.
pagecontrol Specifies the <id> of the page control used to control this textbox. The page control can either be a Spin Control or a Scroll Bar Control.
scrolltime The time (in ms) to scroll from one item to another. By default, this is 200ms. The list will scroll smoothly from one item to another as needed. Set it to zero to disable the smooth scrolling.
align possible values for text alignment: left, right, center, justify
autoscroll Specifies the timing and conditions of any autoscrolling this textbox should have. Times are in milliseconds. The content is delayed for the given delay, then scrolls at a rate of one line per time interval until the end. If the repeat tag is present, it then delays for the repeat time, fades out over 1 second, and repeats. It does not wrap or reset to the top at the end of the scroll. You can use any bool condition to specify when autoscrolling should be allowed.
monofont Monotype font. For use in the TextViewer dialog only.


See also

Development: