Skip to content

Adding dashed lines #3016

@lorenzo-lipparini

Description

@lorenzo-lipparini

Nature of issue?

  • New feature request

Most appropriate sub-area of p5.js?

  • Core/Environment/Rendering

New feature details:

This issue is about adding a new lineDash() function to p5.

There are a few things that might be worth discussing about the API:

  • The lineDash() function might take an array as its only argument (as in the native CanvasRenderingContext2D.setLineDash() function), or it might use rest parameters instead
  • The lineDash() function might be chainable, or it might return the current line dash settings (as other functions in p5 like frameRate()); in the second case, it would make sense to call it with no arguments just to get the settings
  • A noLineDash() function used to go back to solid lines (equivalent to calling lineDash([])) might be a good addition, since it would probably make the API more clear
  • Since there is no native support for dashed lines in WEBGL, a 3D implementation would not be as straightforward as in the 2D case

#3014
@limzykenneth

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions