Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MAKIO135 opened this issue Mar 20, 2017 · 2 comments
Open

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

MAKIO135 opened this issue Mar 20, 2017 · 2 comments

Comments

@MAKIO135
Copy link

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

@b2renger
Copy link
Owner

thank for the tip ! I'll look into it :)

@MAKIO135
Copy link
Author

i did an example with shadows, linear/radial gradient, dashed lines and clipping ;)
http://jsbin.com/vogununaru/edit?js,output

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

No branches or pull requests

2 participants