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.

Topics - netrick

Pages: [1]
DotNet / Will the binding be up-to-date?
« on: 03 November 2013, 11:31:20 »
Do you want the .NET binding to be up-to-date with the C++ version or it will lag a bit?

Coz I'm moving everything but my server from C++ to C# and programming is fun again :D

DotNet / Linux usage
« on: 31 July 2013, 09:42:39 »
TGUI requires Tao.OpenGL (dll files are included), which means that you will have to add a dllmap just as you had to do for sfml. You can put this inside /etc/mono/config.

I think it's a very bad thing. You should tell people to use local config file in app's directory.
The main reason is redistributing an app.

General Discussion / Basic auto resizing is working!
« on: 21 July 2013, 19:55:10 »
My basic auto resizing is up and running. When the window resizes, widget can change it's position and size.

class ResizeBehaviour
        bool changeX = false;
        bool changeY = false;
        bool changeWidth = false;
        bool changeHeight = false;

In my main Gui class (which controlls callbacks etc) I have:
std::vector<std::pair<tgui::Widget::Ptr, ResizeBehaviour>> m_widgets;

ResizeBehaviour & addWidget(tgui::Widget::Ptr wptr);

I use it like this inside gui class:
tgui::Wiget::Ptr widget(tgui);
auto rb = addWiget(widget);
rb.changeWidth = true;
rb.changeHeight = true;

And then when resizing, the widget keeps its position but changes its size according to resize delta.
There is simple code which does this:
if (m_app.input.isResized())
                auto delta = m_app.input.getResizeDelta(); //it's vector2i
                for (auto &i : m_widgets)
                        auto position = i.first->getPosition();
                        auto size = i.first->getSize();
                        if (i.second.changeX)
                                i.first->setPosition(position.x + delta.x, position.y);
                                position = i.first->getPosition();
                        if (i.second.changeY) i.first->setPosition(position.x, position.y + delta.y);
                        if (i.second.changeWidth)
                                i.first->setSize(size.x + delta.x, size.y);
                                size = i.first->getSize();
                        if (i.second.changeHeight) i.first->setSize(size.x, size.y + delta.y);

It works very well. It's nothing like fancy layouting but it does its job and doesn't force you to write hundreds of onResize functions (I used to do that, meh!). Actually with little effort I have now a nice resizable layout in my gui!

Now my question is if you'd like to see it in TGUI (for example until you write layouting which as you said won't be complete in 0.6). We could discuss how I can change it to integrate it into TGUI in clean way.
Of course I understand that it isn't commonly used way to handle resizing - I created it for my very specific needs. So tell me what you think, if it's worth to implement something like that inside TGUI.

General Discussion / Widget config files bug
« on: 19 July 2013, 09:28:42 »
I think it's a bug:

- in widgets/Slider2D there is black.conf file (there should be just one global I think)
- in widgets/Slider2D there is no BabyBlue folder
- in global BabyBlue.conf and Black.conf there is no mention of slider 2D

Check it out yourself.

Feature requests / Label - set size
« on: 17 July 2013, 17:53:42 »
I think that editbox does it (and probably chatbox as well).

Label should allow to set its size and if the text doesn't fit inside it then the text will be cut (very important step to implement resizing). The same should apply to text on buttons etc.

What do you think?

Gui libs like QT etc implement this.

General Discussion / Semi-automatic resize handling by widgets
« on: 17 July 2013, 16:57:15 »
I'm currently working on something I really need and I call it "semi-automatic resize handling". The idea is very simple:

classs GuiManager
   std::map<tgui::Widget::Ptr, ResizeBehaviour> widgets; //I store pointers to widget in this class

struct ResizeBehaviour
  bool changeX = false;
  bool changeY = false;
  bool changeWidth = false;
  bool changeHeight = false;

Then we have function:

GuiManger::handleResize(int deltaX, int deltaY) //called when resize SFML event happens
   //when a widget has for example changeX set to true
   //then widget->x += deltaX etc.

This allows for very basic layouting (altough I use similar method and it works very well for handling resizing in gui!).
My problem is that tgui::Widget doesn't have virtual set/get Size function. Thus I can't make it as simple as in the above code.

What is the reason why there can't be even empty virtual setSize function in widget? Basically every widget has its size (unless it's container widget and then we can happily don't implement the virtual function body).

It's very simple way of handling basically the biggest TGUI problem (at least for me) and after some tuning (this code isn't really integrated into TGUI) I could write a patch.

However I really need that size in tgui::Widget class. Is it possible to place empty virtual function in the class? I think it won't hurt.

If it's not possible, do you have any other idea how I can workaround it?

General Discussion / C# binding
« on: 13 July 2013, 20:44:26 »
How is C# binding doing? I'm asking because I fall in love with C#, it's so easier and faster to code and I'm thinking about porting my app to but I use tgui heavily so I need it too.

Feature requests / Child windows again
« on: 13 July 2013, 10:46:28 »
Okay, after some profiling with a lot of objects I found manually keeping child windows in place is a little bottleneck and it's not very clean solution to iterate through thousands of gui objects every frame to check them type in my code.

Simple solution:
- child window has property like enum keepInPlace - inWindow, inPanel, dontKeep (default).
- when child window is forced to change its position, it makes sure it's in place using my simple code which actually works

Maybe not the cleanest possible solution, but it won't hurt and will be so damn useful for me.

If you agree I can submit a simple patch later today. It will be just optional feature and default it will be turned off.

There is a possibility that object doesn't have acces to window - in that case, it will just keep itself in its container. I need your feedback here.

Help requests / Loading object position etc from file
« on: 03 July 2013, 12:37:40 »
Is there any tutorial how exactly file with widget's position etc should look like?

I don't mean a theme file. I mean a file where I can put widget name, type, size, position etc so I can change most basic things without recompilation.

I wanted to create AngelScript wrapper of TGUI so I could handle GUI by scripts, but I found info about loading object positions from file on TGUI's site so I think it may be easier for me. I just can't find info about it.

Help requests / Object layout example
« on: 01 July 2013, 17:56:58 »
I wanted to ask you about adding basic layouts to tgui (because manually resizing widgets was a PAIN in my code), but I've just realised that they had been added.

Could you write some simple example code how to use them properly?

Help requests / Documentation for TGUI config files
« on: 30 June 2013, 17:00:10 »
Is there any documentation for config files? I mean a list of attributes which every object can have.

General Discussion / 0.6-testing merge to master
« on: 28 June 2013, 21:11:52 »
When will 0.6-testing be merged to master? I think having two development branches is a little confusing.

Installation help / Github snapshot doesn't compile
« on: 06 May 2013, 11:07:28 »
In file included from TGUI-master/src/TGUI/Group.cpp:26:0:
TGUI-master/include/TGUI/TGUI.hpp:58:25: fatal error: TGUI/Form.hpp: No such file.

Could you solve it? I reinstalled my OS and now I can't get tgui working and compile my project.

Website / A few suggestions
« on: 03 May 2013, 20:41:47 »
1) You should change theme completely or install something more used like phpbb which is much more polished. Right now it looks ugly and especially under linux the fonts look really bad (and for example SFML forum looks great under ubuntu).
It looks nice and clean under windows, but not on linux.

2) You should add quick register option next to login - ie without opening new page, just type login, email and password and you are instantly registered.

Pages: [1]