Zusammenfassung der Ressource
Implementing Buttons
- Drawing Buttons
- Create the text texture with the point size, color and font
- Query the texture for its width and height
- Add the padding to its width and height to get the size of the background rectangle
- Draw the background rectangle
- Draw the text on top
- Variables
- Private Variables
- bgColor
- textColor
- width
- height
- Public Variables
- bgColorActivated
- bgColorNormal
- x
- y
- textColorNormal
- textColorActivated
- text
- Updating Buttons
- When the user clicks on the button
- toggle the bgColor
- toggle the textColor
- toggle the state of the button