The Turtle-to-interactive-turtle step... (GooCanvas?)
Written by
on
in
Young Coders.
Been looking at how to handle the logical step from turtle-graphics to interactive programming (event handling and the like). Looks like something like GooCanvas would be a good stepping-stone there. We can fairly readily define a mapping from turtle-style drawing into GooCanvas primitives.
That is, as the turtle draws, it creates new GooCanvas Polylines for each pen-up-pen-down set. Clicking on one of the Polylines would bring up an editor that would let you write code to handle the click on that Polyline. We could extend the turtle to allow for explicitly specifying Polyline names, and allow use of higher-order primitives (rectangles, bitmaps, svg files, groupings).
Anyway, yesterday I did some work and created a goocanvas-based back-end for turtle graphics, and though it's no faster than the cairo backend in rendering, it's actually much faster in updating from "slow code" animations. Put it aside to work on the emulation and forgot to post this note yesterday...
Pingbacks
Pingbacks are closed.
Comments
Comments are closed.