Atrinik Client  4.0
Functions
button.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

void button_init ()
 
static texture_structbutton_determine_texture (button_struct *button)
 
void button_create (button_struct *button)
 
void button_destroy (button_struct *button)
 
void button_set_parent (button_struct *button, int px, int py)
 
void button_set_font (button_struct *button, font_struct *font)
 
int button_need_redraw (button_struct *button)
 
void button_show (button_struct *button, const char *text)
 
int button_event (button_struct *button, SDL_Event *event)
 

Detailed Description

Button API.

Author
Alex Tokar

Definition in file button.c.

Function Documentation

void button_create ( button_struct button)

Initialize a button's default values.

Parameters
buttonButton.

Definition at line 65 of file button.c.

void button_destroy ( button_struct button)

Destroy data associated with the specified button. The button structure itself is not freed.

Parameters
buttonButton to destroy.

Definition at line 94 of file button.c.

static texture_struct* button_determine_texture ( button_struct button)
static

Determine button's texture, based on its texture settings and whether it is currently pressed, or mouse is over it.

Parameters
buttonButton.
Returns
Texture to use.

Definition at line 49 of file button.c.

int button_event ( button_struct button,
SDL_Event *  event 
)

Handle SDL event for a button.

Parameters
buttonButton to handle.
eventThe event.
Returns
1 if the event makes the button pressed, 0 otherwise.

Definition at line 222 of file button.c.

void button_init ( void  )

Initialize the button API.

Definition at line 37 of file button.c.

void button_set_font ( button_struct button,
font_struct font 
)

Set font of the specified button.

Parameters
buttonButton.
fontFont to set.

Definition at line 114 of file button.c.

void button_show ( button_struct button,
const char *  text 
)

Render a button.

Parameters
buttonButton to render.
textOptional text to render.

Definition at line 161 of file button.c.