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

Messages - heaven31415

#1
In that case, if it is not yet implemented I would like to propose something.
Normally setOrigin function is just taking x and y coordinates in local coordinate system, however in my opinion it would be very handy to have another overload.
This overload should take two std::string arguments which would determine the position of the origin.

First std::string should take only 3 possible values: "Left", "Middle", "Right", second one should take another 3 values: "Top", "Middle", "Bottom". This gives you 9 very easy to set origin points which are very often used (from my experience).

Code (cpp) Select
Widget widget;
widget->setOrigin("Middle", "Middle");


What do you think about it?
#2
Hello, I was wondering whether I can find something similar to SFML setOrigin method inside of TGUI library. As far as I can see in TGUI by default the origin is on the top left corner of widget (same as in SFML), however it is very nice sometimes to change it. For example to center point of widget, how should I approach this problem?
#3
Thanks for help, I'll look into that.
#4
Hello folks. I have a problem with understanding why this code isn't working: https://pastebin.com/BsGwvZab

This code is:
1. Creating chatBox widget.
2. Creating sf::Thread with function receiveMessage which is accessing chatBox every 100 milliseconds.
3. Repeatedly updating / clearing / drawing chatBox widget.

From debugging I know this: Unhandled exception at 0x7761E066 (ntdll.dll) in TGUI Forum Bug Example.exe: 0xC00000FD: Stack overflow (parameters: 0x00000001, 0x06C72FFC).

I know also that line 11 (look at pastebin code) is cause of the problem. In this line I'm trying to call tgui::ChatBox::addLine from sf::Thread instance. I don't understand completely why this is happening, I think that probably there is a race condition between two threads which should be avoided.

Information about my hardware and software:
a) OS: Windows 7 Ultimate 64-bit with SP1
b) Compiler: Visual Studio 2015 with Update 2
c) TGUI and SFML: built from source ( SFML commit: e00d160), both linked dynamically.

If you are missing any important information that is necessary to help, just tell me - I will try to provide it as fast as I can.