SHIP:Property:box:object

From Serious Documentation
Jump to: navigation, search

Node: box

Property Data Type Description
object Reference:box,image Attaches to the box another object from the resources area, typically an image.

A box in the layout area can have an "attached object" from the resources area.

The attached object must be one of the following node types:

Attached box Nodes

When the attached node is a box node in the resources area, the attached node acts like a template supplying any unset properties to the box in the layout area. Any set property in the main box overrides any set property in the attached box.

For example, consider a box in the layout area with the bgcolor color property left unset, but the object pointing to a box node in the resources area with the bgcolor color property set to 0xFFFF0000 (fully opaque red). The box in the layout area will render with an inherited red background color. If, then, the main box's bgcolor is set to 0xFF00FF00 (fully opaque green), the attached box's bgcolor will not be used since the main node has that property already set.

Attached image Nodes

When the attached node is an image node in the resources area, the attached image is displayed inside the main box. If the image is smaller than the box's margin area, it is centered within the box's margin area. If it is equal in size or larger, it is displayed starting in the upper left corner of the main box's margins and clipped if necessary on the bottom right edges.

The Box Model properties of the attached image can supply properties to the box in the layout area if that box does not have those properties set. Any set property in the main box overrides any set property in the attached image.

For example, if an attached image has oh of 32 and ow of 48, and the main box has these properties unset, then the main box will inherit this height and width from the attached image. If the main box's oh is set to 48 (for example), then the main box will now have outer height and width of 48 and the attached image will be vertically centered in the (now taller) box.