Text Box: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>DonJ
No edit summary
No edit summary
 
(28 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 ===
<control>
<syntaxhighlight lang="XML" enclose="div">
      <description>My first text box control</description>
<control type="textbox" id="2">
      <type>textbox</type>
  <description>My first text box control</description>
      <id>1</id>
  <left>80</left>
      <posx>80</posx>
  <top>60</top>
      <posy>60</posy>
  <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>
  <monofont>mono30</monofont>
      <textcolor>FFFFFFFF</textcolor>
  <textcolor>FFFFFFFF</textcolor>
      <spinposx>220</spinposx>
  <pulseonselect></pulseonselect>
      <spinposy>180</spinposy>
  <pagecontrol>13</pagecontrol>
      <spinwidth>16</spinwidth>
  <scrolltime>200</scrolltime>
      <spinheight>16</spinheight>
  <autoscroll delay="3000" time="1000" repeat="10000">!Control.HasFocus(13)</autoscroll>
      <spincolor>FFFFFFFF</spincolor>
  <label>Text to display goes here [CR] next line...</label>
      <textureup>myuptexture.png</textureup>
  <align>center</align>
      <textureupfocus>myuptexture.png</textureupfocus>
      <texturedown>myuptexture.png</texturedown>
      <texturedownfocus>myuptexture.png</texturedownfocus>
      <pulseonselect></pulseonselect>
      <onup>2</onup>
      <ondown>3</ondown>
      <onleft>1</onleft>
      <onright>1</onright>
</control>
</control>
</xml>
</syntaxhighlight>
===Available Tags===
 
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" | '''description'''
{| class="prettytable"
| class="usercell" | Only used to make things clear for the skinner. Not read by XBMC at all.
! Tag !! Description
|- class="userrow"
|-  
| class="usercell" | '''type'''
| '''height'''
| class="usercell" | Should be textbox for a text box control.
| <height>auto</height> is supported in textbox controls
|- class="userrow"
|-  
| class="usercell" | '''id'''
| '''font'''
| class="usercell" | Specifies the control's id. The value this takes depends on the control type, and the window that you are using the control on. There are special control id's that must be present in each window. Any other controls that the skinner adds can be any id they like. As text box contents are filled by XBMC, this needs to be the appropriate number for the window that the control resides in.
| Font used for the items first label. From fonts.xml.
|- class="userrow"
|-  
| class="usercell" | '''posx'''
| '''textcolor'''
| class="usercell" | Specifies where the left edge of the text should be drawn. This is offset from the window's coordinates (normally the left edge of the screen, or 0).
| Color used for displaying the text. In AARRGGBB hex format, or a name from the [[Colour themes|colour theme.]]
|- class="userrow"
|-  
| class="usercell" | '''posy'''
| '''shadowcolor'''
| class="usercell" | Specifies where the top edge of the text should be drawn. This is offset from the window's coordinates (normally the top edge of the screen, or 0).
| Specifies the color of the drop shadow on the text. In AARRGGBB format, or a name from the [[Colour themes|colour theme.]]
|- class="userrow"
|-  
| class="usercell" | '''width'''
| '''pagecontrol'''
| class="usercell" | Specifies the total width of the text.
| 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]].
|- class="userrow"
|-  
| class="usercell" | '''height'''
| '''scrolltime'''
| class="usercell" | Specifies the total height of the text.
| 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.
|- class="userrow"
|-  
| class="usercell" | '''visible'''
| '''align'''
| class="usercell" |
| possible values for text alignment: left, right, center, justify
Specifies a condition as to when this control will be visible. Can be true, false, or a condition. [[Conditional Visibility|See here for more information.]] Defaults to true.
|-  
|- class="userrow"
| '''autoscroll'''
| class="usercell" | '''animation'''
| 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.
| class="usercell" |
|-  
Specifies the animation to be run when the control enters a particular state. [[Animating Your Skin|See here for more information.]]
| '''monofont'''
|- class="userrow"
| Monotype font. For use in the TextViewer dialog only.
| class="usercell" | '''font'''
| class="usercell" | Font used for the items first label. From fonts.xml.
|- class="userrow"
| class="usercell" | '''textcolor'''
| class="usercell" | Color used for displaying the text. In AARRGGBB hex format.
|- class="userrow"
| class="usercell" | '''shadowcolor'''
| class="usercell" | Specifies the color of the drop shadow on the text, in AARRGGBB format.
|- class="userrow"
| class="usercell" | '''spinposx'''
| class="usercell" | The horizontal position of the spin control for multipage textboxes. This is offset from the top left of the textbox.
|- class="userrow"
| class="usercell" | '''spinposy'''
| class="usercell" | The vertical position of the spin control for multipage textboxes. This is offset from the top left of the textbox.
|- class="userrow"
| class="usercell" | '''spinwidth'''
| class="usercell" | The width of one of the spin control buttons. The textures for this spin control will be scaled to fit this width.
|- class="userrow"
| class="usercell" | '''spinheight'''
| class="usercell" | The height of one of the spin control buttons. The textures for this spin control will be scaled to fit this height.
|- class="userrow"
| class="usercell" | '''spincolor'''
| class="usercell" | The colour of the text used for this spin control. In AARRGGBB hex format.
|- class="userrow"
| class="usercell" | '''textureup'''
| class="usercell" | The up button texture for the spin control.
|- class="userrow"
| class="usercell" | '''textureupfocus'''
| class="usercell" | The up button texture for the spin control when it's focused.
|- class="userrow"
| class="usercell" | '''texturedown'''
| class="usercell" | The down button texture for the spin control.
|- class="userrow"
| class="usercell" | '''texturedownfocus'''
| class="usercell" | The down button texture for the spin control when it's focused.
|- class="userrow"
| class="usercell" | '''pulseonselect'''
| class="usercell" | Specifies whether the spinbutton should pulse when it's selected. Defaults to true.
|- class="userrow"
| class="usercell" | '''onup'''
| class="usercell" | Control id to move to when the user moves up off this control.
|- class="userrow"
| class="usercell" | '''ondown'''
| class="usercell" | Control id to move to when the user moves down off this control.
|- class="userrow"
| class="usercell" | '''onleft'''
| class="usercell" | Control id to move to when the user moves left off this control.
|- class="userrow"
| class="usercell" | '''onright'''
| class="usercell" | Control id to move to when the user moves right off this control.
|}
|}
[[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: