fixed documentation
This commit is contained in:
parent
63a87c12dd
commit
4904ed2184
@ -1 +1 @@
|
|||||||
"""Sub-module for use in the game. Helps with the drawing of various objects such as sprites and text boxes."""
|
"""Submodule for use in the game. Helps with the drawing of various objects such as sprites and text boxes."""
|
||||||
|
@ -113,9 +113,14 @@ class InfoText:
|
|||||||
Class for drawing large amounts of text on the screen at a time
|
Class for drawing large amounts of text on the screen at a time
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, resources_dir, game_res, text='Lorem ipsum dolor sit amet, consectetur adipiscing elit. '
|
def __init__(self, resources_dir, game_res, text='Test text.'):
|
||||||
'Nam commodo tempor aliquet. Suspendisse placerat accumsan'
|
"""
|
||||||
' neque, nec volutpat nunc porta ut.'):
|
Creates an InfoText object to be used on a surface.
|
||||||
|
Args:
|
||||||
|
resources_dir (str): The full path of the game's resources directory
|
||||||
|
game_res (int): The internal resolution of the game. Used for correct scaling.
|
||||||
|
text (:obj:`str`, optional): The given text to render. Defaults to "Test text."'
|
||||||
|
"""
|
||||||
|
|
||||||
self.font = pygame.font.Font(resources_dir + '/fonts/5Pts5.ttf', 10)
|
self.font = pygame.font.Font(resources_dir + '/fonts/5Pts5.ttf', 10)
|
||||||
self.text = [] # Text broken up into a list according to how it will fit on screen.
|
self.text = [] # Text broken up into a list according to how it will fit on screen.
|
||||||
@ -188,8 +193,9 @@ class InfoText:
|
|||||||
|
|
||||||
def draw(self, surface):
|
def draw(self, surface):
|
||||||
"""
|
"""
|
||||||
Draws the text on a given surface.
|
Draw the text on a given surface.
|
||||||
:param surface: The surface for the text to be drawn on.
|
Args:
|
||||||
|
surface (:obj:`pygame.Surface`): The surface to draw the text on
|
||||||
"""
|
"""
|
||||||
# Constants to help draw the text
|
# Constants to help draw the text
|
||||||
line_separation = 7
|
line_separation = 7
|
||||||
@ -264,7 +270,8 @@ class EggInfo:
|
|||||||
def draw(self, surface):
|
def draw(self, surface):
|
||||||
"""
|
"""
|
||||||
Draw the info icons on a given surface.
|
Draw the info icons on a given surface.
|
||||||
:param surface: the surface to draw the icons on.
|
Args:
|
||||||
|
surface (:obj:`pygame.Surface`): The surface to draw the text on
|
||||||
"""
|
"""
|
||||||
# Blit the info onto the given surface.
|
# Blit the info onto the given surface.
|
||||||
surface.blit(self.surface, (self.x, self.y))
|
surface.blit(self.surface, (self.x, self.y))
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
"""Sub-package for handling all I/O operations including keyboard input (GPIO input when connected to a Raspberry Pi)
|
"""Subpackage for handling all I/O operations including keyboard input (GPIO input when connected to a Raspberry Pi)
|
||||||
and save data reading and writing."""
|
and save data reading and writing."""
|
Loading…
Reference in New Issue
Block a user