Primitives |
Arguments |
Use |
showturtle, st |
none |
Makes the turtle visible on the screen. |
hideturtle, ht |
none |
Makes the turtle invisible on the screen. |
clearscreen, cs |
none |
Empties the drawing area. |
wash |
none |
Erases the drawing area but leaves the turtle in the same place. |
resetall |
none |
Initialize the XLogo interface to standard values (PenColor: black, ScreenColor:white, Animation mode: disabled, Text and Graphics Font: Dialog 12 pts, pen shape: square, Drawing quality: normal, turtles allowed: 16, mode trace: disabled, screen size [1000 1000]) and empties the drawing area. |
pendown, pd |
none |
The turtle will draw a line when it moves. |
penup, pu |
none |
The turtle will not draw a line when it moves. |
penerase, pe |
none |
The turtle will rub out any marks that it meets. |
penreverse, px |
none |
Lower the pen and put the turtle in inverted mode. |
penpaint, ppt |
none |
Lower the pen and put the turtle in classic drawing mode. |
setpencolor, setpc |
a: whole number or list [r g b] |
Sets the pen color. See p.. |
setscreencolor, setsc |
a: whole number or list [r g b] |
Sets the screen color. See p.. |
pos, position |
none |
Gives the current position of the turtle.Eg: pos returns [10 -100] |
heading |
none |
Gives the bearing or heading of the turtle (cf setheading) |
towards |
a: list |
The list must contain two numbers representing co-ordinates. Gives the heading which the turtle must follow to go towards the point defined by the co-ordinates in the list. |
distance |
a: list |
The list must contain two numbers representing co-ordinates. Gives the number of steps between the current position and the point defined by the co-ordinates in the list. |
pencolor, pc |
a: list |
Gives the current colour of the pen. This colour is specified by a list [r g b] where r is the red component, b the blue and g the green. |
screencolor, sc |
a: list |
Gives the current colour of the screen (background). This colour is specified by a list [r g b] where r is the red component, b the blue and g the green. |
window |
none |
The turtle can travel outside the drawing area (but of course, it cannot draw there). |
wrap |
none |
If the turtle leaves the drawing area, it will reappear on the opposite side! |
fence |
none |
The turtle is confined to the drawing area. If it is about to go outside, an error message will let you know, and give you the maximum number of steps the turtle can move before the exit point is reached (to within 1 or 2 steps ...). |
perspective |
None |
The turtle can move through 3d Space. (See Special Section for this mode). To quit this mode, Use one of these primitives window, wrap or fence |
findcolor,fc |
a: list |
Returns to the colour of the a coordinates pixel. This color is determined thanks to a [r g b] list where r is red, g is green and b is blue. |
setpenwidth, setpw |
n: number |
Defines the thickness of the pen nib in pixels. The default is 1. The pen has a square nib. (Other shapes will be provided in future versions.) |
penwidth, pw |
none |
Returns the thickness of the pen nib in pixels. |
setPenShape, setps |
0 or 1 |
set the pen shape. 0square. 1oval |
penshape, ps |
none |
returns the pen shape. 0square. 1oval |
setdq, setDrawingQuality |
0 or 1 or 2 |
set the drawing Quality 0normal. 1high. 2Low |
dq, DrawingQuality |
none |
returns the drawing Quality 0normal. 1high. 2Low |
setscreensize |
[width height] |
Set the screen size to the dimension contained in the list. setscreensize [1000 1000] |
screensize |
list |
Returns the current screen size in a list. setscreensize [1000 1000] |
setshape |
n: number |
You can choose your preferred turtle with the second tab of menu Options-Preferences.... But you can choose your favourite turtle with setshape. The number n goes from 0 to 6. (0 is the triangular shape). |
shape |
none |
Returns the number that represents the shape of the turtle. |
setfontsize, setfs |
n: number |
When you write on the screen with the primitive label, it's possible to modify the size of the font with setfontsize. The size of the font is 12 by default. |
fontsize |
none |
Returns the size of the font when you write on the screen with the primitive label. |
setfn, setfontname |
n: number |
Select the font number when you write on the screen with the primitive label. You can find the link between number and font in MenuOptionsvPreferencesTab Font. |
fontname |
none |
Returns a list with two elements. The first is the number corresponding to the font used when you write on the screen with the primitive label. The last element is a list which contains the name of the font. |
setseparation, setsep |
a: number |
Determines the ratio between the graphic screen and the history zone. The number a must be included between 0 and 1. When a equals 1 the drawing zone uses all the space, when a equals 0, the history zone uses all the window. |
separation, sep |
none |
Provides the current ratio between the drawing zone and the history zone. |
grid |
a, b integer |
Draw a grid. Each square has dimension a and b. |
stopgrid |
none |
Erase grid. |
setgridcolor |
Color |
Allow the user to choose a custom color for the grid. Eg: setgridcolor red |
gridcolor |
none |
Return current grid color. |
grid? |
none |
Return true if the grid is drawn, else return false. |
axis |
n: integer |
Draw horizontal and vertical axis. The distance between two divisions is steps. |
xaxis |
n: integer |
Draw only horizontal axis. The distance between two divisions is steps. |
yaxis |
n: integer |
Draw only vertical axis. The distance between two divisions is steps. |
stopaxis |
none |
Erase both axis. |
setaxiscolor |
Color |
Allow the user to choose a custom color for the axis. Eg: setaxiscolor green |
axiscolor |
none |
Return current axis color. |
xaxis? |
none |
Return true if the horizontal axis is drawn, else return false. |
yaxis? |
none |
Return true if the vertical axis is drawn, else return false. |
zoom |
a |
Zoom on the drawing screen. In fact, the number a represents the scale regarding to the original image size fixed in the preference panel. |
zonesize |
none |
Returns a list which contains four numbers. These integers are the coordinates of the left upper corner of the drawing zone and the coordinates for the right bottom corner. |
message, msg |
a: list |
Shows the message in list in a dialog box, the program stops until the user has clicked the button "OK" |