When used in a script, the sprite will produce a bitmap image of itself which is stamped onto the stage. (Because it is merely a picture of the sprite and not a sprite itself, it cannot be programmed.) Like other Pen blocks, the Stamp block will not draw over sprites. The erase all block removes all stamped images.
Pen
Extension Description
Pen Extension allows sprites to control their pens, as well as stamp themselves onto the stage and remove all pen marks.
- Available in: Block Coding, Python Coding
- Mode: Stage Mode
- WiFi Required: No
- Compatible Hardware in Block Coding: evive, Quarky, Arduino Uno, Arduino Mega, Arduino Nano, ESP32, T-Watch, Boffin, micro:bit, TECbits, LEGO EV3, LEGO Boost, LEGO WeDo 2.0, Go DFA, None
- Compatible Hardware in Python: evive, Quarky, Arduino Uno, Arduino Mega, Arduino Nano, ESP32, T-Watch, Boffin, micro:bit, TECbits, LEGO EV3, LEGO Boost, LEGO WeDo 2.0, Go DFA, None
- Object Declaration in Python: pen = Pen()
- Extension Catergory: Other
Introduction
The Pen Extension allows sprites to control their pens, as well as stamp themselves onto the stage and remove all pen marks. To use them, they must be enabled in the “Extensions” section of the editor.
Pen blocks are useful when creating a one sprite one script project, allowing the following actions to happen:
- Stamp the sprite
- Put the pen down
- Release the pen
One example of a one sprite one script project is a simple drawing program. The pen extension can also be used to make games, simulations, 3D projects, and other projects.
Read More
PictoBlox Blocks
All articles loaded
No more articles to load
Block Coding Examples
All articles loaded
No more articles to load
Python Functions
The function is used when the sprite needs to produce a bitmap image of itself which is stamped onto the stage. (Because it is merely a picture of the sprite and not a sprite itself, it cannot be programmed). The function will not draw over sprites.
Syntax: stamp()
The function removes all marks made by the pen or stamping. It is the only pen block that the Stage can use.
Syntax: clear()
The function will make its sprite continuously pen a trail wherever it moves until the up() function is used. The color, size, and transparency of the trail can be changed with other functions.
Syntax: down()
If a sprite is currently using the pen because of the down() function, the up() function will cause the sprite to stop drawing a trail. (Otherwise, it has no effect.)
Syntax: up()
The function sets the pen’s color to the given color – (R, G, B).
Syntax: setcolor(color = [0, 0 , 0])
The function changes the specified value by the number input.
Syntax: changecolor(parameter = “color”, value = 10)
The function sets the Pen Size to the given number. The pen draws a trail of circles. The diameter of the circle, in pixels, is equal to the pen size.
Syntax: setsize(size = 1)
The function changes the pen size by the specified amount.
Syntax: changesize(size = 1)
All articles loaded
No more articles to load
Python Coding Examples
All articles loaded
No more articles to load
Table of Contents