I want to allign the text in a dialog label.
I want the dialog to show some stats, and this is what happens now:
I want this:
Gridlock TD : Elements
To remove the ellipse you need to increase the size of the dialog item. As far as aligning the text box itself... that should just be a matter of modifying the offset. Negative numbers are allowed.
Malum Ruina: SC2Mapster
Eternal Exile: SC2Mapster
Spine Crawler Madness: SC2Mapster
Xeno Crisis: SC2Mapster
I dont know exactly how you are building your dialogue, but here is how i would have done it:
Make a dialogue > add a label. Make variables that references the label and the dialouge.
I would then make a font style which is left aligned (or centered if you would like). To set the position of the text you need both to apply the font style to the label with dialogueItemSetStyle() and inside the label, around the text <s style="something">yourtext</s>.
So i would add a function call after the creation of the label to dialougeItemSetStyle(yourStyle).
Then, i would create a function that sets the content of the label, to make it easily updatable: a new function like pushScore(team1[int], team2[int]). i would then use _expressions_ to design the content of the dialouge itself. Expressions are a very powerful way of comining text items. In the function i would create a text dummy variable txt. Use a setVariable to define its content. Instead of writing the value in the "value" tab, go to expression tab. write something like:
<s style"team1">Team 1: ~A~</s></n><s style="team2">Team 2: ~B~</s>
the <s> segments sets the style
the ~stuff~ segments are variables, which you define in the field below. you can rename them if you want to. The expression will only accept text variables/content, so you need to convert the integer values from the parameters to the function (team1[int], team2[int]) to integers using intToText(v).
The </n> segment tells the engine to push a new row. The end result will be
Team 1: 23
Team 2: 24455
if that was the score... ^^
I dont want to increase the size of the dialog, I want to make it allign to the right edge,
I have already made the dialog, the only problem I got is that I can not make the text allign.
this should help:
but if you are getting dots (...) the label width is too small
A programmer started to cuss
Because getting to sleep was a fuss
As he lay in his bed
Looping 'round in his head
Was: while (!asleep()) sheep++;
Thank you :)
You must login to post a comment. Don't have an account? Register to get one!