From 59f3ca741ffd1ace1e419e6e4832238b2f4d9f95 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Sat, 2 Jan 2016 02:54:55 +0100 Subject: [PATCH] Rework intro and tutorial. --- docs/gettingstarted.rst | 190 +++++++++++++++++++++++----------------- docs/index.rst | 118 +++++++++++++++++-------- 2 files changed, 193 insertions(+), 115 deletions(-) diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rst index 7e30162..efa3dfd 100644 --- a/docs/gettingstarted.rst +++ b/docs/gettingstarted.rst @@ -4,31 +4,39 @@ Getting Started Before actually getting started, it is important to understand the motivation and mechanics behind SUIT: -- **SUIT is an immediate mode GUI library** +- **Immediate mode is better than retained mode** +- **Layout does not care about widgets** - **Less is more** -- **Layouting must be easy** Immediate mode? --------------- With classical (retained) mode libraries you typically have a stage where you -create the whole UI when the program initializes. After that point, the GUI -is expected to not change very much. +create the whole UI when the program initializes. This includes what happens +when events like button presses or slider changes occur. After that point, the +GUI is expected to not change very much. This is great for word processors +where the interaction is consistent and straightforward, but bad for games, +where everything changes all the time. With immediate mode libraries, on the other hand, the GUI is created every -frame from scratch. There are no widget objects, only functions that draw the -widget and update some internal GUI state. This allows to put the widgets in -their immediate conceptual context (instead of a construction stage). It also -makes the UI very flexible: Don't want to draw a widget? Simply remove the -call. Handling the mutable data (e.g., text of an input box) of each widget is -your responsibility. This separation of data and behaviour gives you greater -control of what is happening when an where, but can take a bit of time getting -used to - especially if you have used retained mode libraries before. +frame from scratch. Because that would be wasteful, there are no widget +objects. Instead, widgets are created by functions that react to UI state and +present some data. Where this data comes from and how it is maintained does +not concern the widget at all. This is, after all, your job. This gives great +control over what is shown where and when. The widget code can be right next +to the code that does what should happen if the widget state changes. The +layout is also very flexible: adding a widget is one more function call, and if +you want to hide a widget, you simply don't call the corresponding function. + +This separation of data and behaviour is great when a lot of stuff is going on, +but takes a bit of time getting used to. + What SUIT is ^^^^^^^^^^^^ -SUIT is simple: It provides only the most important widgets for games: +SUIT is simple: It provides only a few basic widgets that are important for +games: - :func:`Buttons