feat(startscreen): add comments
This commit is contained in:
@@ -2,6 +2,16 @@ import pygame
|
||||
|
||||
class Button:
|
||||
def __init__(self, text, width, height, pos_x, pos_y, color, hover):
|
||||
"""
|
||||
|
||||
:param text: Text inside the button.
|
||||
:param width: Width of the button.
|
||||
:param height: Height of the button.
|
||||
:param pos_x: X position of the button on the screen.
|
||||
:param pos_y: Y position of the button on the screen.
|
||||
:param color: Color of the button on the screen.
|
||||
:param hover: Color of the button on the screen when mouse is hover.
|
||||
"""
|
||||
self.text = text
|
||||
self.width = width
|
||||
self.height = height
|
||||
@@ -20,6 +30,11 @@ class Button:
|
||||
self.clicked = False
|
||||
|
||||
def draw(self, screen):
|
||||
"""
|
||||
Draw the button on the screen.
|
||||
:param screen: Screen object where button will be drawn.
|
||||
:return: Return True when button was clicked.
|
||||
"""
|
||||
action = False
|
||||
|
||||
# get current mous position
|
||||
|
||||
Reference in New Issue
Block a user