Ok, thanks, i will try it.
Question: It does matter what tgui version i ll use? I am using the 0.7.5 one in my projects.
Question: It does matter what tgui version i ll use? I am using the 0.7.5 one in my projects.
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 Menu
//-----------------------------------------------------------------------
sf::RectangleShape line(sf::Vector2f(1, 800));
line.setFillColor(sf::Color::Black);
line.setPosition(sf::Vector2f(0, 1));
pWindow->setActive(false); //pWindow is the main sf::RenderWindow
pCanvas = tgui::Canvas::create({ 5, 300 });
pCanvas->setPosition(200, 70);
pCanvas->clear(sf::Color(194, 206, 200));
pCanvas->draw(line);
pWindow->setActive(true);
pCanvas->display();
pWindow->setActive(false);
sf::RenderTexture *pTex = new sf::RenderTexture();
pTex->create(128, 128);
SAFE_DELETE(pTex);
pWindow->setActive(true);
//cpp
//-----------------------------------------------------------------------------
cForm::cForm() :
{
sf::RectangleShape line(sf::Vector2f(1, 800));
line.setFillColor(sf::Color::Black);
line.setPosition(sf::Vector2f(0, 1));
pCanvas = tgui::Canvas::create({ 10, 800 });
pCanvas->setPosition(330, 70);
pCanvas->clear(sf::Color(194, 206, 200));
pCanvas->draw(line);
pCanvas->display();
GAME_MANAGER->getGui()->add(pCanvas);
}
cForm::~cForm()
{
GAME_MANAGER->getGui()->removeAllWidgets();
//-->the crash problem
}
//h
//-----------------------------------------------------------------------------
class cForm
{
public:
cForm::cForm();
~cForm();
private:
tgui::Canvas::Ptr pCanvas;
}