game_top.py 657 B

12345678910111213141516171819202122
  1. import os
  2. import pygame
  3. import pygame.freetype as freetype
  4. from client_local.ui.ui import UIInstance
  5. Current_Path = os.getcwd()
  6. FONT_PATH = Current_Path + r"\res\font\simsun.ttc"
  7. # FONT_PATH = Current_Path + r"\res\font\hk4e_zh-cn.ttf"
  8. # FONT_PATH = Current_Path + r"\res\font\SourceHanSerif-VF.ttc"
  9. # FONT_PATH = "Arial"
  10. class GameTop(UIInstance):
  11. def __init__(self):
  12. super().__init__("game", "gameTop")
  13. self.font = pygame.font.Font(FONT_PATH, 16)
  14. self.rend = self.font.render("v20260905", True, (0, 196, 255))
  15. def draw(self, screen: pygame.Surface):
  16. super().draw(screen)
  17. screen.blit(self.rend, (0, 0))