Getting width property of uielement, alignment...
Hello
Here is my example:
http://www.pimpek.lama.net.pl/vr/fov/wide/ww.htm
Here are xml files:
http://www.pimpek.lama.net.pl/vr/fov/wide/SynagogaTempel.xml
http://www.pimpek.lama.net.pl/vr/fov/wide/scripts/zdjecia.xml
And here is description:
I wanted to make a ramp, that widens an element. So I've made one, it gets width property of a big rectangle and put it into width property of "x" icon (in my example).
No matter what would be the width of a rectangle, "x" widens to the same size.
I didn't specify the width of a rectangle, but it's not a problem, when I specify, result is the same. (but specifying that attribute is not good for me!).
So, maybe I'm doing sth wrong, or maybe there are some limitations of getting those parameters...
update!!! 17.01.2007!!!
There's one more thing.
That problem is implemented in that example - I couldn't succesfully position elements in an uigroup.
Uigroup is aligned to the center of the screen, and I've placed "x" icon with right/top alignment. Unfortunatey, icon is in the middle of the rectangle, not in right/top corner...
fieldOfView | SPi-V dev
Re: Getting width property of uielement, alignment...
It appears the width of a uielement whose width has not been specified always returns 100. This is a bug and will be fixed in SPi-V 1.4
Your second problem is related to the fact that uigroups are NOT automatically resized to encompass their children. A uigroup with a size of eg 10 x 10 pixels can contain uielements that are larger. In your case, the uigroup is 0x0 pixels, and centered in the screen. A uielement that is top-right aligned with the group will be just off-center to the screen. If you want the uielement to align to the top-right of the other uielement, you will have to specify a width and height for the uigroup.
Re: Getting width property of uielement, alignment...
Ok, but there's something more.
When I specify size of the uigroup in xml file, I can align elements as I want, but when I change that size with setProperty event, child elements doesn't move to the new coordinates...
Is that a bug or limitation of spi-v?
Myksa