# GuiButton Class Reference

`#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 | SetIcon (GuiImage *i)
void | SetIconOver (GuiImage *i)
void | SetLabel (GuiText *t)
void | SetLabel (GuiText *t, int n)
void | SetLabelOver (GuiText *t)
void | SetLabelOver (GuiText *t, int n)
void | SetSoundOver (GuiSound *s)
void | SetSoundClick (GuiSound *s)
void | Draw ()
| Constantly called to draw the GuiButton.
void | Update (GuiTrigger *t)
## Protected Attributes
GuiImage * | image
| Button image.
GuiImage * | imageOver
| Button image on wiimote cursor over.
GuiImage * | icon
| Button icon (drawn after button image).
GuiImage * | iconOver
| Button icon on wiimote cursor over.
GuiText * | label [3]
| Label(s) to display.
GuiText * | labelOver [3]
| Label(s) to display on wiimote cursor over.
GuiSound * | soundOver
| Sound to play on wiimote cursor over.
GuiSound * | soundClick
| Sound to play on click.

## 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::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::SetImageOver | ( | GuiImage * | i | ) |

Sets the button's image on over

Parameters:

  | i | Pointer to GuiImage object

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:

  | t | Pointer to GuiText object
  | n | Index of label to set

void GuiButton::SetLabel | ( | GuiText * | t | ) |

Sets the button's label

Parameters:

  | t | Pointer to GuiText object

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:

  | t | Pointer to GuiText object
  | n | Index of label to set

void GuiButton::SetLabelOver | ( | GuiText * | t | ) |

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

Parameters:

  | t | Pointer to GuiText object

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

Sets the sound to play on click

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