Self-adjusting block text

1
  • 14 favourites

Attached Files

The following files have been attached to this tutorial:

.capx

textwith9path.capx

Download now 172.01 KB

Stats

1,501 visits, 2,262 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

You have a game with a lot of text, and Do you want put in a beautiful frame? this is the solution!

You only need design a beautiful frame and take this steps!

I only working with default design, but imagine the possibilities.

First you need a 9 patch and text object.

Remember, the hotspot of both objects must to be Top left.... because if you use the center, the reference position for 9 patch can be lost, for example when you set size of the box of text.

In the event sheet you only need create a event with "Every tick" and put the following acts

-->9 patch "Set position to (Text.X-5, Text.Y-5)"

-->9 patch "Set size to (TextWitdth+15,TextHeigth+15)

(the numbers can be changed based your likes :D)

I have a example working, write something in the text box and press enter y voila! the 9 patch adjust to the text!

Thank you!

.CAPX

textwith9path.capx

Download now 172.01 KB
  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!