This project is deprecated and will no longer be maintained. It is kept here for demostration purpose only. If you are looking for a UI GUI framework for your game, there are plenty alternatives. Choose the one suits you the best.
mUI is a 2D game GUI based on HGE, in C++, similiar to WinForm .NET.
mUI is has implementation of C# delegate
, and adopt same event driven model and threading interface as WinForm .NET.
It's a prototype for finding a delegent way to design UI in C++, despite of its unoptimized code.
The way to add UI widget and listen to event is just the WinForm way in C++:
void MGameView::InitializeComponents()
{
SuspendLayout();
set_Text(L"Mine Game v0.1");
set_DragMove(true);
Controls.Add(_d->gameButton);
_d->gameButton.set_NormalImage(L"res/smile.png");
_d->gameButton.set_PressedImage(L"res/smile_pressed.png");
_d->gameButton.set_Size(Size(24, 24));
_d->gameButton.Click += EventHandler<>(this, &MGameView::OnGameButtonClicked);
Controls.Add(_d->fieldView);
_d->fieldView.Uncover += SquareEventHandler(this, &MGameView::OnSquareUncovered);
_d->fieldView.ToggleFlag += SquareEventHandler(this, &MGameView::OnSquareToggleFlag);
_d->fieldView.SquareMouseDown += MouseEventHandler(this, &MGameView::OnSquareMouseDown);
_d->fieldView.SquareMouseUp += MouseEventHandler(this, &MGameView::OnSquareMouseUp);
Controls.Add(_d->remainMines);
_d->remainMines.set_Location(Point(5, 5));
_d->remainMines.set_Size(Size(39, 24));
_d->remainMines.set_Anchor(AnchorStyles::TopLeft);
ResumeLayout(true);
_d->configForm->Show();
}
There are 2 demos using mUI:
The classic Windows game with exact same apperance.
A visually demo of quick sort, with a worker thread sorting the array while showing sort steps on screen.
Rendering: HGE
Font: FreeType
Testing: googletest
googlemock