public static Event BuildRedButton(this ImGui gui, string text) { Rect textRect; TextCache cache; using (gui.EnterGroup(DefaultButtonPadding)) textRect = gui.AllocateTextRect(out cache, text, align: RectAlignment.Middle); var evt = gui.BuildButton(gui.lastRect, SchemeColor.None, SchemeColor.Error); if (gui.isBuilding) { gui.DrawRenderable(textRect, cache, gui.IsMouseOver(gui.lastRect) ? SchemeColor.ErrorText : SchemeColor.Error); } return(evt); }