Hi Texus,
I just DL'd you v 0.5 and am building it for Code::Blocks, but I'm getting errors. I've fixed most of them, from this:
const sf::Font* EditBox::getTextFont()
{
return m_TextBeforeSelection.getFont();
}
to
const sf::Font& EditBox::getTextFont()
{
return m_TextBeforeSelection.getFont();
}
Changing * to &, as getFont() returns a reference, not a pointer.
(I had to do that for multiple .cpp's, and I modified where it was calling those functions.
But, then I ran into a bigger issue, which I can guess a fix, but I'm not sure. Calling this:
unsigned int Builder::getClickedObjectID(sf::Event& event)
{
// Check if the left mouse was pressed
if (event.mouseButton.button == sf::Mouse::Left)
{
float mouseX = event.mouseButton.x / (mainWindow.getSize().x / mainWindow.getView().getSize().x);
float mouseY = event.mouseButton.y / (mainWindow.getSize().y / mainWindow.getView().getSize().y);
unsigned int highestID = 0;
unsigned int objectID = 1;
#define FindObjectNr(Object, objects) \
for (unsigned int i=0; i<objects.size(); ++i) \
{ \
tgui::Object* object = mainWindow.get<tgui::Object>(tgui::to_string(objects[i].id)); \
\
if (object->mouseOnObject(mouseX, mouseY)) \
{ \
if (highestID < object->getObjectID()) \
{ \
if (highestID > 0) \
object->mouseNotOnObject(); \
\
highestID = object->getObjectID(); \
objectID = objects[i].id; \
} \
} \
}
FindObjectNr(Picture, pictures)
...
Gives me an error because getObjectID() is not defined anywhere. I searched all through the code, and it's not there. I can modify Objects.hpp, add the funciton, add an id, and just, in the constructor, increment a global ID and assign it that way, but I'm not sure what it is supposed to be used for.
Any ideas?
Thanks! Looking forward to using this.