I'm trying to make a sort of "credits button" using that should display two labels: a fixed label "CREDITS" and another label that contains the current number of credits earned by the player.
First problem: labels seem to be top anchored... they are vertical aligned on the top of the dialog, not in the middle (as I used AnchorRight and AnchorLeft). Second problem: I need the set the label of credits number to the right, sort of right alignment, so that when the value is updated I don't need to center it back again correctly to the center of the dialog... but AnchorRight with offset -10 doesn't work... shouldn't it make the label start at the right border of the dialog?!
Well, I don't know if you can offset it by -10 since it would effectivlely move a part of the label out of the dialog (which generally doesn't work).
You also can't align text to the right (which is a huge pain).
The way to go is to just reduce the length of the labels. Your entire dialog is 240 pixels long, but each of your labels is 200 long. It's logical that they overlap in the middle.
But the "credits" label is much longer than needed and also the "0" label probably won't have to display numbers in the trillion.
An awesomely drawn pic to visualize:
I draw the two labels under each other for visual purposes.
I had a really frustrating time creating custom UI stuff for the briefings on my map... for me, the source of the problems was the different alignments of dialog items inside the dialog. I fixed it by aligning my dialog to the Centre (or where ever) and everything else to the top left and then messing around with the offsets. This way, all your dialog items are by default attached to the upper left of the dialog, and you set exactly where they are with x,y coordinates. I found it much, much easier than messing around with the presets.
EDIT: Also, like s3rious said above, try messing around with the sizes of the dialog items, as that also changes their alignment. If your dialog is 240 width and the label is only 200, it will not be perfectly aligned to the right. Again what I found easiest was making all items the same size (or slightly smaller so they're not overlapping the borders of your image), with the same alignments, and then playing with the offsets.
You can anchor labels to the right of dialogs if you use a style which has a "hjustify" value of "Right" like "RightJustified" (theres also "CenterJustified" if you need it). I see youre using "CreditsPanelLabel" as a style. Thats left aligned. "CreditsPanelValue" is the same, only aligned to the right. You could use that.
I'm trying to make a sort of "credits button" using that should display two labels: a fixed label "CREDITS" and another label that contains the current number of credits earned by the player.
I used the following trigger:
First problem: labels seem to be top anchored... they are vertical aligned on the top of the dialog, not in the middle (as I used AnchorRight and AnchorLeft). Second problem: I need the set the label of credits number to the right, sort of right alignment, so that when the value is updated I don't need to center it back again correctly to the center of the dialog... but AnchorRight with offset -10 doesn't work... shouldn't it make the label start at the right border of the dialog?!
Well, I don't know if you can offset it by -10 since it would effectivlely move a part of the label out of the dialog (which generally doesn't work).
You also can't align text to the right (which is a huge pain).
The way to go is to just reduce the length of the labels. Your entire dialog is 240 pixels long, but each of your labels is 200 long. It's logical that they overlap in the middle.
But the "credits" label is much longer than needed and also the "0" label probably won't have to display numbers in the trillion.
An awesomely drawn pic to visualize:
I draw the two labels under each other for visual purposes.
@DivinoZarathos: Go
I had a really frustrating time creating custom UI stuff for the briefings on my map... for me, the source of the problems was the different alignments of dialog items inside the dialog. I fixed it by aligning my dialog to the Centre (or where ever) and everything else to the top left and then messing around with the offsets. This way, all your dialog items are by default attached to the upper left of the dialog, and you set exactly where they are with x,y coordinates. I found it much, much easier than messing around with the presets.
EDIT: Also, like s3rious said above, try messing around with the sizes of the dialog items, as that also changes their alignment. If your dialog is 240 width and the label is only 200, it will not be perfectly aligned to the right. Again what I found easiest was making all items the same size (or slightly smaller so they're not overlapping the borders of your image), with the same alignments, and then playing with the offsets.
You can anchor labels to the right of dialogs if you use a style which has a "hjustify" value of "Right" like "RightJustified" (theres also "CenterJustified" if you need it). I see youre using "CreditsPanelLabel" as a style. Thats left aligned. "CreditsPanelValue" is the same, only aligned to the right. You could use that.