Rounded Rectangle / Panel masking?
-
I want to clip the corners on these panels so my shadows dont show outside of the rounded corners. I thought maybe masking would help in a way. Is there a way to do this via script? I found 'g.applyMask' but that expects a path im assuming from an SVG image or drawn manually. How can I draw the path manually of a rounded rectangle?
funky corners
-
@Chazrox use the panels paint method.
-
@Lindon What do you mean? This is a paintRoutine as it is. I just need to be able to make shadows along the outer edges but I want to mask parts out specifically the corners.
-
@Chazrox Use either
addDropShadowFromAlpha()
ordrawDropShadowFromPath()
-
@d-healey I used those to make this image for sure. The problem is, if I want the panel to look rounded.....it doesnt clip the corners properly....see the ugly shadows peaking outside my "rounded" rectangle.
hence me looking for a masking solution. I tried putting my painted panel into an empty rounded panel and seeing if it would clip the corners but it doesnt.
-
@Chazrox There's
g.applyMask
which you could try. -
@Chazrox said in Rounded Rectangle / Panel masking?:
I found 'g.applyMask' but that expects a path im assuming from an SVG image or drawn manually. How can I draw the path manually of a rounded rectangle?
@d-healey thats what I was asking about. Know how?
-
-
@Chazrox
Paint routine:const Path = Content.createPath(); Path.addRoundedRectangle(area or local bounds, corner size); g.drawDropShadowFromPath(path, area or local bounds, colour, radius, offset in array 2 elements);
and if you want delete inner shadow:
const Path = Content.createPath(); Path.addRoundedRectangle(area or local bounds, corner size); g.beginLayer(false); g.drawDropShadowFromPath(path, area or local bounds, colour, radius, offset in array 2 elements); g.applyMask(Path, area or local bounds, invert in this case is true); g.endLayer();
-
@d-healey That was definitely the fix! I get how to use it now!
Shall I say "Game Over" hahaha.
Clean Corners now...
-
C Chazrox has marked this topic as solved
-
@It_Used Sick. I was just looking over your code. I see whats going on now. I feel like this will help me achieve more of the looks im trying to achieve with inner/outer shadows in specific places.
Chee! Thanks! -
@Chazrox i think my example is little incorrect, do not matched to context, i later read your messages, and It looks like you didn't need exactly what I wrote about.
This is my mistake, i'm sorry. -
@It_Used no stress. I'll still try it and see what results it produces. Maybe I can still use it for something.
Thanks again!