In Python code I can add a group attribute to objects, and then selectively drop them from the context, like so:
Rectangle( source='myimage.png', pos=( self.size[0]/2, self.size[1]/2), size=(
self.cz,
self.cz), group='ship')
...then later in my widget...
self.canvas.remove_group('ship')
This works well for my use-case. I'm trying to move some of the python code into a KV file, but this...
<CraftWidget>:
size: .5, .5
canvas:
Rectangle:
source: 'myimage.png'
pos: self.size[0]/2, self.size[1]/2
size: 100, 100
group: 'ship'
...results in the error: Rectangle object has no attribute 'group'
Please advise.