Livecode Wiki

Specifies the shape used for painting with the Brush tool.


set the brush to {<brushID> | <imageID>}


set the brush to 13
set the brush to the short ID of image "My Custom Brush"

Use the brush property to specify which shape is painted by the Brush tool.

The brush is a brush specifier.

The brush tools

A is a built-in brush number between 1 and 36. (These brushes correspond to LiveCode's built-in patterns 101 to 136.)

The entire area of the brush cursor is used as the brush shape. The shape painted by the brush is drawn in the brushColor, regardless of what colors might be in the image used for the brush shape.

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.

In order to use a brush, you must choose the Brush tool using either the Paint Tools palette or the choose command.

If you want to change the brush property in a standalone application (for example, to let the user paint in images) you must copy the stack "revCompatibilityBrushes1" into your application before you build the standalone. (This stack includes the cursors used for the brush tool.) To copy the stack, enter the following into the message box or a handler :

clone stack "revCompatibilityBrushes1"
set the mainStack of this stack to "My Main Stack" -- (substitute your application's main stack name)

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.

Tip: If you want to create your own brush cursors, clone the "revCompatibilityBrushes1" stack and change the images in it to the desired shapes. Make sure to include the stack when you build the standalone.

See also: stack (object),image (object),spray (property),eraser (property),