MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / buildTooltip

Method buildTooltip

source/frontend/StarSimpleTooltip.cpp:9–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace Star {
8
9PanePtr SimpleTooltipBuilder::buildTooltip(String const& text) {
10 PanePtr tooltip = make_shared<Pane>();
11 tooltip->removeAllChildren();
12 GuiReader reader;
13 reader.construct(Root::singleton().assets()->json("/interface/tooltips/simpletooltip.tooltip"), tooltip.get());
14 tooltip->setLabel("contentLabel", text);
15
16 auto stretchBackground = tooltip->fetchChild<Widget>("stretchBackground");
17 stretchBackground->setSize(Vec2I{tooltip->fetchChild<Widget>("contentLabel")->size()[0] + 8, stretchBackground->size()[1]});
18 tooltip->setSize(stretchBackground->size());
19
20 return tooltip;
21}
22
23}

Callers

nothing calls this directly

Calls 9

singletonClass · 0.85
removeAllChildrenMethod · 0.80
jsonMethod · 0.80
assetsMethod · 0.80
setLabelMethod · 0.80
constructMethod · 0.45
getMethod · 0.45
setSizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected