Recent Posts

Pages: [1] 2 3 ... 10
1
Help requests / Re: Cast Widget to Radiobutton?
« Last post by Kratos on 19 May 2019, 18:17:21 »
Okay. I tried it like that and it works like a charm!

This is great! Thanks.
2
General Discussion / Re: About TGUI 0.9-dev
« Last post by texus on 19 May 2019, 10:41:38 »
The renderer that I provide (not to be confused with widget renderers) will continue to use SFML for rendering, so it is unlikely that I will add any features not supported by SFML myself. I will of course open for pull requests if someone can add extra functionality.

It may also be possible to completely swap out the rendering code in the future and replace it with your own code, but at this point I can neither confirm nor deny the existence or nonexistence of a Backends/SFML/BackendRendererSFML.cpp file that would contain all actual rendering code.
3
General Discussion / Re: About TGUI 0.9-dev
« Last post by billarhos on 19 May 2019, 10:25:07 »
What about considering using bitmap font rendering and may be using signed distance field (SDF) technique?
4
General Discussion / Re: About TGUI 0.9-dev
« Last post by texus on 19 May 2019, 09:48:03 »
Quote
May be you meaning milliseconds?
You are right, it should have been milliseconds (I edited the post now). That's what you get when quickly writing a post at the end of the day.

Quote
What happens in future if tgui texts have outline color?
In order to batch texts, I couldn't use the sf::Text class and had to implement what sf::Text does in my code. I removed things related to outline because it couldn't be set anyway, but I could add it back when support gets added (and it won't interfere with the batching as it is rendered together with the text). I'm still not sure how to give more control in rendering, this is one of the outstanding issues that I want to solve in TGUI 0.9.

Quote
Will this be configurable, meaning select the way tgui renders?
I'm not sure how the relation between widget and renderer will eventually look like. Maybe it will end up being the same as now but with the drawing code split in multiple functions inside the renderer, so that you just have to inherit the renderer and override one function to draw slightly differently. I've been too busy with the batch renderer until now to look into the other parts of the code that needs changing. And the batch renderer still needs some finishing touches before I can start on other parts of the code.
5
General Discussion / About TGUI 0.9-dev
« Last post by billarhos on 19 May 2019, 08:46:14 »
Hi Texus. Read in facebook about TGUI 0.9-dev and batching rendering. This is awsome!

In your post:
Quote
In release mode, TGUI 0.8 takes 0.25 seconds to render it while TGUI 0.9-dev reduces this to just 0.08 seconds (on a laptop with intel graphics).

One quarter of a second is too much time to render those few widgets. May be you meaning milliseconds? I have never seen those times in all past and current tgui versions.

Will tgui 0.9 continue to work as it is now? Will this be configurable, meaning select the way tgui renders?

What happens in future if tgui texts have outline color?



6
Help requests / Re: Cast Widget to Radiobutton?
« Last post by texus on 17 May 2019, 18:21:36 »
Widget pointers are of type std::shared_ptr (tgui::Widget::Ptr is just an alias for std::shared_ptr<Widget>), so you shouldn't just cast them to raw pointers.You could call the .get() function of std::shared_ptr<T> to get a T* which you can then cast with a dynamic_cast (or with a c-style cast like you are doing), but it isn't meant to be used like that.
You can cast std::shared_ptr objects with std::dynamic_pointer_cast but to make things shorter widgets have a cast function that does it for you. So you can write something like
tgui::RadioButton::Ptr = widget->cast<tgui::RadioButton>();

There is actually a get function that takes a template parameter and does the cast for you, so what you want is as simple as
NewGameMenu->get<tgui::RadioButton>("radTom")->isChecked()
7
Help requests / Cast Widget to Radiobutton?
« Last post by Kratos on 17 May 2019, 13:57:34 »
Hi Texus!

First, thank you for your amazing Library, I'm using version 0.8.5 now.

I used the gui builder to create a form, and in my code I'ld like to see if a checkbox (or radiobutton) is checked or not. I tried the following:
if (((tgui::RadioButton*)((tgui::ClickableWidget*)NewGameMenu->get("radTom"))->isChecked()) but unfortunately without success.

Is there something special I have to do to cast from a pointer to a widget to a Radiobutton? Because it doesn't inherit directly from Widget.

Thank you,

Tom.
8
General Discussion / Re: Updating existing Picture widget
« Last post by texus on 15 May 2019, 22:09:56 »
The texture became part of the renderer in 0.8, so you can use picture->getRenderer()->setTexture(...)
9
General Discussion / Updating existing Picture widget
« Last post by ingar on 15 May 2019, 22:08:19 »
Hi again,

I have this scenario:

I receive a .jpg file image on TCP/IP from an external server.
So I have a byte buffer (with a given length) containing the jpg file.

So how do I update an existing Picture widget from this buffer?

I know how to create a NEW Picture widget from a buffer, using an sf::Texture in the constructor,
but isn't it a bit overkill to create a new one every time? I saw that a function tgui::Picture::setTexture was available
in version 0.78, but this function has been removed in the latest version (0.85).

Ingar
10
General Discussion / Hide button
« Last post by asuchi on 15 May 2019, 13:36:30 »
Hello,

I try to hide 3 radio ... but only the last was hidden ...

Someone have a sample code to help me ... i read the documentation but i don't understand how to make with "panel" or "group" to link my 3 buttons

sorry for my english ;)



Edit by texus: A reply to this question was send on discord
Pages: [1] 2 3 ... 10