x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Size of Button with Text

When I put a text on a button, the size of button changes automatically to the size of the text and no longer can be changed..

Directly on canvas it works, but I want the buttons with text to be inside of a gridpanel so they all have a nice alignment in rows and columns, is that possible?

Product Version: Not Selected
Tags:
more ▼

asked Dec 28 '17 at 12:58 PM in Using UE4

avatar image

endbored
36 8 7 12

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

The size of the text makes the button expand as the button tries to accommodate it. Reduce the size of the text:

alt text

In addition, change the alignment to center/center so they sit pretty and in the centre.

edit: the above is in the GridPanel

capture.png (79.8 kB)
more ▼

answered Dec 28 '17 at 01:57 PM

avatar image

Everynone
12.1k 71 24 49

avatar image endbored Dec 28 '17 at 03:10 PM

Hello, reduce size of text also smalls the buttons, but I want buttons to be a bit bigger than text.

Found out that text placed not as child to the buttons does not change the buttons size, but then the buttons are not clickable at the position where the text is, which is not really an acceptable solution..

In the picture left and middle columns texts are unchilded, only right row text is placed as child, and with different font sizes it shrinks the buttons too. It should be independent from each other alt text

size.png (17.8 kB)
avatar image Everynone Dec 28 '17 at 03:19 PM

[...]but then the buttons are not clickable at the position where the text is, which is not really an acceptable solution..

That's because your text is set to Visible (default), change it to HitTestInvisible

I did not get the rest. Could you provide an example (can be a crude drawing) of what you're trying to achieve?

While the grid panel is not perfect by any means, it is pretty flexible:

https://gyazo.com/491eeafbec541d8e83189c3c17128741

avatar image endbored Dec 28 '17 at 04:43 PM

I had each text placed as a child onto the buttons, after that the buttons shrinked to the length of text and it was not possible for me to make buttons bigger (or smaller).

The hit test invisible thing works, using that with text not as child seems fine. Thank you very much.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question