Skip to main content
GameDev.net gamedev.net
🔒 Locked

Data Driven UI Model

Started by Emerican360 Sep 24, 2011 at 11:32 AM 0 replies 1k views
Original Post
Emerican360
Emerican360
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

# 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;
endef


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?
Antheus
Antheus
My plan is develop my own script format[/quote]

Can't wait. Yet another language designed evolutionary with no tooling or standardization. But as they say, you can never have enough formats and languages.

It will basically be a UI library without the logic and rendering rather providing a framework for managing widgets.[/quote]

So it's like homeopathy. Take the usual concepts, then remove everything that has actual value until left with nothing?

What do I get by using this? Why do I need to reinvent dirty rectangles, Z-order, scaling, font alignment and kerning and everything else that is available for free in every existing framework, just so I can use some script?

will be more easily tailored to a users specific needs.[/quote]

Of course, since the user will need to do everything. Why do I need this format again?

What are your thoughts on something like this?[/quote]

Stop inventing languages, formats and scripts. If it needs to be a language, there's Lua, Python, Ruby, JavaScript. If it needs to be a format, there's JSON or XML.

Now I no longer need to write a parser or interpreter (yet again) for this (yet another) script. And the proposal becomes this: "You have an XML file.". What now? Nothing is showing on my screen, there is no flashy animations, there is no mind-blowing performance, all I have is yet another XML file. Even worse, I need to parse that file, interpret it, then write everything else to put stuff on screen.

See the problem? It doesn't do anything of value, just a lot of fake work.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.