更改非Nuitka程序图标设定
This commit is contained in:
parent
1dd0894adf
commit
2c0dc94c75
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@ -45,6 +45,7 @@ jobs:
|
|||||||
--distpath ./out `
|
--distpath ./out `
|
||||||
--noconsole `
|
--noconsole `
|
||||||
--add-data="resources;./resources" `
|
--add-data="resources;./resources" `
|
||||||
|
--add-data="pypvz-exec-logo.png;./pypvz-exec-logo.png" `
|
||||||
-i ./pypvz.ico
|
-i ./pypvz.ico
|
||||||
|
|
||||||
- name: Release the version built by pyinstaller
|
- name: Release the version built by pyinstaller
|
||||||
|
|||||||
BIN
pypvz-exec-logo.png
Normal file
BIN
pypvz-exec-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@ -8,6 +8,8 @@ GAME_RATE = 1
|
|||||||
|
|
||||||
# 窗口标题
|
# 窗口标题
|
||||||
ORIGINAL_CAPTION = 'pypvz'
|
ORIGINAL_CAPTION = 'pypvz'
|
||||||
|
# 窗口图标
|
||||||
|
ORIGINAL_LOGO = "pypvz-exec-logo.png"
|
||||||
|
|
||||||
# 游戏模式
|
# 游戏模式
|
||||||
GAME_MODE = 'mode'
|
GAME_MODE = 'mode'
|
||||||
|
|||||||
@ -203,6 +203,10 @@ def loadPlantImageRect():
|
|||||||
pg.init()
|
pg.init()
|
||||||
pg.display.set_caption(c.ORIGINAL_CAPTION) # 设置标题
|
pg.display.set_caption(c.ORIGINAL_CAPTION) # 设置标题
|
||||||
SCREEN = pg.display.set_mode(c.SCREEN_SIZE) # 设置初始屏幕
|
SCREEN = pg.display.set_mode(c.SCREEN_SIZE) # 设置初始屏幕
|
||||||
|
try: # 设置窗口图标,仅对非Nuitka时生效,Nuitka不需要包括额外的图标文件,自动跳过这一过程即可
|
||||||
|
pg.display.set_icon(pg.image.load(os.path.join(os.path.dirname(os.path.dirname(__file__)), c.ORIGINAL_LOGO)))
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
GFX = load_all_gfx(os.path.join(os.path.dirname(os.path.dirname(__file__)) ,os.path.join("resources","graphics")))
|
GFX = load_all_gfx(os.path.join(os.path.dirname(os.path.dirname(__file__)) ,os.path.join("resources","graphics")))
|
||||||
ZOMBIE_RECT = loadZombieImageRect()
|
ZOMBIE_RECT = loadZombieImageRect()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user