22 overlay = createNode<Element>();
23 overlay->
width = RootDisplay::mainDisplay->width;
24 overlay->height = RootDisplay::mainDisplay->height;
25 overlay->backgroundColor = fromRGB(0, 0, 0);
26 overlay->backgroundOpacity = 0x00;
27 overlay->cornerRadius = 1;
28 overlay->hasBackground =
true;
30 vStack = overlay->createNode<
Container>(COL_LAYOUT, 50);
31 vStack->backgroundColor = fromRGB(0xdd, 0xdd, 0xdd);
32 vStack->hasBackground =
true;
33 vStack->cornerRadius = 15;
34 vStack->
width = dialogWidth;
35 vStack->height = dialogHeight;
36 vStack->constrain(ALIGN_CENTER_BOTH, 0);
38 auto innerVStack = vStack->createNode<
Container>(COL_LAYOUT, 50);
39 innerVStack->
width = dialogWidth;
40 innerVStack->constrain(ALIGN_CENTER_BOTH, 0);
44 messageText = innerVStack->createNode<
TextElement>(
"(Placeholder text)", 20, &blackColor, NORMAL, 400);
45 messageText->setText(message);
47 messageText->constrain(ALIGN_CENTER_HORIZONTAL, 0);
50 auto okButton = innerVStack->createNode<
Button>(
"OK", A_BUTTON);
51 okButton->setAction([
this]() {
56 okButton->cornerRadius = 10;
57 okButton->updateBounds();
58 okButton->constrain(ALIGN_CENTER_HORIZONTAL, 0);
void update(bool forceUpdate=false)
update TextElement with changes