Skip to content

Using drawingContext for shadows/masks/gradients/... #14

@MAKIO135

Description

@MAKIO135

As shown here: https://github.com/processing/p5.js/wiki/p5.js-overview
drawingContext exposes the context and thus provides access to the native canvas API which led to interesting functionalities like those mentionned in the title and more.

function setup() {
  drawingContext.shadowOffsetX = 5;
  drawingContext.shadowOffsetY = -5;
  drawingContext.shadowBlur = 10;
  drawingContext.shadowColor = "black";
  background(200);
  ellipse(width/2, height/2, 50, 50);
}

#enhancement

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions