Comments (4)
Moving the resource handing out of the widgets has one big problem: the texture manager.
If you load with custom code then the texture manager can't keep track of what you have loaded already and which part it still has to read from the disk.
I have been thinking about this before. The best option probably to provide a method to pass a sf::Texture instead of a filename. Then you just have to store the sf::Texture yourself and keep it alive.
I will be looking at theme files in v0.7 anyway.
I am already planning to allow custom loaders. You would be able to load the theme file yourself (thus choose your own syntax) and then pass the needed information to the widget renderer.
This would allow you to load stuff from the zip archive yourself, load it in a Texture and then pass that Texture to tgui (you will probably have to keep the texture alive yourself somehow).
But writing such a loader would contain pretty ugly code. But at least it would be reusable by other people and it allows doing custom stuff.
from tgui.
Yeah or you implement a standard loader within the GUI library which still works with a simple Resource folder variable and manages the textures. And if people like me need there own loader they have to take care of that. (Most game developers have a TextureManager anyways so there is no real need for the GUI library to implement it too).
from tgui.
Since tgui v0.7 will come with a built-in white theme which doesn't require any external images, it should be doable to move the loading code (and perhaps also the texture manager) to a separate file which you include optionally.
There will probably be almost a year between now and the actual implementation. I will just see what I end up with, so many other changes have to be made first.
from tgui.
It hasn't really been tested yet, but this should be possible with the new loading system.
from tgui.
Related Issues (20)
- Setting a widget's index in a layout doesn't seem to update it until the layout is resized HOT 1
- A Few SubwidgetContainer Issues HOT 4
- Ability to Rename MessageBox Buttons HOT 3
- Gamepad support? HOT 5
- Autocomplete support for EditBox HOT 2
- Can not input CJK words HOT 9
- Black background shown when changing window size HOT 4
- How to customize the window's title bar and frame HOT 2
- How to implement a polygon window HOT 2
- Hover style does not disappear when mouse moves out of the window HOT 6
- Add a 2d chart or rendering 3d data for TGUI? HOT 1
- Chinese support? HOT 5
- Focus Issues HOT 1
- [ANNOUNCE] The TGUI now distributed via MSYS2 on Windows HOT 1
- CMake fails to install pkg-config files HOT 2
- On macOS, Input Method Editors(IME) behavior seems incorrect. HOT 6
- How to use SDL2/3 backend with cmake `FetchContent` HOT 2
- [Question] How to compile my first example of TGUI ? HOT 13
- [Bug] Dead radio button text HOT 3
- [Bug] Tabs state after disabled tab click HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tgui.