Stretch Image (SOLVED)


Figure 1

image
Figure 2

image
Figure 3

I am learning from the Colorslider Tutorial. How can I stretch the background image from Figure 1 to Figure 2 that keeps the border unchanged? I only get the result like figure 3 via change scale value.

You can learn more about GUI box nodes here: https://www.defold.com/manuals/gui-box/

2 Likes

Oh, this is exactly what I need, thanks.

According to the gui-box manual, I have get much better result of the button, but it is still unable to tune the button as same as the figure 2 show, is there anything I got wrong?

What do you mean by same as figure 2? (Your result and the image in figure 2 look quite similar to me)

If you want the button’s width to be bigger then maybe try to change the value of X in Size.

I got a similar result finally, which is to adjust the text size to fit the box (the previous one is to adjust the box to fit the text) Thanks for your reply.

1 Like