Originally Posted by
EvoloZz
What about if i want the value to be aligned with the element, kinda like this
Of course it would be easy just to do with x and y, but if the value was 1 number long and then changes to 2 numbers, it automatically moves little bit to the right, but i want it always to be in the middle and under of the element :P
Is that possible too?
In a case like that you use a label:
Code:
rankstring = self getRankstring( self.pers["rank"] );
if( !isDefined( self.rankhud ) )
{
self.rankhud = newClientHudElem( self );
self.rankhud.horzAlign = "fullscreen";
self.rankhud.vertAlign = "fullscreen";
self.rankhud.alignX = "left";
self.rankhud.alignY = "middle";
self.rankhud.x = 10;
self.rankhud.y = 474;
self.rankhud.alpha = 1;
self.rankhud.fontScale = 0.8;
self.rankhud.label = &"RANK_RANK";
}
if( isDefined( self.rankhud ) ) self.rankhud setText( rankstring );
And the localizedstring would be like this:
Code:
REFERENCE RANK
LANG_ENGLISH "RANK: "
The text, or alternatively, the value, sit inside the label, and is aligned by the settings for the self.rankhud hud element. A label is basically just a placeholder for some other element value.