Terrapin Resources

Turtles

Extends: TURTLE > BITMAP > WIDGET

The TURTLE widget offers a few properties in addition to the WIDGET and BITMAP objects.


ALPHA

Part of: TURTLE

Controls the transparency of the colors the turtle uses to draw.

Syntax

GPROP turtle "ALPHA
PPROP turtle "ALPHA value

Description

ALPHA gets or sets the alpha value that the turtle uses to draw with colors that do not have a specific alpha value, like color names, color indexes, or color lists with only three elements. When drawing, the turtle adds this value to any three-element color. A value of 1 makes the color opaque, and a value of 0 makes it completely transparent (invisible).

Examples

PPROP 0 “ALPHA 0.5 SETPC “YELLOW (STAMPOVAL 100 100 TRUE)


PATTERN

Part of: TURTLE

Reports or sets the current fill pattern.

Syntax

GPROP turtle "PATTERN
PPROP turtle "PATTERN value

Description

PATTERN contains the pattern that a turtle uses to fill shapes. This may be a value, an 8-element list, or the name of a bitmap whose black-and-white representation is used to fill an area. See the SETPATTERN command for details. Note that the FILL command does not use patterns, only solid colors.

Examples

GPROP 0 “PATTERN Result: 0


PENCOLOR

Part of: TURTLE

Contains the current pen color.

Syntax

GPROP 0 "PENCOLOR
PPROP 0 "PENCOLOR value

Description

PENCOLOR contains the current pen color as a four-element list.

The commands PC and SETPC access this property.

Examples

GPROP 0 “PENCOLOR


PENSTATE

Part of: TURTLE

Controls the turtle’s pen state.

Syntax

GPROP 0 "PENSTATE
PPROP 0 "PENSTATE state

Description

PENSTATE controls the state of the turtle pen, one of the words PENDOWN, PENUP, PENERASE, or PENREVERSE.

Examples

GPROP 0 “PENSTATE Result: PENDOWN


PENWIDTH

Part of: TURTLE

Gets or sets the turtle’s pen width.

Syntax

GPROP turtle "PENWIDTH
GPROP turtle "PENWIDTH width

Description

PENWIDTH gets or sets the size of the turtle pen in pixels.

The commands WIDTH and SETWIDTH access this property.

Examples

GPROP 0 “PENWIDTH Result: 1


SHAPE

Part of: TURTLE

Gets or sets the turtle’s shape.

Syntax

GPROP turtle "SHAPE
PPROP turtle "SHAPE objectname

Description

The turtle’s shape is the name of another object (usually a bitmap or a bitmap file) that is used to represent the turtle. Setting the SHAPE property to the empty word sets the standard turtle shape.

If the LOADSHAPE command loaded the shape, the property value is the name of the file what was loaded. The widget with that name does not need to exist. For shapes that were loaded with a Web URL, SHAPE reports this URL instead of the file name.

Examples

GPROP 0 “SHAPE