SHIP:Property:displayable:opacity

From Serious Documentation
Jump to: navigation, search

Node: All Displayable Nodes

Property Data Type Description
opacity Byte Opacity of the displayable node and all its children, grandchildren, etc.

The opacity property affects the opacity/transparency of the node and all the displayable nodes within it. Values can range from 0 to 255, with 0 being completely transparent and 255 completely opaque.

An opacity value of 0 is visually identical to setting the visible property of a displayable node to false, however (unlike when visible is false), all touch listeners anywhere within the subtree will continue to function normally. This allows hidden touch areas to be created, or completely invisible touch overlays. Note that this same effect can be made with a fully opaque object that has no colors set.

The opacity property is carried down through layout area nodes, and multiplies as it goes. For example, setting opacity to 50% (128) on a box and, similarly, to value 50% (128) on a child box of that parent will cause the child box to have net opacity of 25%. In this manner, setting any box to a semi-opaque state will have the effect of making the whole subtree's opacity scale appropriately.

There is no way to reset a sub-node to 100% opacity if a direct-line parent's opacity is less than 100%. To achieve this effect, overlay one object over the other as siblings.