Controllabel alignement
#1
hi !
i would like to know a bit more about alignment of controllabel. here, 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 ?
Reply
#2
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.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#3
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
Reply
#4
thanks guys
Reply
#5
I know this is a very old thread, but wanted to add to this since documentation on Python addons in XBMC is very light. There are other values for alignment than the options above. I was looking for align right, center y. Here are a couple of other values I have not seen documented anywhere else.

5 = right align, center y
6 = left align, center x, center y

I'm sure there are others, but haven't gone through all the options.
Reply

Logout Mark Read Team Forum Stats Members Help
Controllabel alignement0