User Guide
Ruby Component
Focus Scales
By default the centre colour is focused at the centre point. However, you can change the focus size around this point by using the
setFocusScales method.
setFocusScales scaleX, scaleY
The method takes two scale factors. These are applied to the path that defines the brush and the resulting shape defines the area that is
filled with the centre colour. Scale factors of 1.0 will make the whole shape the focus colour so most of the time the scale factors you use will
be less than 1.0.
Here's an example that shows how this works. Here we have increased the size of the focus point and stretched it a bit more vertically than
horizontally.
Transformations
You can rotate, translate or scale a PathGradientBrush after it has been created. To do this you use the following methods:
rotateTransform angle
translateTransform x, y
scaleTransform sf-x, sf-y
resetTransform
The rotation method takes an angle in Degrees. The translate method takes x and y offsets. The scale method takes x and y scale factors –
these are floats with 1.0 meaning no change. The resetTransform method does exactly what it says, it resets any applied transforms.
Hatch Brushes
A HatchBrush is is used for filling an area with a hatched or stipple effect. It s defined by a hatch style, a foreground colour and an optional
background colour. You can create an instance as follows:
b = HatchBrush.new style, foregroundCol, backgroundCol
If you don't supply a background colour then the background will be left transparent and all you will get is the hatching. For the style you
have 53 different options. This can be specified as an integer (in the range 0-52) or a text string.
The hatch styles are shown below (in increasing order left to right, top to bottom):
137 of 212