预加入中文显示支持
This commit is contained in:
parent
d227a28452
commit
14326d8194
BIN
resources/DroidSansFallback.ttf
Normal file
BIN
resources/DroidSansFallback.ttf
Normal file
Binary file not shown.
Binary file not shown.
@ -7,8 +7,8 @@ from .. import constants as c
|
|||||||
|
|
||||||
def getSunValueImage(sun_value):
|
def getSunValueImage(sun_value):
|
||||||
# for pack, must include ttf
|
# for pack, must include ttf
|
||||||
fontPath = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))),'resources', 'freesansbold.ttf')
|
font = pg.font.Font(c.FONT_PATH, 14)
|
||||||
font = pg.font.Font(fontPath, 14)
|
font.bold = True
|
||||||
width = 35
|
width = 35
|
||||||
msg_image = font.render(str(sun_value), True, c.NAVYBLUE, c.LIGHTYELLOW)
|
msg_image = font.render(str(sun_value), True, c.NAVYBLUE, c.LIGHTYELLOW)
|
||||||
msg_rect = msg_image.get_rect()
|
msg_rect = msg_image.get_rect()
|
||||||
@ -188,7 +188,7 @@ class MenuBar():
|
|||||||
self.value_image = getSunValueImage(self.sun_value)
|
self.value_image = getSunValueImage(self.sun_value)
|
||||||
self.value_rect = self.value_image.get_rect()
|
self.value_rect = self.value_image.get_rect()
|
||||||
self.value_rect.x = 21
|
self.value_rect.x = 21
|
||||||
self.value_rect.y = self.rect.bottom - 21
|
self.value_rect.y = self.rect.bottom - 24
|
||||||
|
|
||||||
self.image.blit(self.value_image, self.value_rect)
|
self.image.blit(self.value_image, self.value_rect)
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ class Panel():
|
|||||||
self.value_image = getSunValueImage(sun_value)
|
self.value_image = getSunValueImage(sun_value)
|
||||||
self.value_rect = self.value_image.get_rect()
|
self.value_rect = self.value_image.get_rect()
|
||||||
self.value_rect.x = 21
|
self.value_rect.x = 21
|
||||||
self.value_rect.y = self.menu_rect.bottom - 21
|
self.value_rect.y = self.menu_rect.bottom - 24
|
||||||
|
|
||||||
self.button_image = self.loadFrame(c.START_BUTTON)
|
self.button_image = self.loadFrame(c.START_BUTTON)
|
||||||
self.button_rect = self.button_image.get_rect()
|
self.button_rect = self.button_image.get_rect()
|
||||||
|
|||||||
@ -22,6 +22,9 @@ SCREEN_WIDTH = 800
|
|||||||
SCREEN_HEIGHT = 600
|
SCREEN_HEIGHT = 600
|
||||||
SCREEN_SIZE = (SCREEN_WIDTH, SCREEN_HEIGHT)
|
SCREEN_SIZE = (SCREEN_WIDTH, SCREEN_HEIGHT)
|
||||||
|
|
||||||
|
# 字体路径
|
||||||
|
FONT_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)),'resources', 'DroidSansFallback.ttf')
|
||||||
|
|
||||||
# 选卡数量
|
# 选卡数量
|
||||||
# 最大数量
|
# 最大数量
|
||||||
CARD_MAX_NUM = 10 # 这里以后可以增加解锁功能,从最初的6格逐渐解锁到10格
|
CARD_MAX_NUM = 10 # 这里以后可以增加解锁功能,从最初的6格逐渐解锁到10格
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user