Widgets


o Widget Positions
o Inheriting Parent Attributes
o Widget Flags
What is a ``Widget"?

A widget is a rectangular section of the screen that can draw itself and recieve input. Graphical user interfaces are composed by dividing the screen into widgets. A widget could be a variety of things with drastically different functions. It could be a button, a text box, or even a game map. Widgets can contain other widgets, which are refered to as its children. LibKSD provides the ability to easily build custom widgets and arrange them on the screen.

Most games build their interfaces in the same fashion. Usually there is one widget which is used to draw the actual action of the game (herein refered to as the game display widget) which contains or is surrounded by many control or display widgets. This is easy to see in a game like Star Craft or even Super Mario Brothers. In some situations the game display widget is used several times, to allow multiple players.

What is a ``Widget set"?

There are many components to a graphical interface that are so commonly needed, rewritting them from scratch for each game would be an utter waste of time. Rather, we could package a set of reusable widgets, forming a widget set. This includes things like buttons, text input controls, menus, scroll bars, and labels. A properly designed widget set should allow the developer to create different themes. A theme is the way that the widget set is drawn. A theme is created in order to customize its appearence for a particular game.

Using LibKSD, it is possible to create a widget set. There is a widget set included with the standard LibKSD distribution called ``libksd_gui" (see its individual manual for more information). Even though a widget set is included by default, anyone can write there own widget set as an add-on library.

How does this effect the ability to extend LibKSD?

Since each widget independently deals with its own drawing and input, it is easy to write add-on libraries to LibKSD. Imagine a game engine written as a LibKSD widget. It would be able to draw inside of any LibKSD application and could be paired with any number of other widgets and extensions. LibKSD could be the basis for multiple game engines, widget sets, or rendering libraries.

Alphabetic index Hierarchy of classes



This page was generated with the help of DOC++.