Overlay
Overlay[{expr1,expr2,…}]
displays as an overlay of all the expri.
Overlay[{expr1,expr2,…},{i,j,…}]
displays as an overlay of expri, exprj, ….
Overlay[{expr1,expr2,…},{i,j,…},s]
allows selections to be made and controls to be clicked in exprs.
Details and Options
- The expri can be graphics, text, or any other expressions.
- In Overlay[{expr1,expr2,…}] the later expri are rendered on top of earlier ones.
- Overlay[exprs] is equivalent to Overlay[exprs,All,None] and displays as an overlay of all the exprs.
- Overlay[exprs] by default allows no selection within the exprs.
- The following options can be given:
-
Alignment {Automatic,Automatic} how to align objects in the display area Background None background color to use BaselinePosition Automatic what to align with a surrounding text baseline BaseStyle {} base style specifications for the displayed object ContentPadding True whether to shrink the margins tightly around the contents FrameMargins Automatic margins to leave inside the overall frame ImageMargins 0 margins around the image of the displayed object ImageSize Automatic the overall image size for the displayed object - With the default option setting ImageSize->Automatic, Overlay leaves space only for the expri currently being displayed.
- With the option setting ImageSize->All, Overlay always leaves space for the largest of the expri to be displayed, so that its overall size does not change.
- The settings for BaseStyle are appended to the default style given by the "Overlay" style in the current stylesheet.
Examples
open allclose allScope (5)
Generalizations & Extensions (1)
Overlay with a single element is similar in behavior to a PaneSelector:
Options (5)
Applications (3)
Possible Issues (2)
Expressions in front may completely obscure expressions behind them:
Using transparency or removing background colors might achieve the desired appearance:
Overlay prevents tooltips not in the active layer from firing:
Use the third argument to specify the layer where tooltips should be active:
Neat Examples (2)
Use Overlay to make a fading transition effect:
Create a decorative frame for a 3D object which can still be rotated:
Text
Wolfram Research (2010), Overlay, Wolfram Language function, https://reference.wolfram.com/language/ref/Overlay.html.
CMS
Wolfram Language. 2010. "Overlay." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Overlay.html.
APA
Wolfram Language. (2010). Overlay. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Overlay.html