It looks like you're new here. If you want to get involved, click one of these buttons!
Hello experts,
I am trying to render the camera image sprite on a circle instead of a rectangle. The way I have imagined this would work is via an overlay. The problem I have is the circle is not transparent even if I set blend mode to transparent.
Furthermore, Is this the most efficient way to crop the camera image into a circle? Any help appreciated.
imageOverlay = image(100,100)
setContext( imageOverlay )
fill(0, 0, 0, 255)
rect(0, 0, 100, 100)
blendMode(ZERO, ZERO)
ellipseMode(CORNER)
local alpha = 0
fill(0, 0, 0, 0)
ellipse(0, 0, 100, 100)
blendMode(NORMAL)
setContext()
Then in the on draw function.
sprite( CAMERA, self.x, self.y, 100, 100 )
sprite(imageOverlay, self.x, self.y)
Comments
Here's a way to do it using CircleMask class
JakAttak,
Thanks works like a charm