PDA

View Full Version : Controllabel alignement


solexalex
2005-07-20, 00:34
hi !
i would like to know a bit more about alignment of controllabel. here (http://home.no.net/thor918/xbmc/xbmcgui.html#controllabel), one can read :
alignment : alignment of text - see xbfont.h (opt)

i browse a little bit the cvs from sourceforge, but i haven't found this file. google was not my friend, the search function of this forum was silent as well....

can anybody help me ?

Nuka1195
2005-07-20, 01:39
xbfont_left = 0x00000000
xbfont_right = 0x00000001
xbfont_center_x = 0x00000002
xbfont_center_y = 0x00000004
xbfont_truncated = 0x00000008

self.padtitle = xbmcgui.controllabel(self.offscreenx + self.titlex, self.titley, self.titlew, self.titleh, self.scripttitle, self.padfonttitle, "0xfff1ea40", "", xbfont_center_y|xbfont_center_x)

an example in action.

Asteron
2005-07-20, 16:54
weird note:

if you specify right alignment than the x coordinate in the constructor specifies the right edge (and the width goes towards the left).

i think this behavior is pretty stupid as you need to know the alignment to know the label region but whatever.

i use it a bit in xstocks if you want more examples.

-asteron

solexalex
2005-07-20, 18:40
thanks guys