Please enable JavaScript to view this site.

ESL Documentation

Pattern Reference

Reference a previously defined pattern in a drawing statement.

[[color] COLOR]

[scale [by|to] NUMERATOR:DENOMINATOR]

[rotate [by|to] DEGREES]

pattern PATTERN_NAME

color COLOR

A string value, integer value, or color keyword representing an ESL color. Draws, in the specified color, all the drawing statements in the pattern that do not already have a specified color. This attribute overrides any color specifications that otherwise would affect these drawing statements. If you do not specify a color, the pattern will be drawn in the color specified in the object definition, or in any other action statement that affects the color of this drawing statement.

scale NUMERATOR:DENOMINATOR

Enlarge or shrink the pattern by or to the ratio specified by the NUMERATOR and DENOMINATOR, which must be integer values representing a scale ratio. ESL determines the scale factor by dividing the NUMERATOR by the DENOMINATOR. If the scale factor is less than one, the pattern is shrunk. If the scale factor is greater than one, the pattern is enlarged.

rotate DEGREES

Rotate the pattern by or to the specified integer value representing the number of degrees. Both the original pattern and the rotated pattern originate from the pattern's reference point. A pattern is always drawn beginning at that point, regardless of the specified rotation. If the DEGREES value is positive, the pattern is rotated counterclockwise. If it is negative, the pattern is rotated clockwise.

If the pattern is an ellipse, ESL rotates the ellipse to the nearest 90 degrees.

DEGREES

An integer value representing the number of degrees by or to which you want to rotate the pattern.

PATTERN_NAME

The identifier for a pattern.

Description

A pattern reference is a drawing statement. Once a pattern has been defined, it can be referenced anywhere in the program that a drawing statement can be specified, except that it cannot be part of the boundary specification of a shape drawing statement. A pattern definition can contain any number of pattern references, but it cannot reference itself.

Scaling

The scale factor is calculated by dividing the ratio's numerator by its denominator. Both the original pattern and the scaled pattern originate at the pattern's reference point. A pattern is always drawn from that point, regardless of the scale factor.

If the pattern contains text, ESL moves the graphics cursor and the text cursor as specified by the scale specification, and the cursor positions dictate the starting position of the text string. The text itself is not scaled, except, TrueType fonts.

The scalings specified for a pattern are cumulative when patterns are nested. The specified scaling is relative to any scaling currently in effect for the pattern.

Rotating

If the pattern contains text, ESL moves the graphics cursor and the text cursor as specified by the rotate specification, and the cursor positions dictate the starting position of the text string. The text itself is not rotated; it is always displayed horizontally, from left to right.

Avoid rotating a pattern that contains a box statement unless the pattern is rotated in 90-degree increments. Otherwise, rotating a box may cause unpredictable results.

The rotations specified for a pattern are cumulative when patterns are nested. The specified rotations are relative to any rotation currently in effect for the pattern.

Example

region Hedge at position 20 20 size 100 100

rotate 180 pattern Bush

response to SelectTree

add to Hedge

color "red" pattern Tree

key Several at position 50 50

blue scale 2:1 pattern Display

See Also

pattern is Pattern Definition