# Luxinia API Documentation

##### Luxinia dev 1.400 - Dec 6 2009

This is the Luxinia API documentation. This documentation is automaticly created by the AutoDoc class of the luxinialuacore module. You can create custom templates that fits your use. You can customize the .css files apart from the lua files - these are not automaticly created and will not be overwritten if the help files is recreated.
It is necessary to update the documenation if you download a developer build or if no documentation is available. Please make sure that you always use the documentation of the Luxinia executable that you are using.

## Reading the documentation

Lua does not have strict typing of variables, and it does not know float, integer, short or char values as C does. If such types are required by a function, you can pass any numbervalue. Use tonumber if your given variable is not a number but a string for example. You don't have to round your numbers if a int is required - this is done automaticly.
Overview on numbertypes

- Lua number: double value 64bit floating number
- float: Any number value, 32bit floating number (used in Luxinia)
- integer (int): rounded number between 2147483648 and -2147483647
- short: rounded number between 32768 and -32767
- char: rounded number between 128 and -127 or 0 and 255 - this depends if the function uses a signed or unsigned number.

Other values cannot be casted.

The arguments of functions and their return values are described in this way by example:

    afunctionname (int x, y, [float z,int/string bla,float])

Optional arguments are enclosed in cornered brackets. Types of arguments are optional and not always given. Type descriptions are sometimes only given for the first element of this type and trailing arguments are assumed to be of the same type. The parameter name can also be just the type of the argument. If different types can be passed, a slash is used to tell all the different types.

The return values are described in the same way as the arguments. In most cases, more than one variable is returned.

## Naming conventions

The Luxinia naming convention divides between module classes and core classes. This is quite usefull since modules and core classes are different in its purpose.

Core classes are provided by the luxinia core itself. This means that each function is implemented in C and should be considered to be "fast". The core function handle all problems that are computational expensive, such as the rendering and physics calculations.

LuxModules provide interface functions and classes to the core classes and additional utility functions that are written in Lua. This is useful for most projects.

## Modifying the documentation's appearance

You can modify the documentation in several ways. In any case you need to understand how HTML and CSS works.

- Edit the css files in doc/frames of the luxinia path
  The CSS files are not created automaticly and can be changed by you using the CSS commands.
- Create new AutoDoc templates
  The documentation is created automaticly by the AutoDoc class and you can create your own templates that do so, too. Read the documentation of the AutoDoc class and learn by reading the given examples in the base/scripts directory of Luxinia.
- Do not edit the HTML files.
  The HTML files are created automaticly which means that all your changes will be overwritten if you edit them manually. You can not change the descriptions of the classes itself.