Containers

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
sportsnapper
Posts: 73
Joined: Tue Jun 22, 2010 10:28 pm

Ok - I'm really getting confused with Containers and anchors. I'm not sure this a question more a way of getting someone to confirm that this is the way it works, or can point me to some good documentation on this - I have searched.

I've just created a little test scenario, with a single rectangle (acting as a container) and four rectangles, all of which have some text to identify them. The first rectangle is anchored to top left (the default) the second rectangle is anchored to bottom left , third bottom right and fourth top right. They've been aligned in the editor.
The screen shot below shows the settings for the skin. The flash output is also set to 800x400.
Image
When I make the swf, the result is as below:
Image
So:
  • The top left anchor anchors the image to the top left of the container - so it's at 3,2 relative to the containing rectangle.
    The bottom left anchor anchors the text to the bottom left of the container - it anchors the top left of the rectangle to the bottom left of the rectangle.
But I don't really get what's happening with the top right anchor - that text box is way outside the container - so is it anchored to the top right of the window - yes - that's not the way i looks in the skin editor - it's on top of the other boxes. I assume that if I make the window size smaller than the text box will stay relatively the same to the top right corner of the window, but closer to the containing rectangle. Does this apply to the window in the skin editor, or the window in the flash output dialog? And why is this box working relative to the window rather than relative to the containing rectangle?

And I just don't understand the bottom right at all...though the rest of it is almost clear.

regards

Gareth
smooth
Posts: 1493
Joined: Sat Sep 09, 2006 7:30 pm

Your rectangle is a parent not a container. I think you want the rectangle to be a child of the container.
Pick it up and drop it on the container.

Regards, Smooth 8)
Image
sportsnapper
Posts: 73
Joined: Tue Jun 22, 2010 10:28 pm

No - the container is a red herring here - I started the example using the container, then decided that I couldn't see it - so it was difficult to see the relationship of the other rectangles to the containing symbol.
Besides, I don't think that the positioning of the subordinate rectangles is changed if their children of the container or children of the rectangle - or is it??
smooth
Posts: 1493
Joined: Sat Sep 09, 2006 7:30 pm

No, OK it was confusing me - seeing the container in your tree.
The anchors are relevant to the viewer as a whole. If you anchor it left on the stage it will stay left when you change the viewer size.

In this case "all" of the contained objects (children) should be positioned and have the same anchor point I.E: top left.

As a test use the centre anchor for the rectangle and then all of it's children as top left (after positioning them in there respective corners.)

Publish and the rectangle should stay centered and the children in they corners no matter what size the viewer.

Regards, Smooth 8)
Image
smooth
Posts: 1493
Joined: Sat Sep 09, 2006 7:30 pm

Another way to show you how anchors work.

Place a text box in each corner of your skin. (as parents in your tree)

Top Left and anchor it to the top left
Bottom Left and anchor it to the Bottom left
Top Right and anchor it to the top right
Bottom Right and anchor it to the Bottom right

If your stage is set to the same size as your published tour (initially)
When you first open the panorama all objects will be in correct position and when you go full screen they will hold position.
Now if you change the anchor points and re-publish you can see what effect anchors have on your projects.

Regards, Smooth 8)
Image
sportsnapper
Posts: 73
Joined: Tue Jun 22, 2010 10:28 pm

OK thanks - I'll try that.

I guess one of the things I'm looking for is a definition of what some of the numbers in the editor mean as well (again I've hunted through the documentation and I'm afraid I don't think it's clear. It could be my age though....)

Are the x and y co-ordinates always relative to the stage top left?

In the tree there are always two co-ordinates next to the object. Are these the x,y co-ordinates relative to the xy co-ordinate of the parent object?
It seems they are if the anchor is the top left, but if the anchor is different then it looks like that they represent the xy co-ordinates of the object again top left of that object) relative to the anchor position of the container - so a bottom left anchored object would have co-ordinates of 0,0 if it's top left corner were aligned with the bottom left of it's parent. So below I have two rectangles at position 0,0 - but they're not aligned with each other as they have different anchor points.
Image
visual360media
Posts: 198
Joined: Fri Feb 29, 2008 7:22 pm

I also think there seems to be a bit of a bug wheer the x,y co ordinates dont always seem correct. There seems to be xy on the screen, and xy next to object, then
double click and an diff xy appears, sometimes they do not seem to make sense or relate. It seems to help if you move an object using xy and not draggin it!
Just my 2 cents...
Kind regards,

John Goulding
Post Reply