Page 1 of 1

Question about the getscreendimension() celx function

Posted: 02.04.2006, 15:01
by Vincent
The 'celestia:getscreendimension()' command for celx scripts only returns the width of the Celestia-window, and no height.

I thought the width and height were returned in a table, so I tried this :

Code: Select all

dim = celestia:getscreendimension()
width = dim[1]
height = dim[2]
But that didn't work...

Then, I had a look into Harald Schmidt's celx tutorial :
/x, y/ celestia:getscreendimension()
Returns width and height of Celestia-window.
So I tried several syntaxes like :

Code: Select all

width = dim.x
height = dim.y

width = dim(x)
height = dim(y)

width = dim[x]
height = dim[y]

width = dim.width
height = dim.height

But none of them worked...

I also made a search on the forum, but that gave me no result... Does anybody have a clue about how to get both the width and height of the Celestia-window ?

Re: Question about the getscreendimension() celx function

Posted: 02.04.2006, 17:35
by hank
Vincent wrote:Does anybody have a clue about how to get both the width and height of the Celestia-window ?

Try this:

Code: Select all

x,y = celestia:getscreendimension()
-Hank

Re: Question about the getscreendimension() celx function

Posted: 02.04.2006, 18:07
by Vincent
hank wrote:Try this:

Code: Select all

x,y = celestia:getscreendimension()


Thanks a lot Hank, that works ! :D