Referencia › Tracks — 43 comandos


appendtrack

tracks

Entrada: "turtlea (word) | "turtleb (word)
Salida: none

Appends "turtlea's track (its movements and graphics) to the end of "turtleb's track. See copytrack

appendtrack "myrtle "bob

begintag

tracks

Entrada: name (word)
Salida: none

Begins a 'tag', that is a grouping of movements, turtle parameter changes and shapes present in the calling turtle's 'track', or output. The tag is closed with endtag. If there is an open tag when begintag is called, it closes the previous tag. These tagged groups can be used for creating turtle models using newmodel, can be hidden or shown using hidetag or showtag, or copied using copytag. If a tag already exists, begintag will throw an error. See endtag

begintag "newtag

clean

tracks

Entrada: none
Salida: none

Erases the 'turtle track' (graphics) belonging to the current turtle without changing its position or state. Useful when a turtle is not actually drawing graphics but is itself a graphic element (for example, in a game) to ensure that its movements don't build up in its track and slow down execution. To use clean in this context, simply place it at the end of the turtle's "run loop".

clean

cleanspace

tracks

Entrada: none
Salida: none

Cleans all turtles in the current space. See clean

cleanspace

clearallfrozen

tracks

Entrada: none
Salida: none

Erases all of the non-system turtles' frozen tracks, or all frozen tracks in all turtles if called by a system turtle.

clearfrozen

clearfrozen

tracks

Entrada: none
Salida: none

Erases all of the calling turtle's frozen tracks.

clearfrozen

clearscreen

También: cs

tracks

Entrada: none
Salida: none

Clears the turtle's 'turtle track' and sends the turtle to its home position unless there is a checkpoint in the track, in which case track items created after the checkpoint are removed and the turtle returns to the checkpoint. Any opened tags removed by the clearscreen are closed. See checkpoint

clearscreen

clonetag

tracks

Entrada: sourcetagname (word) | copytagname (word)
Salida: none

Clones a turtle's tag and puts the new copy at the end of its 'turtle track'. See tag

clonetag "oldtag "newtag

copytag

tracks

Entrada: tag (word) | turtle (word)
Salida: none

Copies a tag from the calling turtle to the named turtle, at the end of the named turtle's turtle track.

copytag "tag "turtle

copytrack

tracks

Entrada: "turtlea (word) | "turtleb (word)
Salida: none

Copies "turtlea's track (its movements and graphics) to "turtleb, overwriting "turtleb's existing track. See appendtrack

copytrack "myrtle "bob

csall

tracks

Entrada: none
Salida: none

Causes all turtles to clear their turtle tracks and return to their starting positions.

csall

endtag

tracks

Entrada: none
Salida: none

Closes the currently open tag. See tag

endtag

erasefrozen

tracks

Entrada: name (word)
Salida: none

Erases the frozen track of the given name. See freeze, thaw

erasefrozen "frozentrack

erasetag

tracks

Entrada: tag (word)
Salida: none

Erases the named tag and its contents.

erasetag "mytag

freeze

tracks

Entrada: name (word)
Salida: none

'Freezes' the calling turtle's track with the given name, and then switches to a new 'empty' turtle track, keeping the frozen track visible. Note that frozen tracks are unaffected by reset, clearscreen and need to be erased using thaw, erasefrozen or clearfrozen. If the parameter provided to freeze is given in the form of a single-item list, freeze will overwrite an existing frozen track, otherwise it will throw an error. See thaw, hidefrozen, showfrozen, listfrozen, frozen, erasefrozen and clearfrozen

freeze "mytrack

frozen

tracks

Entrada: none
Salida: list

Returns a list of the calling turtle's frozen track. See freeze, thaw.

show frozen

hidefrozen

tracks

Entrada: word
Salida: none

Hides the specified frozen track. See freeze, thaw, showfrozen

hidefrozen "frozentrack

hidetag

tracks

Entrada: tagname (word)
Salida: none

Hides the specified tag from displaying. Be aware that this can alter the display of the rest of the turtle track, as the position of the turtle may be altered by the absence of the tag contents from rendering! To solve this problem, call 'setposition position' after calling 'endtag' when closing a tag. Then, when you hide the tag, the turtle will still end up in the place it lands when the tag is visible, and the remainder of the turtle track rendering will not be disrupted.

hidetag "mytag

hidetrack

tracks

Entrada: none
Salida: none

Hides the calling turtle's 'turtle track' or visible output. Make it visible again with showtrack.

hidetrack

listfrozen

tracks

Entrada: none
Salida: none

Lists the calling turtle's frozen tracks. See freeze, thaw, showfrozen, frozen

listfrozen

listtags

tracks

Entrada: none
Salida: none

Prints the calling turtle's currently defined tags, one per line. See tags

listtags

loadtag

tracks

Entrada: tagname (word) | tagfile (word)
Salida: none

Loads the contents of the specified file into the specified tagname. loadtag creates a new tag at the end of the turtletrack if the tagname does not already exist. See savetag

loadtag "mytag "tagfile

loadtrack

tracks

Entrada: filename (word) or |url| (web)
Salida: none

Loads the saved turtle track, replacing the current turtle track. See savetrack

loadtrack "turtletrack

merge

tracks

Entrada: none
Salida: none

Causes the turtle track of a hatchling to merge with its parent at the start of the parents turtle track. The hatchling's turtle track is empty after the merge. See hatch

merge

notrack

tracks

Entrada: none
Salida: none

Causes the calling turtle not to generate a track and erases any existing track without changing the turtle's position, after which any shape and graphics primitives are ignored. See track

notrack

notrackrender

tracks

Entrada: none
Salida: none

Stops the calling turtle's 'track' render from updating. Its current buffered render will continue to be displayed. This is handy for complex scene creation – you can choose to reveal parts of the scene as they are created. See trackrender, hidetrack, showtrack, render, norender

notrackrender

replacetag

tracks

Entrada: name (word) | list
Salida: none

Replaces the contents of the named tag with the contents of the provided list of turtle primitives.

replacetag "mytag [FD 20 RT 90 FD 20 RT 90]

savetag

tracks

Entrada: tagname (word) | tagfile (word)
Salida: none

Saves the contents of the specified tag to the specified filename. See loadtag

savetag "mytag "tagfile

savetrack

tracks

Entrada: filename
Salida: none

Saves the calling turtle's 'turtle track' to a file.

savetrack

showfrozen

tracks

Entrada: word
Salida: none

Shows the specified frozen track. See freeze, thaw, hidefrozen

showfrozen "frozentrack

showtag

tracks

Entrada: tag (word)
Salida: none

Shows (makes visible) the specified tag. See tag

showtag "mytag

showtrack

tracks

Entrada: none
Salida: none

Shows the calling turtles 'turtle track' or visible output. See hidetrack

showtrack

switchtag

tracks

Entrada: tag1 (word) | tag2 (word)
Salida: none

Hides tag1 and shows tag2, like flipping a switch. See tag

switchtag "tag1 "tag2

synctrackrender

tracks

Entrada: turtles (list)
Salida: none

Resumes rendering the tracks of all the named turtles simultaneously. Useful when animating to avoid desynchronization. See trackrender, notrackrender.

synctrackrender [myrtle shelly]

tag

tracks

Entrada: name (word)
Salida: list

Returns the contents of a tag, as a list of turtle primitives. See begintag

show tag "mytag

tags

tracks

Entrada: none
Salida: list

Returns a list of the current turtle's defined tags.

show tags

thaw

tracks

Entrada: name (word)
Salida: none

Restores the named frozen turtle track, placing the turtle at its end. If the current track is not frozen before thawing, it is discarded. See freeze, hidefrozen, showfrozen, listfrozen, frozen, erasefrozen, clearfrozen

thaw "mytrack

tracks

tracks

Entrada: none
Salida: none

Allows the calling turtle's track to be created. See notrack

tracks

trackcount

tracks

Entrada: none
Salida: number

Returns the number of items in the current turtle's track.

show trackcount

track

tracks

Entrada: none
Salida: none

Re-enables track generation for the calling turtle. See notrack, which turns it off, storing only the turtle's state (position, etc.)

track

trackitem

tracks

Entrada: number
Salida: list

Returns the number last track item in the selected turtle's track, where 1 returns the latest track entry

show trackitem 1

tracklist

tracks

Entrada: number
Salida: list

Returns the last number latest track items in forward chronological order, the first being the oldest and the last being the newest and most recent.

show tracklist 5

trackrender

tracks

Entrada: none
Salida: none

Causes the calling turtle's 'track' to be rendered (updated) by the graphics renderer from the point it is called onwards. See notrackrender

trackrender