Perfect, thanks!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menulabel->setAutoSize(true);
label->setPosition(screenSize.x / 2.f - bindWidth(label)/2.f, YVALUE);
'&': illegal operation on bound member function expression
// stateMainMenu.cpp
void stateMainMenu::Init(gameEngine* game) {
tgui::Button::Ptr buttonQuit = std::make_shared<tgui::Button>();
buttonQuit->connect("clicked", &(game->Quit), &game); // Crash Here
gui.add(buttonQuit, "buttonQuit");
}
// gameEngine.h
class gameEngine {
public:
//Other Stuff
bool Running() { return isRunning; }
void Quit() { isRunning = false; }
private:
bool isRunning;
};
Quote from: texus on 28 February 2016, 09:17:45That's what I meant, thanks
The values are (LEFT, TOP, width, height) but for the Middle rect it should be noted that it is relative to the Part rect (if Part rect is given).
Quote from: texus on 28 February 2016, 09:17:45Amazing, that'll really speed things up for me. Thanks for the help.
The Part and Middle rect are both optional, to load the image from a separate file, just write the following:NormalImage : "ThemeNormalImage.png";
Button {
NormalImage : "ThemeNormalImage.png" Part(whatever) Middle(whatever);
HoverImage : "ThemeHoverImage.png" Part(whatever) Middle(whatever);
DownImage : "ThemeDownImage.png" Part(whatever) Middle(whatever);