Skip to content

Pen #23

Open
Open

Description

@BookOwl

Pen support would be awesome!

Activity

  1. Tymewalk commented on Mar 24, 2016

    @Tymewalk
    Member

    It would, although I think this would be far future.

  2. Tymewalk commented on Mar 25, 2016

    @Tymewalk
    Member

    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
    • "clear" removes all the pen in the project

    Did I make any mistakes?

  3. BookOwl commented on Mar 28, 2016

    @BookOwl
    MemberAuthor

    Point 2 is wrong, every sprite's pen has it's own attributes.

  4. BookOwl commented on Mar 30, 2016

    @BookOwl
    MemberAuthor

    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?

  5. Tymewalk commented on Mar 30, 2016

    @Tymewalk
    Member

    @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.

  6. self-assigned this
    on Mar 30, 2016
  7. 8 remaining items

  8. modified the milestones: v0.4.0, v1.0.0 on Jun 6, 2016
  9. BookOwl commented on Jun 6, 2016

    @BookOwl
    MemberAuthor

    I think that this needs to be in 0.4

  10. Tymewalk commented on Jun 6, 2016

    @Tymewalk
    Member

    @BookOwl That's a good idea.

  11. BookOwl commented on Jun 10, 2016

    @BookOwl
    MemberAuthor

    Since #69 was merged, I'll start working on this.

  12. BookOwl commented on Sep 14, 2016

    @BookOwl
    MemberAuthor

    These are the pen blocks that we need to add to Slither
    capture

  13. Tymewalk commented on Sep 14, 2016

    @Tymewalk
    Member

    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)).

  14. BookOwl commented on Sep 14, 2016

    @BookOwl
    MemberAuthor

    I think that it's how "bright" the color is.

  15. Tymewalk commented on Sep 15, 2016

    @Tymewalk
    Member

    Ah, I see.

    Either way, all those pen color changing blocks can be replaced by setPenColor and pen RGB values (penR, penG, penB?)

  16. BookOwl commented on Sep 15, 2016

    @BookOwl
    MemberAuthor

    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.

  17. BookOwl commented on Sep 15, 2016

    @BookOwl
    MemberAuthor

    I think that this would be a good API:

    sprite.clear() # Clears the sprites pen drawings
    slither.clearAll() # Clears all the pen drawings in every sprite
    sprite.penUp() # Pulls the pen up
    sprite.penDown()
    sprite.penColor = color # Would set the pen color to the given Color object
    sprite.penColor # Returns the pen color
    sprite.penSize = float # Sets the pen size
    sprite.penSize # Returns the pen size
    sprite.stamp() # Stamps the sprite

    Color objects would have the following API:

    c = Color(127, 127, 127) # Default is RGB
    c = Color( 0.0, 0.4980392156862745, 0.0, type="hsl") # You can also create an HSL color
    c.r, c.g, c.b # The RGB components of the color
    c.h, c.s, c.l # The HSL components of the color
  18. Tymewalk commented on Sep 19, 2016

    @Tymewalk
    Member

    @BookOwl Sounds great, although shouldn't it be hsv instead of hsl?

    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:

    Sprite A is above Sprite B
    Sprite A
    Pen of Sprite A
    Sprite B
    Pen of Sprite B
    

    Or we could do all pen then all sprites.

  19. Tymewalk commented on Oct 30, 2016

    @Tymewalk
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions