pub struct MenuSkin {
pub panel: NineSliceImage,
pub buttons: ButtonSkin,
pub scrim: AtlasImage,
}Expand description
Re-exported for the same reason: menu_skin returns a MenuSkin, and
a caller that can name this crate’s menu art should not have to add a second
dependency to lay out and draw the menu it skins. It is also what lets an
end-to-end suite that depends on this crate take a golden image of the real
menu rather than of a replica.
The pictures a menu is drawn with: a window frame, a button frame per state
and the scrim behind them, all registered in one ImageAtlas.
Every sample’s menus use the one crcbl-render ships; see
crcbl_render::menu for why the art lives there.
Menu::render binds the panel and the three button images under the
names default.css’s menu rules give them, and the sheet cuts each at its
own border-image-slice: the insets a NineSliceImage carries are the
art’s, which PANEL_INSETS and BUTTON_INSETS restate for the layout
and the sheet’s slices are held to.
Fields§
§panel: NineSliceImageThe window frame, nine-sliced round the panel.
The button frames.
scrim: AtlasImageStretched over the whole framebuffer and tinted by the sheet’s
.menu-scrim colour, so the art decides its texture and the sheet how
dark it gets.