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: |
|
---|
Return whether the skool font contains a bitmap for a given character.
Parameter: | 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.
Parameter: | 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.
Parameter: | image_id – The ID of the image. |
---|
Set the scale and clear the image cache.
Parameter: | scale – The scale. |
---|
Perform tasks required immediately after loading a saved game.
Parameter: | images_dir – The path to the images directory. |
---|
Scale up a pair of coordinates and return them.
Parameter: | 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. |
---|
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.
Parameter: | args – Arguments passed to pygame.Surface.blit(). |
---|
Draw an image on this image using scaled coordinates.
Parameters: |
|
---|
Set the colour key of the image.
Parameter: | 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.
Parameter: | 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 whether the skool font contains a bitmap for a given character.
Parameter: | 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.
Parameter: | item_images – A sequence of item images to draw in the inventory box. |
---|
Print some text in the lesson box.
Parameter: | 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: |
|
---|
Scale up a pair of coordinates and return them.
Parameter: | coords – The coordinates. |
---|
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
Parameter: | set_mode – If True, the size of the screen will be set. |
---|
Take a screenshot and save it to a file.
Parameter: | filename – The name of the file. |
---|