Page 1 of 1

LUA EDU layout: post your screenshots here

Posted: 18.08.2009, 08:41
by Fenerit
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.

Re: LUA EDU layout: post your screenshots here

Posted: 19.08.2009, 08:09
by Vincent
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 ".

Re: LUA EDU layout: post your screenshots here

Posted: 30.08.2009, 10:21
by Fenerit
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:

Re: LUA EDU layout: post your screenshots here

Posted: 30.08.2009, 12:42
by Vincent
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);

Re: LUA EDU layout: post your screenshots here

Posted: 30.08.2009, 12:45
by Fenerit
THX! :wink:

Re: LUA EDU layout: post your screenshots here

Posted: 30.08.2009, 12:56
by Vincent
Fenerit wrote:THX! :wink:
Prego !

Re: LUA EDU layout: post your screenshots here

Posted: 30.08.2009, 13:58
by Cham
Fenerit wrote:THX 1138! :wink:

Re: LUA EDU layout: post your screenshots here

Posted: 30.08.2009, 14:09
by Fenerit
Cham wrote:
Fenerit wrote:THX 1138! :wink:

Ahem, as running man there is also Logan five...