Skip to content
fgrimau edited this page Dec 28, 2019 · 13 revisions

The Button class

Defines a button and its methods (with animations, ...)

Button Methods

Constructors

  • Button()
  • Button(const Button&)
  • ~Button()

Operators

  • Button& operator=(const Button&)

Getters

  • SDL_Rect get_rect() const
  • SDL_Color get_background_color() const
  • SDL_Color get_foreground_color() const
  • SDL_Color get_contour_color() const
  • SDL_Rect get_text_position(SDL_Surface*) const

Setters

  • void set_rect(SDL_Rect)
  • void set_rect(int, int, int, int)
  • void set_position(SDL_Rect)
  • void set_position(int, int)
  • void set_text_pos(int, int)
  • void set_text_color(int, int, int)
  • void set_background_color(int, int, int)
  • void set_contour_color(int, int, int)
  • void set_size(SDL_Rect)
  • void set_size(int, int)

Others

  • int update_layout(Screen*, TTF_Font*)
  • int draw_contour(SDL_Surface*, SDL_Color)
  • int draw(Screen*)
  • void update(Screen*)
  • bool collide(SDL_Rect) const

Clone this wiki locally