(unilaterally confirmed merge)
(merged)
 
Line 1: Line 1:
{{merge|Pen Extension|Merge|date=February 2019}}
+
#REDIRECT[[Pen Extension]]
In [[Scratch 2.0]], '''Pen Blocks''' was one of the ten [[categories]] of [[Blocks|Scratch blocks]]. They were color-coded dark-green, and were used to control the pen aspect of the Scratch Program.
 
 
 
There were 11 [[Stack Block]]s in this category.
 
 
 
According to the [[Scratch Statistics]], this was the least used category, with only over 2,000 uses.
 
 
 
Pen [[blocks]] are useful when creating a [[1s1s|one sprite one script]] [[project]], allowing one to take various actions:
 
*Stamp the sprite
 
*Put the pen down
 
*Release the pen
 
One example of a one sprite one script project is a simple drawing program.
 
 
 
Pen Blocks can also used to make Games and Simulations, as well as other things.
 
 
 
== In Scratch 3.0 ==
 
{{main|Pen Extension}}
 
In [[Scratch 3.0]] the Pen Blocks are an extension.<ref>https://github.com/LLK/scratch-vm/issues/734</ref> [[Set Pen Shade to () (block)|<sb>set pen shade to (50)</sb>]], [[Set Pen Color to () (number input block)|<sb>set pen color to (0)</sb>]] and a new block called "Set Pen Transparency to ()" are one block. Older blocks are hidden, but the legacy opcodes are kept in order to preserve backwards compatibility.<ref>https://github.com/LLK/scratch-vm/issues/735</ref>
 
 
 
== Blocks ==
 
{{note|Click on a block to learn more about it!}}
 
[[Scratch 2.0]] has the following 11 Pen Stack blocks:
 
 
 
* [[Clear (block)|<sb>clear</sb>]]
 
* [[Stamp (block)|<sb>stamp</sb>]]
 
* [[Pen Down (block)|<sb>pen down</sb>]]
 
* [[Pen Up (block)|<sb>pen up</sb>]]
 
* [[Set Pen Color to () (color input block)|<sb>set pen color to [#F3A533]</sb>]]
 
* [[Change Pen Color by () (block)|<sb>change pen color by (10)</sb>]]
 
* [[Set Pen Color to () (number input block)|<sb>set pen color to (0)</sb>]]
 
* [[Change Pen Shade by () (block)|<sb>change pen shade by (10)</sb>]]
 
* [[Set Pen Shade to () (block)|<sb>set pen shade to (50)</sb>]]
 
* [[Change Pen Size by () (block)|<sb>change pen size by (1)</sb>]]
 
* [[Set Pen Size to () (block)|<sb>set pen size to (1)</sb>]]
 
 
 
The pre-alpha of Scratch 2.0 from [[Scratch Day#Scratch Day MIT 2011|Scratch Day @ MIT 2011]] additionally had the following Pen Stack block:
 
* [[Stamp Transparent () (block)|<sb>stamp transparent () :: pen</sb>]]
 
 
 
== Suggested Pen Blocks ==
 
<scratchblocks>
 
<pen down?:: pen>
 
(pen color:: pen)
 
(pen shade:: pen)
 
(pen size:: pen)
 
switch to canvas: [canvas1 v] ::pen //allows switching to a particular canvas for editing
 
 
 
clear [canvas1 v] ::pen //clears selected canvas (also includes options all and current)
 
 
 
show canvas [canvas1 v] ::pen //would display selected canvas (also includes options all and current)
 
 
 
hide canvas [canvas1 v] ::pen //would stop displaying selected canvas (also includes options all and current)
 
 
 
bring [canvas1 v] to front ::pen //would shift the selected canvas to the front(also includes options current)
 
 
 
move [canvas1 v] to layer (1 v) ::pen //would reorder the canvases (also includes options current)
 
</scratchblocks>
 
 
 
These are wanted by many Scratchers, as they would make programming much easier.<ref>[[ar-topic:118]]</ref> The first would return the Boolean value of ''true'' if the pen is down. The second would return the pen color value; the third, the pen shade value; the last, the pen size value. Some [[Scratch Modification]]s have at least one of these.{{citation needed|date=November 2017}} Workarounds are possible by maintaining variables to that keep up with these values and updating them whenever the pen state/color/size/shade are changed, possibly by leaving a separate script running that alters the pen when the variables are changed, and only modify the variables in other scripts instead of changing the pen attributes directly. Pen canvases would be independent from each other allowing them to be modified without affecting the others.<ref>[[topic:234935]]</ref>
 
 
 
 
 
==References==
 
<references />
 
 
 
{{Pen Blocks}}
 
<div style="height:13px;"></div>
 
{{Block Categories}}
 
 
 
[[Category:Block Types]]
 
[[Category:Main Block Types]]
 
[[Category:Pen Blocks]]
 
[[de:Blockfarbe dunkelgrün = Malstift-Blöcke]]
 
[[nl:Pen]]
 
[[fr:Scratch Wiki Accueil/les blocs/stylo]]
 
[[ja:ペンブロック]]
 

Latest revision as of 12:19, 3 March 2019

Redirect to:

Cookies help us deliver our services. By using our services, you agree to our use of cookies.