foregroundPattern

Typeproperty
DictionaryLCS
LibraryLiveCode Script
Syntax
set the foregroundPattern of <object> to {<patternNumber> | <imageID> | empty}
set the foregroundPattern of [<chunk> of] <field> to {<patternNumber> | <imageID> | empty}
Synonymsforepattern,textpattern,thumbpattern
Associationsstack, card, field, button, graphic, scrollbar, player, image, group
Summary

Specifies the pattern used for object text and borders.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
set the foregroundPattern of me to 1034
set the textPattern of line 2 of field "Cards" to 111
Values
NameTypeDescription
Value

The foregroundPattern of an object is a pattern specifier. A patternNumber is a built-in pattern number between 1 and 164. These patterns are provided for compatibility with patterns available in MetaCard and correspond to LiveCode's built in image id 137 to 300. As with MetaCard pattern numbers 105 to 114 and 146 and above are unavailable.

An imageID is the ID of an image to use for a pattern. LiveCode looks for the specified image first in the current stack, then in other open stacks.

By default, the foregroundPattern for all objects is empty.

RelatedKeyword: effective, field, image, button, card, scrollbar, player, graphic, control
Property: borderPattern, foregroundColor, pixels, bottomPattern, width, height, backgroundPattern, dashes, showName, penPattern, owner, showValue
Command: group
Function: stacks
Glossary: object, Unix, current stack, property, Windows, video clip, keyword, audio clip, chunk, insertion point, value, object type, EPS, Mac OS
Object: control, button, scrollbar, stack, field, graphic
Description

Use the foregroundPattern property to change the pattern used for text or the pattern that fills an object.

Pattern images can be color or black-and-white.

*Cross-platform note:* To be used as a pattern on Mac OS systems, an image must be 128x128 pixels or less, and both its height and width must be a power of 2. To be used on Windows and Unix systems, height and width must be divisible by 8. To be used as a fully cross-platform pattern, both an image's dimensions should be one of 8, 16, 32, 64, or 128.

The foregroundPattern of controls is drawn starting at the control's upper right corner: if the control is moved, the pattern does not shift.

Setting the foregroundPattern of an object to empty allows the foregroundPattern of the object's owner to show through. Use the effective keyword to find out what pattern is used for the object, even if its own foregroundPattern is empty.

The setting of the foregroundPattern property has different effects, depending on the object type:

*Cross-platform note:* On Mac OS and Windows systems, the foregroundPattern applies only to object borders, not to text; text cannot be drawn with a pattern, only with a color.

Tagsui