Slow down turtle graphics rendering?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Slow down turtle graphics rendering?

R.D. Latimer
Etoys renders very fast, which is good. But is there a way to slow down the graphic rendering so students could see it unfold?
I have a simple spinSquare project:

drawSquare script
  repeat 4: forward 150 turn 90

spinSquare script
  repeat 36: drawSquare turn 10


I only need to run the script once, with the ! , I'm not using the clock timer to continually display.

The design pattern of the spinning squares happens instantaneously. Can I slow this rendering somehow? like with an internal 'wait' or 'pause' for a fraction of a second.

Thanks,
Randy Latimer



_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Slow down turtle graphics rendering?

Steve Thomas
Well you could create your own scripting tiles (sort of) similar to the way Bert did in his Squeakfest talk (highly recommend).

Attached is a simple version.  The following steps were used to create it:
  1. Get a rectangle from the supplies bin and size it to scripting tile size (you can adjust later)
  2. Open the rectangles viewer and add two variables:
    1. myPlayer (click on menu icon next to variable name and click on "change value type" and set to "Player")
    2. myValue
  3. Get a "simple watcher" for you myPlayer variable and embed it in the rectangle from step 1
    1. Two ways to embed:
      1. Method 1:
        1. From the Rectangle halo, click on the menu item and check "accept drops" (be sure to uncheck when done)
        2. drag the watcher onto the Rectangle
      2. Method 2:
        1. Drag the watcher over the Rectangle
        2. Get the watcher's halo and from the menu select "embed" then select "Rectangle"
  4. Embed some text in your Rectangle ("Forward By" or "Turn By)
  5. Embed a "simple watcher" for myValue in the Rectangle
  6. Create a script for the rectangle that moves [myPlayer | forward by | myValue] to do this not obvious thing:
    1. drag out a forward by tile which will create a script.
    2. Then from the viewer drag the "Rectangle's|myPlayer" tile over the word "Rectangle" in the scripting tile you created in the previous step.  Notice anything?
    3. Then from the viewer drag the "Rectangle's|myvalue" tile over the 5 in the scripting tile,
    4. Name this script "action"
  7. Do the same for to create a turn tile
  8. Then drag these two tiles into a holder
  9. Create a script for the holder to:
    1. Increase cursor by 1
    2. Holder's|player at cursor - do - action (get the do tile from the holder's scripting category)
  10. You can then set the "tick rate" in the script to say 0.5 or whatever value you want.
I should probably create a short Etoy's minute on this, but for now watch Bert's video, it's longer but worth the watch.

Stephen

On Mon, Oct 17, 2011 at 6:18 AM, R.D. Latimer <[hidden email]> wrote:
Etoys renders very fast, which is good. But is there a way to slow down the graphic rendering so students could see it unfold?
I have a simple spinSquare project:

drawSquare script
  repeat 4: forward 150 turn 90

spinSquare script
  repeat 36: drawSquare turn 10


I only need to run the script once, with the ! , I'm not using the clock timer to continually display.

The design pattern of the spinning squares happens instantaneously. Can I slow this rendering somehow? like with an internal 'wait' or 'pause' for a fraction of a second.

Thanks,
Randy Latimer



_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland



_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland

AnimateTiles.001.pr (160K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Slow down turtle graphics rendering?

K K Subbu
In reply to this post by R.D. Latimer
On Monday 17 Oct 2011 3:48:58 PM R.D. Latimer wrote:
> The design pattern of the spinning squares happens instantaneously. Can I
> slow this rendering somehow? like with an internal 'wait' or 'pause' for a
> fraction of a second.
Click and hold on the 'clock' icon. You will get a menu to choose tick rate
for the script.

You can also use the step button in go/step/stop controls from the Supplies
bin to tick all scripts manually.

HTH .. Subbu
_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland