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 - Xdesign

#1
Help requests / Custom tgui::Signal functions
27 February 2022, 20:21:53
Hello!
Im wondering how can i create custom functions like onSizeChange()?
Im trying to create something like Task::onStateChange().
In my Group class i have array of tasks.
Group::pushTask(){
     tasks.push_back(Task::create());
     tasks.[tasks.size-1]->onStateChange(&Group::TaskStateChanged,this,tasks.size()-1);
}
Group::TaskStateChanged(int index){
     tasks[index]->....
     ...
}
So when task changes state in scope Group::TaskStateChanged will be called.

Thanks!

#2
Help requests / Custom Widgets and Themes
17 January 2022, 22:28:45
I've looked up almost every page there is on themes and renderers and im really stuck!
I've made a lot of custom widgets with most of them direved from tgui::Panel.
Im currently making theming system and i cant figure how to load custom widgets from theme file.
I made this and is working:
deafult.txt (Theme file)
TaskCard{
  BackgroundColor = (0,0,0);
  ...
}
with setRenderer(theme->getRenderer("TaskCard"));
But how to load children?
I mean what i got working is for every Custom widget i have seperated name in theme.txt like:

TaskCard{
...
}
TaskCard>Group{
...
}
TaskCard>CheckedGroup{
...
}

This is what im trying is to load them the way they are supposed to be loaded:
TaskCard{
    BackgroundColor = (0,0,0);
    ...
    CheckedGroup = {
        BackgroundColor = (0,0,0);
        ...
    }
    UnavailableGroup= {
           BackgroundColor = (255,0,0);
           ...
    }
}
I guess with custom widgets i need custom renderers?
#3
Help requests / OnSizeChange() difference
15 January 2022, 20:33:25
Is there a way to get difference of new size - old size on size change?
I made a custom container similar to tgui::Grid and i want it to resize auto on child resize function
I mean i can store old size and just subtract it but i saw this "The size of the widget changed. Optimal parametar : new size" on definition of OnSizeChange()
I dont get where this parametar goes and how to do it
Thank you in advance!
#4
Help requests / Drawing Shapes within gui
28 December 2021, 21:10:15
Can i draw sf::RectangleShape or any other shape within custom widget?
Is there a way for me to draw shapes in order like elements of container are drawn in order?
Like, if i make custom widget that inherits from tgui::Panel i see that i cant override draw function.
basically what i want is to draw everything from tgui::Panel and then draw my shapes.

Sorry for frequent questions but im relatively new :)
#5
Feature requests / Animations
22 December 2021, 21:38:07
I've got couple of questions.
First:
      Is it possible to add animations on setSize() and setPosition()?
      I think it'll make a great addition!

Second:
      BoxShadows? is it possible? I tried adding it to my project with sf::Vertex,
      but i figured its gonna take me a lot of time because its to complex for me.

Third (least important):
      Can you add sf::Vector2f support for setSize() setPosition() as well?
      I have to add x and y separately every time.

I do understand this gui is supposed to be simple, but can you atleast help me on how to implement my own animations?
I am enjoying tgui very much tho :D
Thank you in advance!
#6
Feature requests / Rounded borders for containers
15 November 2021, 18:55:08
I've noticed non of the containers have setRoundedBorderRadius() method. Thinking it wouldn't be hard to implement since button class already has it and would be essential to modern ways of ui design. Im a missing something or is it really not in tgui?