mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2026-03-22 00:36:20 +00:00
feat: add fonts
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
from pathlib import Path
|
||||
|
||||
from attr import define, field
|
||||
from pygame import Vector2 as Vec2
|
||||
|
||||
from .colors import TokyoNightNight
|
||||
from .path import BASE_PATH
|
||||
from .size import Size
|
||||
|
||||
PADDING = 20
|
||||
@@ -31,9 +34,15 @@ class SideBar:
|
||||
preview: Size = Size(size.width, size.height * 0.7)
|
||||
|
||||
|
||||
@define
|
||||
class Font:
|
||||
family: Path = BASE_PATH / "assets" / "fonts" / "ChakraPetch" / "Regular.ttf"
|
||||
size: int = 32
|
||||
|
||||
|
||||
@define
|
||||
class Window:
|
||||
title = "Tetris"
|
||||
title: str = "Tetris"
|
||||
padding: int = PADDING
|
||||
size: Size = Size(
|
||||
Game().size.width + SideBar().size.width + padding * 3,
|
||||
@@ -48,6 +57,7 @@ class Config:
|
||||
game: Game = Game()
|
||||
sidebar: SideBar = SideBar()
|
||||
window: Window = Window()
|
||||
font: Font = Font()
|
||||
colors = TokyoNightNight()
|
||||
fps: int = 60
|
||||
|
||||
|
||||
Reference in New Issue
Block a user