Changes

Jump to navigation Jump to search
Line 539: Line 539:  
==Programmable Brick==
 
==Programmable Brick==
   −
The following feature is only available in versions 44+ of Turtle Art.
+
The following feature—a block that can be programmed by the Pippy activity—is available in versions 44+ of Turtle Art.
   −
 
+
A copy of the tamyblock.py module is stored in the Journal when you first launch Turtle Art. You can edit the module in Pippy and then import your custom code into Turtle Art using the Pippy button on the Activity toolbar.
And a block that can be programmed by the Pippy interface:
  −
 
  −
A copy of the tamyblock.py module is stored in the Journal when you first launch Turtle Art. You can edit the module in Pippy and then import your custom code into Turtle Art using the Pippy button.
      
[[Image:TAPippyButton.svg]]
 
[[Image:TAPippyButton.svg]]
Line 550: Line 547:  
[[Image:TA-pippy.png|300px]]
 
[[Image:TA-pippy.png|300px]]
   −
To use the customized block, select the "view source" block from the Extras palette.
+
To use the customized block, select the "Pippy" block found on the the Extras palette.
    
Examples:
 
Examples:
 +
 +
[[Image:TA-dotted-line.png]]
 +
 
  def myblock(lc, x):
 
  def myblock(lc, x):
 
     ###########################################################################
 
     ###########################################################################
Line 577: Line 577:  
     return
 
     return
   −
[[Image:TA-dotted-line.png]]
+
You can pass a list of up to three arguments to tamyblock.py as in the example below that converts the input to an rgb value.
   −
You can pass a list of up to three arguments to tamyblock.py as in this example that converts the input to an rgb value.
+
[[Image:TA-rgb.png]]
    
  def myblock(lc, x):
 
  def myblock(lc, x):
Line 605: Line 605:  
     lc.tw.fgcolor = lc.tw.cm.alloc_color(rgb)
 
     lc.tw.fgcolor = lc.tw.cm.alloc_color(rgb)
 
     return
 
     return
  −
[[Image:TA-rgb.png]]
  −
      
  def myblock(lc, x):
 
  def myblock(lc, x):

Navigation menu