I have manage to draw some rectangle in my canvas.
Is it possible for me to delete them by either clicking on the rectangle or put a X button on the rectangle to delete it ?
For example : I drew 3 rectangle(A,B,C) and I wanted to delete rectangle B. Is it possible for me to delete rectangle B by clicking on it ?
Anyone have any idea regarding this ?
Possible , but It depends on how you draw those rectangles. If I have to write then I will write in following way,
I will draw each rectangle on different sprite. Add these sprite to UIComponent and then this UIComponent will go as child of Canvas. Now while adding sprite to UIComponent add mouse click event listner to sprite. In this event list you can remove it from its parent.
Hope this will help you....