Gradient as Image Sheet?

I want to create an image using display.newRect and then add a gradient to it and then use this created image as an image sheet… is this possible somehow? Or can image sheets only be images stored in the directory?

Creating different gradients on the fly and then use them as image sheets (to cut them into a lot of small pieces) would make things easier for me :slight_smile:

Is this possible?

Alternate question: If not… is it possible to add a gradient to an image sheet somehow before cutting the image apart?

You’re basically asking for a canvas. As far as I know this works with image sheets, though I don’t have a working example on hand.

Thank you for your help with this. The basic idea behind doing it like this is to have no images at all to keep the app as small as possible.

I think I read your post wrong…

So how about creating a rect at 2048 x 2048 px, apply a gradient fill and the save that as a png.  You could then load that as an imagesheet and do with it what you want?

That way you are creating the image (say on first run) and it is not stored in the apk.

You’re basically asking for a canvas. As far as I know this works with image sheets, though I don’t have a working example on hand.

Thank you for your help with this. The basic idea behind doing it like this is to have no images at all to keep the app as small as possible.

I think I read your post wrong…

So how about creating a rect at 2048 x 2048 px, apply a gradient fill and the save that as a png.  You could then load that as an imagesheet and do with it what you want?

That way you are creating the image (say on first run) and it is not stored in the apk.