Overlay relative positioning behavior of nested containers
Posted: Mon Jan 31, 2011 6:00 pm
I am relatively new to development using the Ogre 3D engine, but noticed some odd behavior when trying to design an overlay for an industrial project.
If a container is nested within a parent, and its metrics_mode is set to relative, it seems to use the top-left corner of the parent container as its origin, but all "distance" values are relative to the whole screen. This includes, top, left, width and height values.
Example:
Instead of the child container's top-left corner being (30, 30) and dimensions of 80x20 pixels (as I had expected), the actual coordinates on an 800x600 screen resolution are (100, 100) and 640x160.
If this is the intended behavior, please disregard this report.
- Rob
If a container is nested within a parent, and its metrics_mode is set to relative, it seems to use the top-left corner of the parent container as its origin, but all "distance" values are relative to the whole screen. This includes, top, left, width and height values.
Example:
Code: Select all
container Panel(Battery_Indicator)
{
metrics_mode pixels
left 20
top 20
width 100
height 100
material RotaryIndicator1
container Panel(Battery_Indicator/Amps)
{
metrics_mode relative
left 0.1
top 0.1
width 0.8
height 0.2
}
}
If this is the intended behavior, please disregard this report.
- Rob