I have made a dialog window with a label in it but I cannot seem to find a way to center the text inside the label. I thought it would be something easy to do but I can't find any way to do it. Is there something I am missing or do I have to keep moving the label depending on the text size?
That's pretty cool, but it comes with the issue of not being able to chose what you want your text to look like, so the work-around is better if you don't like the style, at least until we learn how to make our own styles.
Anyway, there's a built-in set of styles that begin with "Mod" and they have every combination of size, align and weight possible. Examples of combinations:
ModCenterSize32Bold
ModLeftSize20
ModRightSize40
Possible font sizes: 12 16 20 24 28 32 36 40 52 64
The only things you can't change are font family and vertical alignment.
For text align to work, you have to use Set Dialog Item Style to set the style for the whole block/label, not just wrap the text in style tags. It's like trying to set alignment to an inline element in HTML, wont work.
Centering dialog item text is definitely possible. You have to use "Set Dialog Item Style". "Text with Style" or using inline style tags does not work; the dialog item will ignore the alignment.
You'll also need a font style with a center alignment. I recommend setting up a custom style.
I have made a dialog window with a label in it but I cannot seem to find a way to center the text inside the label. I thought it would be something easy to do but I can't find any way to do it. Is there something I am missing or do I have to keep moving the label depending on the text size?
@Demon4231: Go
You can't do this specifically, but there's a nice work-around tutorial from FuzzYD here.
@deathtorn: Go
Actually you can!
Somewhat.
See.. text can have a lot of different text styles.
Some text styles are center-aligned.
Not all of them however, to find out which texts are center-aligned download this file:
Link Removed: http://www.mediafire.com/?th850qg99egcaqc
You can open it with the normal notepad.
Look for those styles with the
vjustify="Middle"
attribute.
Those work.
@s3rius: Go
That's pretty cool, but it comes with the issue of not being able to chose what you want your text to look like, so the work-around is better if you don't like the style, at least until we learn how to make our own styles.
Huh? Text alignment is impossible? When did that happen?
@Tolkfan: Go
Nice! I guess I could've received some knowledge for going through all the trash that is know as styles.
Ugh, something's wrong with editing posts, kept getting 404 errors :S
Anyway, there's a built-in set of styles that begin with "Mod" and they have every combination of size, align and weight possible. Examples of combinations:
Possible font sizes: 12 16 20 24 28 32 36 40 52 64
The only things you can't change are font family and vertical alignment.
For text align to work, you have to use Set Dialog Item Style to set the style for the whole block/label, not just wrap the text in style tags. It's like trying to set alignment to an inline element in HTML, wont work.
Centering dialog item text is definitely possible. You have to use "Set Dialog Item Style". "Text with Style" or using inline style tags does not work; the dialog item will ignore the alignment.
You'll also need a font style with a center alignment. I recommend setting up a custom style.
I've covered all of this in quite some detail here: http://forums.sc2mapster.com/resources/tutorials/17978-dialogs-really-great-looking-dialogs-part-2/