drawings to image()

Can I convert a shape composed of many sub-shapes into a texture? Say I have calls like rect(), line(), etc., which define an object. Then read their pixels and write, with help of image(), to a texture. Possible?

Yes you can.

–start by creating a new image:
result=image(WIDTH,HEIGHT)

–define where you want to draw:
setContext(result)

–start drawing here:
Rect(…)
Line()

–then return to the global image:
setContext()

–use the result here with sprite (or much faster with a mesh):
sprite(result,20,40,300)

Hope it will help

That is Great! Thank you! :slight_smile: