Help with layer stack up order please???

  • Hello.

    I am tying to combine the sample code from the examples from scrollarea.xml and Draggable Layers.xml.

    The key point is that the header area seems to present the layers in an order which is not as programmed using the PARENT, ZORDER and physical positon in the code. See the header above. NOTE: The CYAN (and other harsh colours) colour is to help you see the build up of layers, it is not meant to be this colour!

    The scrollable content woks fine. The scroll bars also work on the right side. MY addition of a top bar with title text and close button X do not work as expected because they main body layer appears at the top of the layer stack when the title should appear there. The words MAXWELLS FOOTSTEPS should be under the CYAN LETTER BACKGROUND AND the black container that holds the TITLE.

    As constructed the top edge doesn't have a border. I thought initially that the problem was only to do with the border, so I removed it, replacing it with a container called boxtitle, but it's both the border and the scrolled content that are wrong.

  • Still struggling with this Here is another view of the problem which I think is easier to understand and therefore suggest ways forward.

    The image shows the current result. The central area (popup) with CSS,HTML, auto sidebars, scrolling etc all work.

    The surrounding layers in blue form the containing layers to make it look like a real window, with title and close button eventually. This can be dragged anywhere on the screen for convenience.

    Both parts work BUT THEY DONT WORK TOGETHER, what I mean is

    1. The blue frame should appear to tightly surround the popup grey central area i.e. fit around the size of the example popup in grey as per the size defined for popup and popup_bg.

    2. The blue window when dragged around should carry the popup around with it. The popup grey content works but is immovable from the origin.


    The code is 110 lines as follows

    1-20. temporary code to allow easy use of the code whilst debugging.

    20-50 The routines to generate the blue frame

    50-110 Code from popup.xml copied here from the examples on the web:

  • Hi,

    not sure, i just had a quick look. but the container with the blue border has 700x500,
    and the popup call has 600x300...

    That must be the case i guess.
    Tuur*thumbsup*

  • Tuur, thanks for taking the time to look and respond. You are correct, ther are some fabrication errors that have been introduced by me when I assembled the code from different sources.

    I’ll post a cleaner version at the weekend which should make the review easier


    James

  • OK, I think I have it down to one point, which should get me working again.

    The code for the image below is shown at the bottom of the post:


    On the left, the output from the example on the krpano Example page popup.xml. This is a HTML scrolling window. it appears at a fixed point on the STAGE.

    On the right, a window frame to surround the first window. This can be moved/dragged around the STAGE by clicking the border.

    How do I combine these so the window on the left keeps working, is inside the frame on the right and they both can move around together?

    Thanks

    James

    Supporting Code: LEFT HTML scrolling
    addlayer('popup_bg', popup_bg);
    linkeventscope(popup_bg);
    set(popup_bg,
    type=container,
    align=top,
    width=100%,
    height=100%,
    zorder=99,
    handcursor=false,
    bgroundedge='0 0 7 7',
    bgcapture=true,
    capture=false,
    bgblur=0,
    bgcolor=0xFFFF00,
    bgalpha=0.0,
    onloaded='tween(caller.bgblur,15); tween(caller.bgalpha,0.0);', // bgalpha > 0 => colorize the background
    onclick='popup_close()'
    );


    addlayer('popup', popup);
    set(popup,
    type=container,
    parent='popup_bg',
    popupwidth=get(width),
    popupheight=get(height),
    popupaspect=0,
    width=get(width),
    height=get(height),
    align=center,
    bgborder='1 0x555555 1',
    bgcolor=0x555555,
    bgalpha=0.7,
    bgshadow='0 10 20 0x000000 0.5',
    bgcapture=true,
    maskchildren=false,
    capture=true,
    handcursor=false,
    alpha=0,
    htmllinkcolor='',
    );

    if(type == 'html',
    set(popup.type, html);
    copy(popup.html, content);
    copy(popup.htmlscrollbars, scrollbars);

    ,type == 'image',
    set(popup,
    bgcolor=0xFFFFFF,
    bgalpha=1,
    );
    addlayer("popup_image", img);
    set(img,
    url=get(content),
    align=center,
    width=-20, height=-20,
    parent=get(popup.name),
    onloaded='parentobject.popupwidth=imagewidth+40; parentobject.popupheight=imageheight+40; parentobject.popupaspect=imagewidth/imageheight; parentobject.parentobject.triggerevent(onresize);'
    );
    );

    Supporting Code: RIGHT dragable frame
    addlayer('popupframe', popupframe);
    set(popupframe,
    type=text,
    popupwidth=700,
    popupheight=500,
    popupaspect=1.4,
    width=700,
    height=500,
    align=center,
    bgborder='30,5,5,5 0x111199',
    bgalpha=0.4,
    bgshadow='16 16 20 0x444444 0.5',
    bgroundedge='0 0 9 9',
    bgcapture=true
    maskchildren=false,
    capture=true,
    handcursor=false,
    alpha=0.8,
    htmllinkcolor='',
    ondown="draglayer();"
    );

  • Hi,

    Something like this should work fine.. (dirty)


    Hope it helps,
    Tuur*thumbsup*

  • That’s great Tuur, not to dirty a solution! BTW. Sorry I forgot to send you hte text, it stays in a seperate file. All 700 of them!
    I’m now trying to maintain progress whilst getting tangled in DATA, CDATA, GET and .captures. SCREAM.

    I ALso can’t find some of hte colour and size variables for hte scroll bar. I’ll keep pushing on hte project and come back later in hte week… I suspect hte controls are there but not in the documentation?


    IN hte MEAN TIME TUUR, THANKS, YOU DESERVE A COFFEE!


    James

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!