How can I adjust the position of the text of a button when it is clicked

I’m trying to customize a button appearance. I’m using “Sprite Swap” as Transition. I have 2 images for normal and pressed state. In the attached video there are 2 buttons. The text of the left one is embedded in the image. The text of the right one is the Text component of the button. The left button looks pretty good but if the text changes I have to re-render the image, which isn’t posssible at runtime. The problem with the right one is, the position of the text doesn’t change accordingly when the button is clicked.

So, what can I do to adjust the text position when using “Sprite Swap” ?
Or, what other technics should I use?
jqq6nt

Thinking out loud, it might be more efficient to create a 3D object button where the text is a child on top of the button surface. OnClick, you would simply move the button down where given the text is a child of this button object would follow.

This would not involve any swapping of anything just moving an object.

Since this text would be a text component (preferably a TMP text object), this would work regardless of the text content.

1 Like

Thanks, it works!