Classes concerned with the screen and drawing things on it.
The skool font.
| Parameter: | image (pygame.Surface) – The font image. |
|---|
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 (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. |
|---|
Represents the screen upon which everything is drawn.
| Parameters: |
|
|---|
Return whether a character is on-screen.
| Parameters: |
|
|---|
Draw everything on the screen.
| Parameters: |
|
|---|
Draw the contents of a blackboard.
| Parameters: |
|
|---|
Draw an image on a surface.
| Parameters: |
|
|---|
Draw the skool.
| 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 (a pygame.Surface), and done is True if the entire message has been spoken, False otherwise. |
Return the ink and paper colour derived from an attribute byte. The ink colour is taken from bits 6 (BRIGHT) and 0-2; the paper colour is taken from bits 3-6.
| Parameter: | attribute – The attribute byte. |
|---|---|
| Returns: | A 2-tuple containing the ink and paper colours. |
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: |
|
|---|
Set the leftmost column of the play area that will appear on the screen when the game starts.
| Parameters: |
|
|---|
Print the hi-score in the score box.
| Parameter: | hiscore – The hi-score. |
|---|
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 the lines total in the score box.
| Parameter: | lines – The lines total. |
|---|
Print a lines message bubble.
| Parameters: |
|
|---|
Print the mouse inventory. If no mouse inventory is defined, nothing happens.
| Parameters: |
|
|---|
Print a number (the score, lines total, or hi-score) in the score box.
| Parameters: |
|
|---|
Print the score in the score box.
| Parameter: | score – The score. |
|---|
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: |
|
|---|
Take a screenshot and save it to a file.
| Parameter: | filename – The name of the file. |
|---|