drawing a shape with touch and then filling it.

Hi,

I have searched around but couldn’t find an answer.

So how would I draw a shape using my finger, when the shape is complete fill it with a colour.

example here ( the pink/red shape)

https://www.youtube.com/watch?v=J9H8gKxlvlc

I know its a broad question but some help would be cool.

thanks

Use a touch listener that creates a line for each “moved” event, between the previous and the new point, and store each x-y value in a table. When touch ends, create a polygon using the coordinates from this table.

Use a touch listener that creates a line for each “moved” event, between the previous and the new point, and store each x-y value in a table. When touch ends, create a polygon using the coordinates from this table.