Original Post
I am currently in the planning phase of my next project which is a data driven UI library for games. My plan is develop my own script format and then have a two types of files, a wigdet definition file and a layout file.
The widget definition file will look something like this
The idea with this is that the library will have absolutely no concept of a button or any other type of widget and each widget is created by the user in the definition file. The user will be responsible for rendering and the logic of the widget. All widgets will inherit from a widget interface and the user will register a renderer for each type of widget and an input handler for each type of widget. It will basically be a UI library without the logic and rendering rather providing a framework for managing widgets. I think an approach like this will be more easily tailored to a users specific needs.
What are your thoughts on something like this?
The widget definition file will look something like this
# this is a comment
widget Button:
def:
rect area;
string text;
image normal;
image pushed;
image hover, normal, pushed;
# this is a comment 5
state:
pushed;
hover; # this an inline comment
normal;
animation:
color lineColor;
int speed;
endefThe idea with this is that the library will have absolutely no concept of a button or any other type of widget and each widget is created by the user in the definition file. The user will be responsible for rendering and the logic of the widget. All widgets will inherit from a widget interface and the user will register a renderer for each type of widget and an input handler for each type of widget. It will basically be a UI library without the logic and rendering rather providing a framework for managing widgets. I think an approach like this will be more easily tailored to a users specific needs.
What are your thoughts on something like this?