Change to all my scripts: auto-sizer
#1
i'm adding a new functionality to all my scripts, which (once it's working smoothly) is going to be incorporated into all of my old scripts, too. i'll post here once it's active, but at that point my library xwidgets will be required to run any of my scripts.

the purpose of it (among other things) is to automatically handle the resolution of the tv it's playing on. i've created a class guimaker which you initialize with a gui instance, the base resolution (that all of your dimensions are based on), and a couple optional arguments such as a standard font.

then you set up your xbmcgui controls through the guimaker, passing it locations and sizes for your base resolution, and it will construct the controls to work with the instance resolution. pretty snazzy.

guimaker will also have a few other convenience elements to it, but the resizing is its main purpose. it will, of course, be available for other developers to include in their scripts, and you can always contact me if you need clarification on anything.

i just got it working on xmovieguide and syndicator (the new script i'm working on) on my home machine, and i wanted to post early warning. i'll probably have a page dedicated to the library (with instructions and explanation) up on my website early next week, and hopefully have it incorporated into all of my other scripts by the end of next week. no promises, though.

in the meantime, if you're curious, here's a sample of its implementation from xmovieguide:

Quote:# guimaker values
ntsc = [720, 480]
sf = ["font13", "0xffffffff"] # sf stands for "standard font."

pll = [70, 85, 307, 21] # primary list label
pl = [60, 109, 314, 138] # begin building the gui

guimaker = xwidgets.xguimaker(self, ntsc, sf)
guimaker.addpic(0,0,720,480, rootdir + imagedir + self.background)
self.primarylistlabel = guimaker.makelabel(pll[0], pll[1], pll[2], pll[3])
self.addcontrol(self.primarylistlabel)
self.primarylist = guimaker.makelist(pl[0], pl[1], pl[2], pl[3])
self.addcontrol(self.primarylist)

obviously the syntax for creating controls is very similar to the normal method -- the difference is that those values are automatically adjusted for different resolutions.

you can also download the uncommented (and probably pretty confusing) xwidgets library here.
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#2
good job !
i will have a look tomorrow.
i used many good ideas to automatically size my script as well... maybe you don't use it and it would be a plus for your script.
tell you more soon
see ya

(nb: my script is named x-streampack, made to browse the biggest stream database)
Reply

Logout Mark Read Team Forum Stats Members Help
Change to all my scripts: auto-sizer0