You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this and I think we might want to get a headstart on how we're going to do pen rather than just shoving it under the "far-future" label and calling it a day.
So Pen in Scratch works like this:
Wherever the sprite goes, a pen trail is left behind
The pen is global (I believe), and so are its attributes (color, size, etc.)
The blocks "pen down" and "pen up" control if the pen draws or not
I'm thinking that we could implement this by giving each sprite its own Surface to store its pen drawings on, and the blit function could automatically blit them to the main Surface.
@BookOwl Once we get some more problems worked out.
I'd like to get #36 complete before anything else, since that seems to be the easiest thing. #9 is also somewhat important, as rotation plays a big role in some pen projects.
The first one (with the color input can), but the rest don't actually work on RGB colors, they work on HSL colors. Luckily, Python comes built in with a module to convert between RGB and HSL.
sprite.clear() # Clears the sprites pen drawingsslither.clearAll() # Clears all the pen drawings in every spritesprite.penUp() # Pulls the pen upsprite.penDown()
sprite.penColor=color# Would set the pen color to the given Color objectsprite.penColor# Returns the pen colorsprite.penSize=float# Sets the pen sizesprite.penSize# Returns the pen sizesprite.stamp() # Stamps the sprite
Color objects would have the following API:
c=Color(127, 127, 127) # Default is RGBc=Color( 0.0, 0.4980392156862745, 0.0, type="hsl") # You can also create an HSL colorc.r, c.g, c.b# The RGB components of the colorc.h, c.s, c.l# The HSL components of the color
Activity
Tymewalk commentedon Mar 24, 2016
It would, although I think this would be far future.
Tymewalk commentedon Mar 25, 2016
I noticed this and I think we might want to get a headstart on how we're going to do pen rather than just shoving it under the "far-future" label and calling it a day.
So Pen in Scratch works like this:
Did I make any mistakes?
BookOwl commentedon Mar 28, 2016
Point 2 is wrong, every sprite's pen has it's own attributes.
BookOwl commentedon Mar 30, 2016
I'm thinking that we could implement this by giving each sprite its own Surface to store its pen drawings on, and the blit function could automatically blit them to the main Surface.
@Tymewalk, should I start working on this?
Tymewalk commentedon Mar 30, 2016
@BookOwl Once we get some more problems worked out.
I'd like to get #36 complete before anything else, since that seems to be the easiest thing.
#9 is also somewhat important, as rotation plays a big role in some pen projects.
8 remaining items
BookOwl commentedon Jun 6, 2016
I think that this needs to be in 0.4
Tymewalk commentedon Jun 6, 2016
@BookOwl That's a good idea.
BookOwl commentedon Jun 10, 2016
Since #69 was merged, I'll start working on this.
BookOwl commentedon Sep 14, 2016
These are the pen blocks that we need to add to Slither

Tymewalk commentedon Sep 14, 2016
What does "pen shade" do?
Also, the "change pen color" block can be removed, and the "set pen color" blocks can be merged into one:
setPenColor((R,G,B)).BookOwl commentedon Sep 14, 2016
I think that it's how "bright" the color is.
Tymewalk commentedon Sep 15, 2016
Ah, I see.
Either way, all those pen color changing blocks can be replaced by
setPenColorand pen RGB values (penR,penG,penB?)BookOwl commentedon Sep 15, 2016
The first one (with the color input can), but the rest don't actually work on RGB colors, they work on HSL colors. Luckily, Python comes built in with a module to convert between RGB and HSL.
BookOwl commentedon Sep 15, 2016
I think that this would be a good API:
Color objects would have the following API:
Tymewalk commentedon Sep 19, 2016
@BookOwl Sounds great, although shouldn't it be
hsvinstead ofhsl?Also, I thought of how we can blit pen objects - those with a higher z-index get put above, just like sprites, so it's ordered like this:
Or we could do all pen then all sprites.
Tymewalk commentedon Oct 30, 2016
Scratch uses all pen then all sprites, so if a user really wants to draw pen above a sprite they can just stamp.
This leaves one design question - do sprites affect a global Stage pen, or have their own personal pen areas?
AFAIK Scratch runs off of just one pen surface in the Stage.