<doc>
  <legacy_id>1810</legacy_id>
  <name>foregroundPattern</name>
  <type>property</type>
  <syntax>
    <example>set the foregroundPattern of <i>object</i> to {<i>patternNumber</i> |<i> imageID</i> | empty}</example>
    <example>set the foregroundPattern of [<i>chunk</i> of] <i>field</i> to {<i>patternNumber</i> |<i> imageID</i> | empty}</example>
  </syntax>
  <library></library>
  <objects>
    <stack/>
    <card/>
    <group/>
    <field/>
    <button/>
    <graphic/>
    <scrollbar/>
    <player/>
    <image/>
  </objects>
  <synonyms>
    <synonym>forePattern</synonym>
    <synonym>textPattern</synonym>
    <synonym>thumbPattern</synonym>
  </synonyms>
  <classification>
    <category>Appearance  Positioning</category>
  </classification>
  <references>
    <property tag="penPattern">penPattern Property</property>
    <property tag="foregroundColor">foregroundColor Property</property>
    <property tag="bottomPattern">bottomPattern Property</property>
    <property tag="backgroundPattern">backgroundPattern Property</property>
    <property tag="borderPattern">borderPattern Property</property>
    <property tag="dashes">dashes Property</property>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Specifies the pattern used for <glossary tag="object">object</glossary> text and borders.</summary>
  <examples>
    <example>set the foregroundPattern of me to 1034</example>
    <example>set the textPattern of line 2 of field "Cards" to 111</example>
  </examples>
  <description>
    <p>Use the <b>foregroundPattern</b> <glossary tag="property">property</glossary> to change the pattern used for text or the pattern that fills an <glossary tag="object">object</glossary>.</p><p/><p><b>Value:</b></p><p>The <b>foregroundPattern</b> of an <glossary tag="object">object</glossary> is a pattern specifier.</p><p>A <i>patternNumber</i> is a built-in pattern number between 1 and 164. (These patterns correspond to LiveCode's built-in patterns 136 to 300.)</p><p/><p>An <i>imageID</i> is the ID of an <keyword tag="image">image</keyword> to use for a pattern. LiveCode looks for the specified <keyword tag="image">image</keyword> first in the <glossary tag="current stack">current stack</glossary>, then in other open <function tag="stacks">stacks</function>.</p><p/><p>By default, the <b>foregroundPattern</b> for all <glossary tag="object">objects</glossary> is empty.</p><p/><p><b>Comments:</b></p><p>Pattern images can be color or black-and-white.</p><p/><p><img src="202652"/> <b>Cross-platform note:</b> To be used as a pattern on <glossary tag="Mac OS">Mac OS systems</glossary>, an <keyword tag="image">image</keyword> must be 128x128 <property tag="pixels">pixels</property> or less, and both its <property tag="height">height</property> and <property tag="width">width</property> must be a power of 2. To be used on <function tag="openStacks">Windows</function> and <glossary tag="Unix">Unix systems</glossary>, <property tag="height">height</property> and <property tag="width">width</property> must be divisible by 8. To be used as a fully cross-platform pattern, both an image's dimensions should be one of 8, 16, 32, 64, or 128.</p><p/><p>The <b>foregroundPattern</b> of <glossary tag="control">controls</glossary> is drawn starting at the <glossary tag="control">control's</glossary> upper right corner: if the <keyword tag="control">control</keyword> is moved, the pattern does not shift.</p><p/><p>Setting the <b>foregroundPattern</b> of an <glossary tag="object">object</glossary> to empty allows the <b>foregroundPattern</b> of the <glossary tag="object">object's</glossary> <property tag="owner">owner</property> to show through. Use the <keyword tag="effective">effective</keyword> <glossary tag="keyword">keyword</glossary> to find out what pattern is used for the <glossary tag="object">object</glossary>, even if its own <b>foregroundPattern</b> is empty.</p><p/><p>The setting of the <b>foregroundPattern</b> <glossary tag="property">property</glossary> has different effects, depending on the <glossary tag="object type">object type</glossary>:</p><p>* The <b>foregroundPattern</b> of a <object tag="stack">stack</object>, <keyword tag="card">card</keyword>, or <command tag="group">group</command> determines the <b>foregroundPattern</b> of each <glossary tag="object">object</glossary> in the <object tag="stack">stack</object>, <keyword tag="card">card</keyword>, or <command tag="group">group</command> that does not have its own <b>foregroundPattern</b>.</p><p/><p>* On Unix systems, the <b>foregroundPattern</b> of a <keyword tag="button">button</keyword> is used for the text of the <keyword tag="button">button</keyword>. If the <glossary tag="button">button's</glossary> <property tag="showName">showName</property> <glossary tag="property">property</glossary> is false, the <b>foregroundPattern</b> has no effect.</p><p/><p>* On Unix systems, the <b>foregroundPattern</b> of a <keyword tag="field">field</keyword> determines the color of the <glossary tag="field">field's</glossary> text. If you set the <property tag="foregroundColor">foregroundColor</property> of a <glossary tag="chunk">chunk</glossary> of a <keyword tag="field">field</keyword>, only that <glossary tag="chunk">chunk</glossary> is affected. The <b>foregroundPattern</b> also determines the color of the blinking <glossary tag="insertion point">insertion point</glossary> when it is in the <keyword tag="field">field</keyword>.</p><p/><p>* On Unix systems, the <b>foregroundPattern</b> of a <keyword tag="scrollbar">scrollbar</keyword> determines the pattern of the text used to show the <function tag="value">value</function> of the <glossary tag="scrollbar">scrollbar's</glossary> current position. If the <glossary tag="scrollbar">scrollbar's</glossary> <property tag="showValue">showValue</property> <glossary tag="property">property</glossary> is false, the <b>foregroundPattern</b> has no effect.</p><p/><p>* The <b>foregroundPattern</b> of a <keyword tag="graphic">graphic</keyword> determines the pattern used for the <glossary tag="graphic">graphic's</glossary> outline. (The <property tag="borderPattern">borderPattern</property> determines the pattern used for the <glossary tag="graphic">graphic's</glossary> border, which is outside the outline.)</p><p/><p>* The <b>foregroundPattern</b> of a <keyword tag="player">player</keyword>, <keyword tag="image">image</keyword>, <glossary tag="audio clip">audio clip</glossary>, <glossary tag="video clip">video clip</glossary>, or <glossary tag="EPS">EPS object</glossary> has no effect.</p><p>If an object's <b>foregroundPattern</b> is set, the pattern is shown instead of the color specified by <property tag="foregroundColor">foregroundColor</property>.</p><p/><p><img src="202652"/> <b>Cross-platform note:</b> On <glossary tag="Mac OS">Mac OS</glossary> and <glossary tag="Windows">Windows systems</glossary>, the <b>foregroundPattern</b> applies only to <glossary tag="object">object</glossary> borders, not to text; text cannot be drawn with a pattern, only with a color.</p>
  </description>
</doc>