Help the wiki!

The Scratch Wiki is made by and for Scratchers. Do you want to contribute?

Learn more about joining as an editor!

See discussions in the Community Portal

Pen

Pen Blocks.

The Pen is a feature in Scratch that allows a Sprite to draw shapes and such on the screen with the Pen Blocks.

Lines, dots, rectangles, and circles are the easiest shapes to draw, but with enough scripting, any shape can be created.

Blocks Related to the Pen

Main article: Pen Blocks

Flash Player Glitches

The Flash Player appears to set a maximum pen size. This is due to the Flash Player using one byte of data to store the pen size. There are 256 possible outcomes of one byte (28 values encoded in 8 binary bits), so the Flash Player most likely uses the 256 possible outcomes to each stand for a pen size from 0-255.

The Flash Player also has a bug where the pen size "1" does not paint the entire pixel. If the pen size is set to 1 and used in Scratch to paint every pixel, a solid region will be formed. However, with the Flash Player, a translucent region will be formed as only part of each pixel will be colored. To avoid this, set the pen size to "2" if you want it to be one pixel on the Flash Player.

However, this glitch can be helpful if one wants to draw transparent regions on the flash player. It would take a long time to draw the transparent figure pixel by pixel even with turbo speed, so a sprite using the ghost Graphic Effect would be more effective.

Also, when Flash Player is drawing with the pen using medium or low quality, very low pen sizes are not drawn at all. To change your quality in the flash player:

  1. Right-click (for P.C.) or Ctrl-click (for Mac) the project
  2. Click on Quality
  3. Choose desired quality

Uses

The pen blocks are often used to:

  • Make Snake style games
  • Make a trail behind a sprite
  • Animating
  • Drawing objects in one sprite, one script projects
  • Drawing patterns
  • Creating graphs
  • Program graphics editors
  • 3D projects
  • This page was last modified on 18 April 2014, at 01:37.