<doc>
  <legacy_id>1766</legacy_id>
  <name>brush</name>
  <type>property</type>
  <syntax>
    <example>set the brush to {<i>brushID </i>| <i>imageID</i>}</example>
  </syntax>
  <library></library>
  <objects>
    <global/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Developing with LiveCode</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <property tag="spray">spray Property</property>
    <keyword tag="brush">brush Keyword</keyword>
    <property tag="eraser">eraser 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 shape used for painting with the Brush <function tag="tool">tool</function>.</summary>
  <examples>
    <example>set the brush to 13</example>
    <example>set the brush to the short ID of image "My Custom Brush"</example>
  </examples>
  <description>
    <p>Use the <b>brush</b> <glossary tag="property">property</glossary> to specify which shape is painted by the Brush <function tag="tool">tool</function>.</p><p/><p><b>Value:</b></p><p>The <b>brush</b> is a brush specifier.</p><p/><p>A <i>brushID</i> is a built-in brush number between 1 and 35. (These brushes correspond to LiveCode's built-in patterns 101 to 135.)</p><p/><p>An <i>imageID</i> is the ID of an <keyword tag="image">image</keyword> to use for painting with the brush. 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>brush</b> is set to 8 (a round brush).</p><p/><p><b>Comments:</b></p><p>The entire area of the brush cursor is used as the brush shape. The shape painted by the brush is drawn in the <b>brushColor</b>, regardless of what colors might be in the <keyword tag="image">image</keyword> used for the brush shape.</p><p/><p>When the Brush tool is in use, the cursor is the same as the brush shape. You can use any size image as a brush, but the cursor may appear distorted on some systems if the image is not 16x16 pixels.</p><p/><p><code/><b>Note:</b><code/> In order to use a brush, you must choose the Brush <function tag="tool">tool</function> using either the Paint Tools palette or the <command tag="choose">choose</command> <glossary tag="command">command</glossary>.</p><p/><p>If you want to change the <b>brush</b> <glossary tag="property">property</glossary> in a <glossary tag="standalone application">standalone application</glossary>--for example, to let the user paint in <glossary tag="image">images</glossary>--you must copy the <object tag="stack">stack</object> "revCompatibilityBrushes1" into your application before you build the <glossary tag="standalone application">standalone</glossary>. (This <object tag="stack">stack</object> includes the cursors used for the brush <function tag="tool">tool</function>.) To copy the stack, enter the following into the <keyword tag="message box">message box</keyword> or a <glossary tag="handler">handler</glossary>:</p><p/><p><code>  clone stack "revCompatibilityBrushes1"</code></p><p><code>  set the mainStack of this stack to "My Main Stack"</code></p><p><code>  </code><code><i>-- (substitute your application's main stack name</i></code></p><p/><p>A copy of "revCompatibilityBrushes1" is now a substack of your main stack, and will be saved in the stack file the next time you save the main stack.</p><p/><p><code/><img src="202651"/> <b>Tip:</b><code/> If you want to create your own brush cursors, clone the "revCompatibilityBrushes1" <object tag="stack">stack</object> and change the <glossary tag="image">images</glossary> in it to the desired shapes. Make sure to include the <object tag="stack">stack</object> when you build the <glossary tag="standalone application">standalone</glossary>.</p>
  </description>
</doc>