Jump to content
  • Advertisement
Sign in to follow this  
Emerican360

Data Driven UI Model

This topic is 2643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!