Question about the getscreendimension() celx function

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Question about the getscreendimension() celx function

Post #1by Vincent » 02.04.2006, 15:01

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 ?
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Re: Question about the getscreendimension() celx function

Post #2by hank » 02.04.2006, 17:35

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

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Question about the getscreendimension() celx function

Post #3by Vincent » 02.04.2006, 18:07

hank wrote:Try this:

Code: Select all

x,y = celestia:getscreendimension()


Thanks a lot Hank, that works ! :D
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3


Return to “Scripting”