How can I achieve this if I press a button and make the image(parent is the button) and label (parent is the button) on it gradually shrink at the same time?

How can I achieve this if I press a button and make the image(parent is the button) and label (parent is the button) on it gradually shrink at the same time?

So there is a button and there is an image and label on it, and you want to scale down the image and the label while you press the button?

If so what should be the pivot point of the transformation?

@kisvegabor Hello!! Mr kisvegabor,I’m glad to receive your reply.
Yes,I wang to scale down the image and the label while i press the button,then what’s the pivot point of the transformation? I cannot understand it.

And could you provide some code that can solve the problem? thanks.:laughing: :smiley:

You can reference this example:
lv_example_style_15

@EagleLiao thank you,I’ll take a look at it.

1 Like

Another better example: lv_example_img_3

@EagleLiao
I have seen this example,but i don’t know how to apply it to my code.

Create a button in active screen, btn
Create an image in this button, img
Add an event_handler to the button
In the event_handler, check the event type,
if CLICKED, transform the img a little, you call it shrink.
if RELEASED, transform the img back

If you like, you can also play animation for the img, when CLICKED or RELEASED.