Tool BRUSH

From RealWorld Wiki

Revision as of 16:59, 18 May 2008 by WikiSysop (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

BRUSH is a drawing tool that places a pattern image to the canvas as the tip of the brush is moving over the canvas. The placed pattern has configurable shape, size and sharpness. It can be drawn with various intensities. Under normal condition the effect appears as a freehand curve drawn with a pencil or brush. If tablet with pen pressure is installed, the properties of the pattern can be controlled by pen pressure.

[edit] Scripting parameters

BRUSH tool can be used from scripts. The command in script must have the following arguments:

  • shape - one of "ROUND", "SQUARE", "DIAGONAL".
  • size - diameter or bounding box of the pattern in pixels.
  • size_pressure (optional) - must be set to "NP" (normal pressure) or not used at all. If used, the pressure parameter in coords array will be used to control size.
  • blur - controls how sharp of soft are the edges of the pattern in range 0-1.
  • blur_pressure (optional) - must be set to "NP" or not used at all.
  • flow - intensity used when drawing the pattern in range 0-1.
  • flow_pressure (optional) - must be set to "NP" or not used at all.
  • coords - at least 2 pairs of [X, Y] coordinates or triplets of [X, Y, pressure] if at least one of the brush parameters reacts to pressure. The pressure parameter will be clamped to <0.05, 1> range (which means you can draw only a single stroke with one command).

[edit] Example

DrawTool.BRUSH(Document, "ROUND", 12, "NP", 0.1, 1,
               50, 50, 0.1, 100, 100, 1, 150, 50, 1, 200, 100, 0.1);
Personal tools