Center text in a label
#1
Is it possible to center text when adding a label? I am trying to modify a script and I want the text centered on the control label. Is there an easy way to do that? Here is what I have right now and I would like it centered:

Code:
self.callerid = xbmcgui.ControlLabel(w - 280, h - 60, 180, 64, number, 'font13', '0xffffffff')
self.addControl(self.callerid)

As you can see, it is from the called ID script. I want to center the name and number instead of just showing the name left aligned. Any ideas?

J_K_M_A_N
Reply
#2
yes, "alignment"

left=0
right=1
center=2

then if you want to center vertically also add 4

so alignment=6

pydocs in my signature are a great resource
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#3
Thank you very much Nuka1195. That link is VERY helpful. Maybe I can make it even better somehow. Thanks for the help!

J_K_M_A_N
Reply

Logout Mark Read Team Forum Stats Members Help
Center text in a label0