Share via


Small Basic Reference Documentation: Turtle Object

Small Basic: Reference Documentation > Turtle

 

http://www.smallbasic.com/img/object_32.png

Turtle

The Turtle provides Logo-like functionality to draw shapes by manipulating the properties of a pen and drawing primitives.

Properties

http://www.smallbasic.com/img/property_16.png Speed

Turtle.Speed

Specifies how fast the turtle should move. Valid values are 1 to 10. If Speed is set to 10, the turtle moves and rotates instantly.

http://www.smallbasic.com/img/property_16.png Angle

Turtle.Angle

Gets or sets the current angle of the turtle. While setting, this will turn the turtle instantly to the new angle.

http://www.smallbasic.com/img/property_16.png X

Turtle.X

Gets or sets the X location of the Turtle. While setting, this will move the turtle instantly to the new location.

http://www.smallbasic.com/img/property_16.png Y

Turtle.Y

Gets or sets the Y location of the Turtle. While setting, this will move the turtle instantly to the new location.

Operations

http://www.smallbasic.com/img/method_16.png Show

Turtle.Show()

Shows the Turtle to enable interactions with it.

Returns

Nothing

http://www.smallbasic.com/img/method_16.png Hide

Turtle.Hide()

Hides the Turtle and disables interactions with it.

Returns

Nothing

http://www.smallbasic.com/img/method_16.png PenDown

Turtle.PenDown()

Sets the pen down to enable the turtle to draw as it moves.

Returns

Nothing

http://www.smallbasic.com/img/method_16.png PenUp

Turtle.PenUp()

Lifts the pen up to stop drawing as the turtle moves.

Returns

Nothing

http://www.smallbasic.com/img/method_16.png Move

Turtle.Move(distance)

Moves the turtle to a specified distance. If the pen is down, it will draw a line as it moves.

distance

The distance to move the turtle.

Returns

Nothing

http://www.smallbasic.com/img/method_16.png MoveTo

Turtle.MoveTo(x, y)

Turns and moves the turtle to the specified location. If the pen is down, it will draw a line as it moves.

x

The x co-ordinate of the destination point.

y

The y co-ordinate of the destination point.

Returns

Nothing

http://www.smallbasic.com/img/method_16.png Turn

Turtle.Turn(angle)

Turns the turtle by the specified angle. Angle is in degrees and can be either positive or negative. If the angle is positive, the turtle turns to its right. If it is negative, the turtle turns to its left.

angle

The angle to turn the turtle.

Returns

Nothing

http://www.smallbasic.com/img/method_16.png TurnRight

Turtle.TurnRight()

Turns the turtle 90 degrees to the right.

Returns

Nothing

http://www.smallbasic.com/img/method_16.png TurnLeft

Turtle.TurnLeft()

Turns the turtle 90 degrees to the left.

Returns

Nothing

 

See Also