remove "pen trails" library

because it is now a primitive
upd4.1
Jens Mönig 2017-08-30 10:04:42 +02:00
rodzic b633844894
commit 5a8a655aa6
2 zmienionych plików z 0 dodań i 2 usunięć

Wyświetl plik

@ -8,7 +8,6 @@ word-sentence.xml Words, sentences One of the big ideas in Logo that they left o
cases.xml Multi-branched conditional (switch) Like "switch" in C-like languages or "cond" in Lisp. Thanks to Nathan Dinsmore for inventing the idea of a separate block for each branch!
leap-library.xml LEAP Motion controller Report hand positions from LEAP Motion controller (leapmotion.com).
setrgb.xml Set RGB or HSV pen color Set or report pen color as RGB (red, blue, green) or HSV (hue, saturation, value).
penTrails.xml Save and restore pictures drawn by pen Save and restore lines drawn and costumes stamped on the stage, or make a sprite costume from saved pen trails.
try-catch.xml Catch errors in a script Run a script; if an error happens, instead of stopping the script with a red halo, run another script to handle the error. Also includes a block to cause an error with a message given as input. Also includes a block to create a script variable and give it a value.
multiline.xml Allow multi-line text input to a block In general, text inputs allow only a single line. The MULTILINE block accepts multi-line text input and can be used in text input slots of other blocks.
Eisenbergification.xml Provide getters and setters for all GUI-controlled global settings Eisenberg's Law: Anything that can be done from the GUI should be doable from the programming language, and vice versa.

Wyświetl plik

@ -1 +0,0 @@
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="label %&apos;text&apos; of size %&apos;size&apos;" type="command" category="pen"><comment x="0" y="0" w="90" collapsed="false">LABEL will stamp text on the stage at the given font size. The direction of the text is the direction the sprite is facing, and color will match the pen color.</comment><header></header><code></code><inputs><input type="%txt">Hello!</input><input type="%n">12</input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>text</l><l>size</l></list><l>var stage = this.parentThatIsA(StageMorph),&#xD; context = stage.penTrails().getContext(&apos;2d&apos;),&#xD; rotation = radians(this.direction() - 90),&#xD; trans = new Point(&#xD; this.center().x - stage.left(),&#xD; this.center().y - stage.top()&#xD; ),&#xD; isWarped = this.Warped,&#xD; len,&#xD; pos;&#xD;&#xD;if (isWarped) {endWarp(); }&#xD;context.save();&#xD;context.font = size + &apos;px monospace&apos;;&#xD;context.textAlign = &apos;left&apos;;&#xD;context.textBaseline = &apos;alphabetic&apos;;&#xD;context.fillStyle = this.color.toString();&#xD;len = context.measureText(text).width;&#xD;trans = trans.multiplyBy(1 / stage.scale);&#xD;context.translate(trans.x, trans.y);&#xD;context.rotate(rotation);&#xD;context.fillText(text, 0, 0);&#xD;context.translate(-trans.x, -trans.y);&#xD;context.restore();&#xD;pos = new Point(&#xD; len * Math.sin(radians(this.direction())),&#xD; len * Math.cos(radians(this.direction())));&#xD;pos = pos.add(new Point(this.xPosition(), this.yPosition()));&#xD;this.gotoXY(pos.x, pos.y, false);&#xD;this.changed();&#xD;if (isWarped) {this.startWarp(); }&#xD;stage.changed();</l></block><list><block var="text"/><block var="size"/></list></block></script></block-definition><block-definition s="button %&apos;text&apos;" type="command" category="pen"><comment x="0" y="0" w="176" collapsed="false">Make a new sprite, have it run this block to turn into a button. This will clear anything drawn on the stage.</comment><header></header><code></code><inputs><input type="%s">Push me!</input></inputs><script><block s="clear"></block><block s="up"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="setHeading"><l>90</l></block><block s="setColor"><color>3,0,0,1</color></block><custom-block s="label %txt of size %n"><block var="text"/><l>30</l></custom-block><block s="doDeclareVariables"><list><l>width</l></list></block><block s="doSetVar"><l>width</l><block s="xPosition"></block></block><block s="gotoXY"><l>0</l><l>10</l></block><block s="setColor"><color>251,255,13,1</color></block><block s="setSize"><l>30</l></block><block s="down"></block><block s="forward"><block var="width"/></block><block s="up"></block><block s="setSize"><l>1</l></block><block s="setColor"><color>3,0,0,1</color></block><block s="gotoXY"><l>0</l><l>0</l></block><custom-block s="label %txt of size %n"><block var="text"/><l>30</l></custom-block><custom-block s="make costume named %s from pen trail %s"><block var="text"/><custom-block s="pen trails"></custom-block></custom-block><block s="gotoXY"><l>0</l><l>0</l></block><block s="clear"></block></script></block-definition><block-definition s="pen trails" type="reporter" category="pen"><header></header><code></code><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list></list><l>var cst = new Costume(&#xD; this.parentThatIsA(StageMorph).trailsCanvas&#xD;);&#xD;cst.shrinkWrap();&#xD;return cst;</l></block><list></list></block></block></script></block-definition><block-definition s="set pen trails to: %&apos;costume&apos;" type="command" category="pen"><header></header><code></code><inputs><input type="%s" readonly="true"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>cst</l></list><l>var stage = this.parentThatIsA(StageMorph);&#xD;stage.trailsCanvas = cst.contents;&#xD;stage.changed();</l></block><list><block var="costume"/></list></block></script></block-definition><block-definition s="make costume named %&apos;name&apos; from pen trail %&apos;trail&apos;" type="command" category="looks"><header></header><code></code><inputs><input type="%s">pen trail</input><input type="%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>name</l><l>trail</l></list><l>trail.name = this.newCostumeName(name, null);&#xD;this.addCostume(trail);&#xD;this.wearCostume(trail);</l></block><list><block var="name"/><block var="trail"/></list></block></script></block-definition></blocks>