LUA EDU layout: post your screenshots here

Discuss Celestia's features, adaptations and Addons for use in educational environments
Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

LUA EDU layout: post your screenshots here

Post #1by Fenerit » 18.08.2009, 08:41

This thread is intended for those (like me) who needs to known how to displace toolboxes on screen.

My example:
monitor 15" 1024x768, 2k atm_profiles pictures resized to 512px and inserted (aligned top) within a canvas of 714x512px .

Image

In infoBox.lua file I've changed:

Code: Select all

local getImageSize = function(image)
    local iWidth = image:getwidth();
    local iHeight = image:getheight();
    if iWidth > 714 or iHeight > 714 then
        if iWidth >= iHeight then
            iHeight = iHeight * 714 / iWidth;
            iWidth = 714;
        else
            iWidth = iWidth * 512 / iHeight;
            iHeight = 512;
        end
    end
    return iWidth, iHeight;
end


This allow to me of having a potential image "strip" that span the screen height leaving free the half screen width; useful for selecting objects (an entire screen image does lock the click action). As second operation, I've resized the image caption as far as to have a tiny selector aligned with the time action box modifying the part below:

Code: Select all

for objname, v in pairs(infoImage) do
    image[objname] = {};
end

imageWidth = 4;
imageHeight = 4;
yImageRatio = 4 / imageHeight;
imdx, imdy = 0, 0;
-- Move up image if obsModeBox is disabled.
if not(obsModeBox) then
    imdy = 50;
end


Practically I've accomplished the operation of customizing the presence of LUA EDU TOOLS toolbox. Below the image there space either for another image aligned bottom within its canvas or for displaying the Add-on box. Hence, I shut here because even myself need to know how to do for attaching the add-on box apart the center on screen. I've been able just to along the box for fast add-on checking because its develop. I should like to know which parts of the code acts to attach boxes everywhere.
Never at rest.
Massimo

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

Re: LUA EDU layout: post your screenshots here

Post #2by Vincent » 19.08.2009, 08:09

Massimo,

Sorry, I don't understand precisely what you're asking for.
Are you talking about the toolbox or the addon box ?
Generally, you can attach active boxes wherever you want in the viewport area.
To do so, just define a new active box in the file "tools/mybox.lua ".
@+
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

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Re: LUA EDU layout: post your screenshots here

Post #3by Fenerit » 30.08.2009, 10:21

Vincent wrote:Massimo,

Sorry, I don't understand precisely what you're asking for.
Are you talking about the toolbox or the addon box ?
Generally, you can attach active boxes wherever you want in the viewport area.
To do so, just define a new active box in the file "tools/mybox.lua ".

Yes, Vincent; I'm talking about the toolbox of the addon box. A new active box will be a next step, if necessary. Knowing more about addon box will result useful for another ones. :wink:
Never at rest.
Massimo

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

Re: LUA EDU layout: post your screenshots here

Post #4by Vincent » 30.08.2009, 12:42

Massimo,

Generally speaking, the position of a box is defined as follow:

Code: Select all

mybox:attach(parentBox, lb, bb, rb, tb);
where the lb, bb, rb, tb values represent the distances in pixels respectively from the left, bottom, right and top borders of the parent box.

So, you can change the position of the addon box by modifying the following line (addsBox.lua, line 182):

Code: Select all

addsFrame:attach(screenBox, (width-addsFrameWidth)/2, height-addsFrameHeight-2, (width-addsFrameWidth)/2, 2);
E.g., if you want to place it on the left hand side of the screen and vertically centered (see screen capture below), just use:

Code: Select all

addsFrame:attach(screenBox, 2, (height-addsFrameHeight)/2, width-addsFrameWidth-2, (height-addsFrameHeight)/2);
Last edited by Vincent on 30.08.2009, 12:58, edited 3 times in total.
@+
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

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Re: LUA EDU layout: post your screenshots here

Post #5by Fenerit » 30.08.2009, 12:45

THX! :wink:
Never at rest.
Massimo

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

Re: LUA EDU layout: post your screenshots here

Post #6by Vincent » 30.08.2009, 12:56

Fenerit wrote:THX! :wink:
Prego !
@+
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

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: LUA EDU layout: post your screenshots here

Post #7by Cham » 30.08.2009, 13:58

Fenerit wrote:THX 1138! :wink:
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
Topic author
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Re: LUA EDU layout: post your screenshots here

Post #8by Fenerit » 30.08.2009, 14:09

Cham wrote:
Fenerit wrote:THX 1138! :wink:

Ahem, as running man there is also Logan five...
Never at rest.
Massimo


Return to “Celestia in Education”