Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
Button.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include "Entity.h"
5 #include "Text.h"
6 
11 class JAM_Button : public JAM_Entity
12 {
13 private:
17  float border;
19  bool state;
20 
21 public:
30  JAM_Button(JAM_Texture* sprite, float x, float y, float width, float height);
31 
47  JAM_Button(JAM_Texture* sprite, float x, float y, std::string message, std::string fontLocation,
48  int fontSize, int r, int g, int b, SDL_Renderer* renderer, float border, float minWidth, float minHeight);
49 
53  ~JAM_Button();
54 
59  void update(float dt);
60 
66  bool input(SDL_Event& incomingEvent);
67 
73  bool tapInput(SDL_Event& incomingEvent);
74 
79  void drawText(SDL_Renderer* renderer);
80 };
bool input(SDL_Event &incomingEvent)
Definition: Button.cpp:73
void update(float dt)
Definition: Button.cpp:66
JAM_Texture * sprite
Definition: Entity.h:14
Creates a Texture for use with a renderer. Creates a Texture from an image file, this can then be use...
Definition: Texture.h:13
~JAM_Button()
Definition: Button.cpp:57
bool tapInput(SDL_Event &incomingEvent)
Definition: Button.cpp:120
bool state
Definition: Button.h:19
JAM_Text * text
Definition: Button.h:15
JAM_Button(JAM_Texture *sprite, float x, float y, float width, float height)
Definition: Button.cpp:6
Creates a Button object that inherits Entity.
Definition: Button.h:11
void drawText(SDL_Renderer *renderer)
Definition: Button.cpp:157
Creates an Entity object.
Definition: Entity.h:10
Creates a Text Texture for use with a renderer. Creates a Text Texture from an image file...
Definition: Text.h:15
float border
Definition: Button.h:17