Overlay container metrics_mode relative to parent container

What it says on the tin: a place to discuss proposed new features.
focai
Gnoblar
Posts: 8
Joined: Tue Jan 11, 2022 11:29 am

Overlay container metrics_mode relative to parent container

Post by focai »

I wrote a simple overlay script to understand ogre3d's overlay system:

Code: Select all

overlay test
{
    zorder 500
    overlay_element root Panel
    {
        metrics_mode pixels
        left 50
        top  50
        width  400
        height 400

        material red

        overlay_element p1 Panel
        {
            metrics_mode relative
            left 0.1
            top  0.1
            width  0.5
            height 0.5
        
            material blue
        }
    }
}

I expect the width and height of 'panel1' to be 80% relative to the parent container,but unfortunately it seems that the [metrics_mode relative] is interpreted as a proportion of the width / height of the screen, not the parent container!

Doesn't this looks wired? what's a good reason to do this? Is there an easy way to specify container dimensions as a proportion relative to the parent container?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2106
Joined: Sun Mar 30, 2014 2:51 pm
x 1132

Re: Overlay container metrics_mode relative to parent container

Post by paroj »

see https://ogrecave.github.io/ogre/api/lat ... totoc_md96

this option merely allows you to specify the UI in a resolution independent way