Main Menu
Menu

Show posts

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

Topics - kiwon0905

#1
Test.h
Code (cpp) Select
#pragma once

struct Test
{
void test();
};


Test.cpp
Code (cpp) Select
#include "Test.h"
#include <SFML/Graphics.hpp>

void Test::test()
{
sf::FloatRect r;
}


main.cpp
Code (cpp) Select
#include <SFML/Graphics.hpp>
#include <TGUI/TGUI.hpp>
int main()
{
sf::FloatRect r;
return 0;
}


Hi I'm trying to compile the above code on Visual studio 2017 and I get "error LNK2005: "public: __thiscall sf::Rect<float>::Rect<float>(void)" (??0?$Rect@M@sf@@QAE@XZ) already defined in Test.obj"

The error is gone when I comment out the #include <TGUI/TGUI.hpp>
Is this a problem with TGUI?
#2
Help requests / How to use ScrollablePanel?
18 October 2017, 03:49:28
Code (cpp) Select

auto scrollPanel = tgui::ScrollablePanel::create({ "300", "300" });
scrollPanel->getRenderer()->setBackgroundColor(sf::Color::White);
auto grid = tgui::Grid::create();
grid->setAutoSize(true);

for (int r = 0; r < 100; ++r)
grid->addWidget(tgui::Label::create("h"), r, 0);
scrollPanel->add(grid);
gui.add(scrollPanel);


I'd like the scrollbar to appear when the grid gets bigger than the panel, but I don't see any scrollbar.