Tairitsu.Tile¶
Tile in the game.
Tile
¶
Classes¶
Tile
¶
Tile(image: pygame.Surface, x: int = 0, y: int = 0, width: int = SceneSettings.tileWidth, height: int = SceneSettings.tileHeight)
Bases: pygame.sprite.Sprite
Initializes a Tile object.
| PARAMETER | DESCRIPTION |
|---|---|
image |
The image to be displayed on the tile.
TYPE:
|
x |
The x-coordinate of the top-left corner of the tile. Defaults to 0.
TYPE:
|
y |
The y-coordinate of the top-left corner of the tile. Defaults to 0.
TYPE:
|
width |
The width of the tile. Defaults to SceneSettings.tileWidth.
TYPE:
|
height |
The height of the tile. Defaults to SceneSettings.tileHeight.
TYPE:
|
Source code in Tairitsu/Tile.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
Attributes¶
Functions¶
draw
¶
draw(window: pygame.surface.Surface, dx: int = 0, dy: int = 0)
Draws the tile on the specified window at the given position.
| PARAMETER | DESCRIPTION |
|---|---|
window |
The window surface to draw on.
TYPE:
|
dx |
The x-coordinate offset for positioning the tile.
TYPE:
|
dy |
The y-coordinate offset for positioning the tile.
TYPE:
|
Source code in Tairitsu/Tile.py
25 26 27 28 29 30 31 32 33 34 35 36 | |