Title says it all.

1. Is it possible to use sql libs, take something from databases and assign value/valuess to widet like combobox? If its possible i will learn myself how to do that :)

2. Lots of data/resources i needed for application is scatered in folder, i know i can arrange them into folders like
Data/Pictures
Data/Buttons etc etc etc
But is it possible to add libs like physfs ? And can tgui load from memory? I know sfml can loadFromStream, but is this possible with tGui?

thanks in advance
wmbuRn

*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: sfml and tgui with databases and loading from .zip files
« Reply #1 on: 11 July 2013, 11:04:11 »
1)
TGUI won't interact with your database, so you'll have to just load the values from the database yourself and then call the corresponding functions to set the value in the tgui widget. But I've never worked with databases before so I can't help much with this.

2)
If you have one config file in the Data folder, then you should give a relative pathname to the images. So button would have the following property:
NormalImage  = "Buttons/Image.png"

Another option would be to have config files for every type of object. So you have a config file in Data/Buttons that only contains the Button section, and you have another config file in Data/Checkboxes that has the Checkbox section and so on. Then you can just have:
NormalImage  = "Image.png"

So the config files can be seperate files or a single file and they contain a relative path to the images. So it shouldn't be to hard to make different folders. The BabyBlue.conf loads different images from different folders, so you might want to take a look at it to see an example.


About the loading from memory...
This isn't supported yet. I'll look into this to see if it can be done easily. If it isn't too much work then I'll add it to v0.6 but if I would have to make a lot of changes then it will be delayed to the next version.

Edit:
Loading from memory is just not possible with the current design. The whole texture managment is build on top of the fact that images are loaded from files. So I would have to find a new design for the texture managment and I would have to change the config files to support this. I'm not even sure if I will be able to add this to the next version.
« Last Edit: 11 July 2013, 12:00:09 by texus »

Re: sfml and tgui with databases and loading from .zip files
« Reply #2 on: 11 July 2013, 16:39:39 »
1. Will report back when start adding sql to projects. So far i am still a newb in SFML and tGui.

2. Yup i allready separated folders and set locations in code to load config files, and separate config for each .png file. WIll try to add hoverImage and other stuff i need for buttons latter today
Quote
Loading from memory is just not possible with the current design. The whole texture managment is build on top of the fact that images are loaded from files. So I would have to find a new design for the texture managment and I would have to change the config files to support this. I'm not even sure if I will be able to add this to the next version.

Dont worry about it. :) you allready made awesome lib for gui :) Thank you for your answer :)