# GuiButton Class Reference

Display, manage, and manipulate buttons in the GUI. Buttons can have images, icons, text, and sound set (all of which are optional). More...

`#include <gui.h>`

Inheritance diagram for GuiButton:

List of all members.

## Public Member Functions
| GuiButton (int w, int h)
| ~GuiButton ()
| Destructor.
void | SetImage (GuiImage *i)
void | SetImageOver (GuiImage *i)
void | SetImageHold (GuiImage *i)
void | SetImageClick (GuiImage *i)
void | SetIcon (GuiImage *i)
void | SetIconOver (GuiImage *i)
void | SetIconHold (GuiImage *i)
void | SetIconClick (GuiImage *i)
void | SetLabel (GuiText *t, int n=0)
void | SetLabelOver (GuiText *t, int n=0)
void | SetLabelHold (GuiText *t, int n=0)
void | SetLabelClick (GuiText *t, int n=0)
void | SetSoundOver (GuiSound *s)
void | SetSoundHold (GuiSound *s)
void | SetSoundClick (GuiSound *s)
void | Draw ()
| Constantly called to draw the GuiButton.
void | Update (GuiTrigger *t)
## Protected Attributes
GuiImage * | image
| Button image (default).
GuiImage * | imageOver
| Button image for STATE_SELECTED.
GuiImage * | imageHold
| Button image for STATE_HELD.
GuiImage * | imageClick
| Button image for STATE_CLICKED.
GuiImage * | icon
| Button icon (drawn after button image).
GuiImage * | iconOver
| Button icon for STATE_SELECTED.
GuiImage * | iconHold
| Button icon for STATE_HELD.
GuiImage * | iconClick
| Button icon for STATE_CLICKED.
GuiText * | label [3]
| Label(s) to display (default).
GuiText * | labelOver [3]
| Label(s) to display for STATE_SELECTED.
GuiText * | labelHold [3]
| Label(s) to display for STATE_HELD.
GuiText * | labelClick [3]
| Label(s) to display for STATE_CLICKED.
GuiSound * | soundOver
| Sound to play for STATE_SELECTED.
GuiSound * | soundHold
| Sound to play for STATE_HELD.
GuiSound * | soundClick
| Sound to play for STATE_CLICKED.

## Detailed Description

Display, manage, and manipulate buttons in the GUI. Buttons can have images, icons, text, and sound set (all of which are optional).

## Constructor & Destructor Documentation

GuiButton::GuiButton | ( | int | w,
|  | int | h |
| ) |  |  |

Constructor

Parameters:

  | w | Width
  | h | Height

Constructor for the GuiButton class.

GuiButton::~GuiButton | ( |  | ) |

Destructor.

Destructor for the GuiButton class.

## Member Function Documentation

void GuiButton::Draw | ( |  | ) | `[virtual]`

Constantly called to draw the GuiButton.

Draw the button on screen

Reimplemented from GuiElement.

void GuiButton::SetIcon | ( | GuiImage * | i | ) |

Sets the button's icon

Parameters:

  | i | Pointer to GuiImage object

void GuiButton::SetIconClick | ( | GuiImage * | i | ) |

Sets the button's icon on click

Parameters:

  | i | Pointer to GuiImage object

void GuiButton::SetIconHold | ( | GuiImage * | i | ) |

Sets the button's icon on hold

Parameters:

  | i | Pointer to GuiImage object

void GuiButton::SetIconOver | ( | GuiImage * | i | ) |

Sets the button's icon on over

Parameters:

  | i | Pointer to GuiImage object

void GuiButton::SetImage | ( | GuiImage * | i | ) |

Sets the button's image

Parameters:

  | i | Pointer to GuiImage object

void GuiButton::SetImageClick | ( | GuiImage * | i | ) |

Sets the button's image on click

Parameters:

  | i | Pointer to GuiImage object

void GuiButton::SetImageHold | ( | GuiImage * | i | ) |

Sets the button's image on hold

Parameters:

  | i | Pointer to GuiImage object

void GuiButton::SetImageOver | ( | GuiImage * | i | ) |

Sets the button's image on over

Parameters:

  | i | Pointer to GuiImage object

void GuiButton::SetLabel | ( | GuiText * | t,
|  | int | n = `0` |
| ) |  |  |

Sets the button's label

Parameters:

  | t | Pointer to GuiText object
  | n | Index of label to set (optional, default is 0)

void GuiButton::SetLabelClick | ( | GuiText * | t,
|  | int | n = `0` |
| ) |  |  |

Sets the button's label on click

Parameters:

  | t | Pointer to GuiText object
  | n | Index of label to set (optional, default is 0)

void GuiButton::SetLabelHold | ( | GuiText * | t,
|  | int | n = `0` |
| ) |  |  |

Sets the button's label on hold

Parameters:

  | t | Pointer to GuiText object
  | n | Index of label to set (optional, default is 0)

void GuiButton::SetLabelOver | ( | GuiText * | t,
|  | int | n = `0` |
| ) |  |  |

Sets the button's label on over (eg: different colored text)

Parameters:

  | t | Pointer to GuiText object
  | n | Index of label to set (optional, default is 0)

void GuiButton::SetSoundClick | ( | GuiSound * | s | ) |

Sets the sound to play on click

Parameters:

  | s | Pointer to GuiSound object

void GuiButton::SetSoundHold | ( | GuiSound * | s | ) |

Sets the sound to play on hold

Parameters:

  | s | Pointer to GuiSound object

void GuiButton::SetSoundOver | ( | GuiSound * | s | ) |

Sets the sound to play on over

Parameters:

  | s | Pointer to GuiSound object

void GuiButton::Update | ( | GuiTrigger * | t | ) | `[virtual]`

Constantly called to allow the GuiButton to respond to updated input data

Parameters:

  | t | Pointer to a GuiTrigger, containing the current input data from PAD/WPAD

Reimplemented from GuiElement.

The documentation for this class was generated from the following files:

- gui.h
- gui_button.cpp