MAUI Intro
MAUI Concept
MAUI Syntax
MAUI Module

MAUI References

MAUI License

Setup Explained

previous next

There are several files included with the MAUI_Module:

  1. APP_Common.Lib.dba - Contains common variables, objects, methods used by all Modules. The `APP` is a generic prefix and can be relabled and integrated into your own Common lib. Note: I use a prefix on all of my code to make changes easier and minimize code conflict.
  2. LUA.Mod.dba - This is a Wrapper Library for Barnski's LUA Plugin. Its the second lib called to setup the Scripting System. I use a Wrapper Lib for all Plugins. MAUI heavily relies on LUA Script.
  3. DarkMachineJr.dba - This is a Batch Text Replacement Preprocessor used by MAUI to convert DarkLUA (my version of LUA) to pure LUA. DMjr also uses pure LUA to script conditional logic for batch replacement. DMjr can be used to perform batch replacement on other loaded text files. It is startup prior to setting up MAUI.
  4. MAUI.Mod.dba - This is the core MAUI Module Library.
  5. MAUI.Mod.lua - LUA Script file called during startup. Provides a place for common/shared LUA functions, variables, tables used in various LUA Scripts. The filename could be relabeled to suit your own needs.
  6. MAUI.Mod.Lua.dba - Contains a Declaration Function that calls LUA_Function Wrappers to register functions to LUA. All Functions accesible from LUA have a LUA_Function Wrapper and it can be stored within this single Declaration Function (storing the functions in central location eases modification). Once Registered to LUA the function can be called from LUA with the DBPro.Call Function. The filename could be relabeled and other LUA Wrappers added.
  7. MAUI.Mod.Main.dba - Is the Main.dba for the MAUI_Module demo.
  8. MAUI.Mod.reg - Registry File containg MAUI Configuration Keys.
  9. MAUI_Module.exe - MAUI Module Demo Exe.

OK, let me start with MAUI.Mod.Main.dba. Its divided into 3 sections START, UPDATE, STOP. The START is where you place functions to initialize modules etc. The UPDATE section contains the main update loop. The STOP section terminates modules, etc. Most Game and Application Main.dba are organized in this fashion and MAUI has MAUI_Start(), MAUI_Update(), MAUI_Stop() Functions that are placed in these sections.

The MAUI.Mod.Main.dba calls the start functions for APP_Common, LUA_start, DMjr, and MAUI. The order of calls are relevant and will result in errors otherwise. The MAUI_Start() sets up MAUI, reading the configuration info from the Registry. The configuration tells MAUI and DMJr what startup files are to load:


The LocalAssetRootDirectory Key points to the Asset Directory which is initially C:\temp\MaindricRPG\. It must match the Path of the MaindricRPG Asset Directory or errors will occur.

DMjr automatically reads *.csv DMJrFiles in the [LocalAssetRootDirectory]\Data\DMjr\ Directory

MAUI automatically reads *.maui (MAUI XML) MAUIFiles in the [LocalAssetRootDirectory]\Data\UI\ Directory

These files are required. I divided the setup files into maui_styles.maui, maui_behaviors.maui, maui_transitions.maui to make editing more manageable. maui_mod_start.maui contains the gizmos for the Demo and other GUI pages, dialogs, etc will be similar to it. For more details on MAUI XML goto the Tag Reference.

MAUI is responsible for setting up the Screen Dimensions and can scale Gizmos accordingly. It is designed to use images at original scale for pixel perfect resolution thus, it will center and draw images at original scale, scaling Gizmo Collision Object and Borders Images according to Registry Keys: ScreenWidthZoomFactor and ScreenHeightZoomFactor. Settings these keys to the following values:

  • 0.0 - Auto Scales Gizmo based on ScreenWidth and ScreenHeight.
  • 1.0 - Uses MAUI default Gizmo Scale based on 1024 x 768 Screen Dimension.
  • Other - Scale Gizmos based on value above 1 or below 0.

previous next
Copyright 2009 F.L.Taylor.