Is it possible to remove objects from a canvas? I know there’s a function clearRect that sets the area specified to transparent. But I’m looking for a way to just remove an object.
For example say I have two rectangles
new Rect(100,100,110,110)
new Rect(90,90,105,105)
the two circles overlap. If I use clearRect, removing one circle will remove a part of the other circle.
Any way of clearing one rect without clearing a part of the other?
Canvas is just a canvas to draw objects on, you have to manage objs on your own. Clear canvas, remove obj from obj list, redraw remaining objs.