getscreenmodes ideas

View: New views
4 Messages — Rating Filter:   Alert me  

getscreenmodes ideas

by Andrea Viarengo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Christian,

Thank you to have included in Pipmak my little contribution!

About the getscreenmodes:

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.  

remain the use of unpack, if I want to read (for testing) modes:

  w,h=unpack(modes[i])
 
or

  w=modes[i][0]
  h=modes[i][1]

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?

Bye

Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Pipmak-Devel mailing list
Pipmak-Devel@...
news://news.gmane.org/gmane.games.devel.pipmak.devel
https://lists.sourceforge.net/lists/listinfo/pipmak-devel

Re: getscreenmodes ideas

by Christian Walther :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Pipmak-Devel mailing list
Pipmak-Devel@...
news://news.gmane.org/gmane.games.devel.pipmak.devel
https://lists.sourceforge.net/lists/listinfo/pipmak-devel

Re: getscreenmodes ideas

by Andrea Viarengo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christian Walther <cwalther <at> gmx.ch> writes:

>
> Good idea. I'll implement and commit that, if you don't object.
>

For me it's Ok.

Andrea




-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Pipmak-Devel mailing list
Pipmak-Devel@...
news://news.gmane.org/gmane.games.devel.pipmak.devel
https://lists.sourceforge.net/lists/listinfo/pipmak-devel

Re: getscreenmodes ideas

by Christian Walther :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is in as revision 160, thanks!

  -Christian


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Pipmak-Devel mailing list
Pipmak-Devel@...
news://news.gmane.org/gmane.games.devel.pipmak.devel
https://lists.sourceforge.net/lists/listinfo/pipmak-devel