PAlib: PA API functions

Main Page | Modules | File List | Globals | Search for

# PA API functions

## Data Structures

struct | PAPI_all
struct | PAPI_checks
struct | PAPI_buttons
struct | PAPI_sliders

## Functions

void | PAPI_Init (u8 screen)
| Initialise the PA API system. MUST be used prior to any API usage. MUST be set on a 8bit background, don't forget to intialise it too !
void | PAPI_SetImages (u8 screen, void *images, void *palette)
| Change the image set used by the API system. This allows you to have your own buttons and everything... I'll explain later on how to correctly use this
void | PAPI_ReInit (u8 screen)
| ReInitialise the PA API system. This resets all the buttons, checkboxess, and all, you'll just have to clean the screen
void | PAPI_LoadPal (u8 screen)
| Loads the API palette in background colors 208. Use this each time you change the background palette
u8 | PAPI_CreateCheck (u8 screen, s16 x, s16 y, u8 *var)
| Creates a new Checkbox. Returns the number of the checkbox in the API system
void | PAPI_CheckCheck (void)
| Checks all the checkboxes for a new press
u8 | PAPI_CreateButton (u8 screen, s16 x, s16 y, s16 lx, s16 ly, fp funct, char *text, u8 color, s8 textsize)
| Creates a new Button. Returns the number of the button in the API system
void | PAPI_CheckButton (void)
| Checks all the buttons for a new press

## Variables

PAPI_checks | PAPI_check [2][32]
PAPI_all | PAPI_checkinfo [2]
PAPI_buttons | PAPI_button [2][64]
PAPI_all | PAPI_buttoninfo [2]

## Detailed Description

PA API functions

## Function Documentation

u8 PAPI_CreateButton | ( | u8 | screen,
|  | s16 | x,
|  | s16 | y,
|  | s16 | lx,
|  | s16 | ly,
|  | fp | funct,
|  | char * | text,
|  | u8 | color,
|  | s8 | textsize
| ) |

Creates a new Button. Returns the number of the button in the API system

Parameters:

  | screen | Screen on which to create the button
  | x | X position of the upper left corner
  | y | Y position of the upper left corner
  | lx | Width (typically 16 or 32, but can be anything)
  | ly | Height...
  | funct | Fonction to load when the button is pressed. Usage : &functionname
  | text | Text to show on the button
  | color | Text color in the palette index (0-255)
  | textsize | Text size, typically 1, but can be bigger for big buttons. !!!! the define TEXT_ALLSIZES must be set in PA9.h (and install.bat used again) to enable other sizes than 1 !!!!

u8 PAPI_CreateCheck | ( | u8 | screen,
|  | s16 | x,
|  | s16 | y,
|  | u8 * | var
| ) |

Creates a new Checkbox. Returns the number of the checkbox in the API system

Parameters:

  | screen | Screen on which to create the checkbox
  | x | X position of the upper left corner
  | y | Y position of the upper left corner
  | var | Bool variable to change when the checkbox is touched. Usage : &variablename

void PAPI_Init | ( | u8 | screen | ) |

Initialise the PA API system. MUST be used prior to any API usage. MUST be set on a 8bit background, don't forget to intialise it too !

Parameters:

  | screen | Screen on which to initialise it

void PAPI_LoadPal | ( | u8 | screen | ) |

Loads the API palette in background colors 208. Use this each time you change the background palette

Parameters:

  | screen | Screen on which to initialise it

void PAPI_ReInit | ( | u8 | screen | ) |

ReInitialise the PA API system. This resets all the buttons, checkboxess, and all, you'll just have to clean the screen

Parameters:

  | screen | Screen on which to initialise it

void PAPI_SetImages | ( | u8 | screen,
|  | void * | images,
|  | void * | palette
| ) |

Change the image set used by the API system. This allows you to have your own buttons and everything... I'll explain later on how to correctly use this

Parameters:

  | screen | Screen on which to initialise it
  | images | Image set
  | palette | Palette used by the image set, 16 colors...