-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Shadows for p5 #3167
Comments
I'm not seeing a lot of response around this one right now and I think it may be beyond the scope of the library for now. It is possible to call these methods natively on the canvas object, so I'm not sure a wrapper of these is necessary. Let's revisit in the future if others express the same need. Thanks @TanviKumar |
@TanviKumar |
An example in the documentation would be very helpful - I don't know how to "call these methods natively on the canvas object" and I would expect the average p5js user to not be familiar with it either. |
@jatin33 maybe you'd like to look at this one? |
Adding shadow to objects is easy : var context = drawingContext; // or p5.drawingContext |
Here is a documentation |
Yeah drawing a line without p5 on a canvas is "easy" too: const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
ctx.beginPath(); // Start a new path
ctx.moveTo(30, 50); // Move the pen to (30, 50)
ctx.lineTo(150, 100); // Draw a line to (150, 100)
ctx.stroke(); That's not the point of the issue though. Saying "I'm not sure a wrapper of these is necessary" would imply that 90% of p5.js is not necessary, most of it is just a wrapper around canvas stuff. But I guess it's not in the scope of a creative coding library to add more accessible support for shadows. |
Nature of issue?
Most appropriate sub-area of p5.js?
New feature details:
Currently p5.js does not have any support for shadows. It's one of the very few things missing and should be relatively easy to implement too! This links to the documentation about shadows.
It would be great if a method could be added to allow the user to create shadows with ease. Perhaps multiple methods could be created to change specific properties of the shadows, though I'm unsure as to how useful that might truly be. Hoping this issue can be a space for discussion about this.
In case the community believes that this would be a useful addition, I've written some code for a method for creating shadows, hopefully that can be a good start!
The text was updated successfully, but these errors were encountered: