Tairitsu.Portal¶
Protal to transfer player.
Portal
¶
Classes¶
Portal
¶
Portal(x, y, GOTO: SceneType)
Bases: pygame.sprite.Sprite
Initializes a Portal object.
| PARAMETER | DESCRIPTION |
|---|---|
x |
The x-coordinate of the portal's top-left corner.
TYPE:
|
y |
The y-coordinate of the portal's top-left corner.
TYPE:
|
GOTO |
The scene type to which the portal leads.
TYPE:
|
Source code in Tairitsu/Portal.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
Attributes¶
image
instance-attribute
¶
image = pygame.transform.scale(self.image, (PortalSettings.width, PortalSettings.height))
Functions¶
draw
¶
draw(window, dx=0, dy=0)
Draws the portal on the specified window.
| PARAMETER | DESCRIPTION |
|---|---|
window |
The window surface on which to draw the portal.
TYPE:
|
dx |
The x-offset for drawing the portal. Defaults to 0.
TYPE:
|
dy |
The y-offset for drawing the portal. Defaults to 0.
TYPE:
|
Source code in Tairitsu/Portal.py
28 29 30 31 32 33 34 35 36 37 | |