Are you using the sfml libraries provided in the tgui download? Because the precompiled tgui libs will only work with that specific sfml version.
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 MenuQuoteAdditional Library Directories: C:\SFML-2.1\lib; C:\TGUI-0.6.1\lib\TGUI; C:\TGUI-0.6.1\lib\SFMLI think you should try to remove "C:\SFML-2.1\lib" from that list. It probably first finds sfml 2.1 before the sfml version shipped with tgui.
QuoteC:\SFML-2.1\includeYou should remove this too. Although these files are probably still the same, you should take the ones that ship with tgui.
QuoteThe screenshots are outdated. You only need one include directory "TGUI_Path/include". The library directories should be "TGUI_Path/lib/SFML" and "TGUI_Path/lib/TGUI".
Quotewhen i use callback.text=="Open" only the first method will be calledI'm not sure what you mean with this.
this->moveTile
void moveSprite(tgui::Slider::Ptr slider, sf::Sprite& sprite, int minY, int maxY)
{
// Puts the sprite on position minY when the slider has value 0,
// on position maxY when the slider has its maximum value,
// and somewhere inbetween otherwise.
// Note that this formula will only work when the minimum of slider is 0, otherwise it has to be changed.
sprite.setPosition(sprite.getPosition().x, minY + (slider->getValue() / (float)slider->getMaximum()) * (maxY - minY));
}
// Let the slider call the moveSprite function when its value changes.
// The sprite will be placed between Y position 20 and 100, the X position will remain unchanged here.
slider->bindCallback(std::bind(moveSprite, slider, std::ref(sprite), 20, 100), tgui::Slider::ValueChanged);
// pointerToMyClassInstance will be 'this' when this line is inside a function of MyClass.
slider->bindCallback(std::bind(&MyClass::moveSprite, pointerToMyClassInstance, slider, std::ref(sprite), 20, 100), tgui::Slider::ValueChanged);