I've built a little gui, which consist of a custom view and a button inside of it. I want to change the image of the button, which I've set via a custom attribute like so:
{'image':ui.Image.named('res/buttons/blueoff.png').with_rendering_mode(ui.RENDERING_MODE_ORIGINAL)}
when I detect a touch on my custom view. I know how to change the picture, but before I would need to get the path of the current image, e.g.'res/buttons/blueoff.png'.
I have tried the following, but it gives none:
class ButtonWrapper(ui.View):
imageSrc = ''
def touch_began(self, touch):
imageSrc = self.subviews[0].image.name
print(imageSrc)
Only to clarify, if I do
def touch_began(self,touch):
image = self.subviews[0].image
print(image)
I get back the image (obviously as a object, and not the path I want) I'd like to access.