Re: [Pipmak-Devel] getscreenmodes ideas
Status: Alpha
Brought to you by:
cwalther
From: Christian W. <cwa...@gm...> - 2007-07-24 07:04:41
|
Andrea Viarengo wrote: > I have used the array structure {{w=1024,h=768},...} because I thought > that it was little simpler for the user who aren't a very "lua expert". > I believe that the use of "unpack" could confuse newbies: > > pipmak.setscreensize(unpack(modes[i]) > > What do you think about to use your syntax but adding another calling > schema to setscreensize: > > setscreensize(boolean) > setscreensize(number,number) > setscreensize(table) > > the last syntax should permit to write: > > pipmak.setscreensize(modes[i]) > > and unpack will be performed by setscreensize itself. Good idea. I'll implement and commit that, if you don't object. > another idea: > > n=pipmak.getscreenmodes() --return number of possible modes > w,h=pipmak.screenmode(i) --return modes i > > in this way I haven't to use an array, if I use a wrong "i" > (i.e.: n=10 and I use i=12 or i=-1) > pipmak.screenmode(i) will return the current screensize > so I could write: > > pipmak.setscreensize(pipmak.screenmode(i)) > > What do you think? The original way (or the one sketched above) seems more elegant to me. -Christian |