| 59 | /** Creates a Widget subclass with its center at a position. */ |
| 60 | template <class TWidget> |
| 61 | TWidget* createWidgetCentered(math::Vec pos) { |
| 62 | TWidget* o = createWidget<TWidget>(pos); |
| 63 | o->box.pos = o->box.pos.minus(o->box.size.div(2)); |
| 64 | return o; |
| 65 | } |
| 66 | |
| 67 | |
| 68 | /** Creates an SvgPanel and loads the SVG from the given path. */ |