Classes concerned with the screen and drawing things on it.
The skool font.
Parameters: |
|
---|
Define the location and width of a font character bitmap in the font image.
Parameters: |
|
---|
Build the font image. This method is called after rescaling the screen or loading a saved game.
Return the width (in pixels) of text when rendered at scale 1.
Return whether the skool font contains a bitmap for a given character.
Parameters: | char – The character to look for. |
---|
Return an image (a pygame.Surface) of a text message written in the skool font.
Parameters: |
|
---|
A container for all the images used in a game.
Parameters: |
|
---|
Return an Image from the gallery, or None if there is no image in the gallery with the given ID. The image will be scaled up as necessary.
Parameters: | image_id – The ID of the image. |
---|
Return an image (a pygame.Surface) from the gallery, or None if there is no image in the gallery with the given ID. The image will be scaled up as necessary.
Parameters: | image_id – The ID of the image. |
---|
Set the scale and clear the image cache.
Parameters: | scale – The scale. |
---|
Perform tasks required immediately after loading a saved game.
Parameters: | images_dir – The path to the images directory. |
---|
Scale up a pair of coordinates and return them.
Parameters: | coords – The coordinates. |
---|
Decrease the scale factor by 1 (if it is greater than 1). The image cache will be cleared.
Returns: | True if the scale factor was decreased, False otherwise. |
---|
Scale up a length and return it.
Increase the scale factor by 1. The image cache will be cleared.
A container for a pygame.Surface. This is used to handle the saving and restoring of images, because a pygame.Surface cannot be pickled directly.
Parameters: |
|
---|
Blit a pygame.Surface onto this image.
Parameters: | args – Arguments passed to pygame.Surface.blit(). |
---|
Build the image. This method is called after rescaling the screen or loading a saved game.
Return a copy of the image.
Return a flipped copy of the image.
Return the width of the image.
Return the size (width, height) of the image.
Return the width of the image.
Draw an image on this image using scaled coordinates.
Parameters: |
|
---|
Scale up a length and return it.
Set the colour key of the image.
Parameters: | colorkey – The colour key. |
---|
Return a subsurface of the image.
Parameters: |
|
---|
Represents the screen upon which everything is drawn.
Parameters: |
|
---|
Define the location and width of a font character bitmap in the font image.
Parameters: |
|
---|
Return whether a character is on-screen.
Parameters: |
|
---|
Draw everything on the screen.
Parameters: |
|
---|
Draw the menu and update the screen.
Parameters: |
|
---|
Create a speech bubble displaying a portion of a message.
Parameters: |
|
---|---|
Returns: | A 2-tuple, (bubble, done), where bubble is the speech bubble image (an Image), and done is True if the entire message has been spoken, False otherwise. |
Return the direction in which the screen should be scrolled when Eric is at a given x-coordinate.
Parameters: | x – Eric’s x-coordinate. |
---|---|
Returns: | -1 if the screen should scroll right, 1 if it should scroll left, or 0 if it should not scroll. |
Return a pygame.Surface displaying some text in the skool font.
Parameters: |
|
---|
Return the width (in pixels) of text when rendered at scale 1.
Return whether the skool font contains a bitmap for a given character.
Parameters: | char – The character to look for. |
---|
Set the leftmost column of the play area that will appear on the screen when the game starts.
Parameters: |
|
---|
Print the inventory. If no inventory is defined, nothing happens.
Parameters: | item_images – A sequence of item images to draw in the inventory box. |
---|
Print some text in the lesson box.
Parameters: | text_lines – The lines of text to print. |
---|
Print a message box.
Parameters: |
|
---|
Print the mouse inventory. If no mouse inventory is defined, nothing happens.
Parameters: |
|
---|
Print the score, lines total and hi-score in the score box.
Parameters: |
|
---|
Reinitialise the screen for a new game.
Scale up a pair of coordinates and return them.
Parameters: | coords – The coordinates. |
---|
Decrease the scale factor by 1 (if it is greater than 1), and redraw the screen.
Increase the scale factor by 1, and redraw the screen.
Scroll the skool a number of columns across the screen.
Parameters: |
|
---|
Scroll the skool across the entire width of the screen from right to left.
Parameters: |
|
---|
Set up the following things:
- the window title and icon
- the screen background
- the logo image
- the score box
- (optionally) the size of the screen
Parameters: | set_mode – If True, the size of the screen will be set. |
---|
Take a screenshot and save it to a file.
Parameters: | filename – The name of the file. |
---|
ID of the font image.
ID of the inventory items image.
ID of the lesson box image.
ID of the logo image.
ID of the message box image.
ID of the mutables image.
ID of the ink-only mutables image.
ID of the paper-only mutables image.
ID of the score box image.
ID of the play area image.
ID of the ink-only play area image.
ID of the paper-only play area image.
ID of the speech bubble image.
ID of the sprites image.