It appears that the problem with clipping of widgets when using Viewports may still exist for widgets inside Panels if the the Panel is positioned anywhere other than the origin? Please see minimum code.
#include <SFML/Graphics.hpp>
#include <TGUI/TGUI.hpp>
#include <windows.h>
int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, INT)
{
// Create Render Window
sf::RenderWindow window(sf::VideoMode(1280,1024), "Test", sf::Style::Fullscreen);
// Set view
sf::View SView;
SView.reset(sf::FloatRect(0, 0, 1280, 1024));
SView.setViewport(sf::FloatRect(0.25f, 0.25f, 0.5f, 0.5f));
window.setView(SView);
// Create GUI
tgui::Gui gui(window);
if (gui.setGlobalFont("Fonts/DejaVuSans.ttf") == false)
return(0);
// Create an empyt/transparent panel to hold a Label
tgui::Panel::Ptr dpanel(gui);
dpanel->setSize(800.0f, 600.0f);
dpanel->setTransparency(0);
dpanel->setBackgroundColor(sf::Color(255,255,255,0));
// Setting Position of Panel at origin works fine
// dpanel->setPosition(0, 0);
// Setting Position of Panel to location other than origin causes clipping of Label within Panel
dpanel->setPosition(200, 200);
// Create Label within panel
tgui::Label::Ptr label(*dpanel);
label->setText("Test Label");
label->setPosition(100,100);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
window.close();
}
else if (event.type == sf::Event::KeyPressed)
{
switch (event.key.code)
{
case sf::Keyboard::Escape:
window.close();
break;
}
}
gui.handleEvent(event,false);
}
tgui::Callback callback;
while (gui.pollCallback(callback))
{
// Do event handler for gui here
}
window.clear();
gui.draw(false);
window.display();
}
return(0);
}