Intro

This might be the base for ToME 4 display modules. Feel free to enhance the design, it surely needs it! Feel free to code it, it definitively needs it...

Preface

In all this document there are a few rules:

General communication

Communication between the core and the engine:

Commands list

Core to GUI

RegisterGraphic

This command registers a graphical element that is possible to display in the map. Such elements can be anything from a monster, an object, to a spell, a floor tile, a cloud, ...

If more than one letter/color pair is given, or if the image contains an animation the rate at which switch them is left to the GUI. A curses UI could change only when a key is pressed while a graphical UI might want to put that on timer. The image identifier can be used for many things. One could imagine a 3D port in which this would reference a 3D model to use.

Params:

  1. u32b id
  2. u8b number of pairs
  3. (u8b + 3*u8b) * number of pairs; the letter and the RGB code
  4. string image identifier

The Core may:

GetTile

Receieves(and most likely draws) a tile on the map. This command takes an arbitrary number of graphic elements identifiers and displays them in order of arrival, possibly discarding all bu the last if the GUI cannot handle transparency

Params:

  1. u8b number of ids
  2. (u32b) * number of ids; the elements ids to display

The GUI is responsible for storing those in order to do redraws and such, the Core wont resend them on such events.

NewWindow

Creates a new window with a given name.

Params:

  1. string identifier
  2. string window title
  3. u8b window width in % of the screen size
  4. u8b window height in % of the screen size

AddMap

Creates a map displaying widget in the given window.

Params:

  1. string window name

AddLabel

Gui to Core

Developers Corner/GUI separation (last edited 2005-02-05 00:21:04 by DarkGod)