From 33c1a20cbe224d39889bad2e0ba5bb8db233592d Mon Sep 17 00:00:00 2001 From: Rico040 <93081680+Rico040@users.noreply.github.com> Date: Thu, 7 Apr 2022 23:47:10 +0900 Subject: [PATCH] finally icon --- build.bat | 2 +- main.py | 21 ++++++++++----------- resources/icon.ico | Bin 0 -> 6492 bytes resources/icon.png | Bin 0 -> 179 bytes 4 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 resources/icon.ico create mode 100644 resources/icon.png diff --git a/build.bat b/build.bat index 3ff3c1d..b868451 100644 --- a/build.bat +++ b/build.bat @@ -1 +1 @@ -pyinstaller --add-data ./resources;resources --upx-dir "C:\Program Files\upx-3.96-win64" -w -F main.py \ No newline at end of file +pyinstaller --add-data ./resources;resources -i ./resources/icon.ico --upx-dir "C:\Program Files\upx-3.96-win64" -w -F main.py \ No newline at end of file diff --git a/main.py b/main.py index 5f7a65f..ffbfb56 100644 --- a/main.py +++ b/main.py @@ -39,6 +39,14 @@ # length of game. it should be from 1 to 10 max_input_char = 4 +def resource_path(relative_path): + # need to package a really single file + try: + base_path = sys._MEIPASS + except Exception: + base_path = os.path.abspath(".") + + return os.path.join(base_path, relative_path) # set many things global cows, bulls, step, l_result, l_gueesp, gueesp @@ -51,17 +59,6 @@ pr.init_physics() pr.set_target_fps(SET_FPS) # why i only now write it?... set target frame per seconds - -def resource_path(relative_path): - # need to package a really single file - try: - base_path = sys._MEIPASS - except Exception: - base_path = os.path.abspath(".") - - return os.path.join(base_path, relative_path) - - font: Font = pr.load_font(resource_path("resources/unifont.fnt")) # DON'T WRITE IT ON MAIN LOOP AND DON'T LOAD IT FIRST! seven_font: Font = pr.load_font_ex('C:/Windows/Fonts/calibril.ttf', 16, [int(1 + i) for i in range(0, 1206)], 1206) moonpng = pr.load_texture(resource_path('resources/moon.png')) @@ -74,6 +71,8 @@ def resource_path(relative_path): mutetex = pr.load_texture(resource_path('resources/mute.png')) mutedtex = pr.load_texture(resource_path('resources/muted.png')) backbtntex = pr.load_texture(resource_path('resources/backbtn.png')) +icontex = pr.load_image(resource_path('resources/icon.png')) +pr.set_window_icon(icontex) the_page_is = 0 the_heit_is = 190 about_origin = pr.Vector2(12, 82) diff --git a/resources/icon.ico b/resources/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..1292f974869a0382ecb72783c230476fbab1b375 GIT binary patch literal 6492 zcmeHMc~q0vwm;vOfeg$;p)y58nd$`xgvyXlMFFi61OydGtW^8yZ{5dQtaJ9+XYc*n z`|NL@ApjtN2DG&SY+0ZP0B{uk8yS71pTfR70sxEkkyb#Of&$>+@R9b0JQ4{24Ewu0 zq`x2oz~gX?6#yLnNPi7^oiwNf{;BLKm;i)o0C0@6&QpUiivfo?$c16;yt3O-%Z47Q4+D6Ve za^2Qqp8axD-oYoFfC)2M?O%d+iwUQkGf#p+)Jx7|M{lbi9bo-J=$JUoG;5|la6Lk)zPx!WEcHj8a&2Y;^GGap7T?x9pJHI3)fPZlMad*P6cb%NW>fn#YJDX|!W`*qKEe^vm1oRQA?d1k2oxM`+IC+%31S-6M4B1*l5gE*jf4Bs*$DeX%Y#30 zg9Z7l88;5Z#C-Up8$~KNf;{_D%QbNa+KP51JLU<=EXb?!mhrsd?N0`MpZgn}nP+T2 zpH$trX}14B<4QA%Cbp518+iSQuEDCqB6aMCl~hGKT8VHdxmMR)t4V626KF)f?`5Y2 zeaQK=kSt`X{G2IUOTUw8U`^8YUSjv4^Bcx_p2rjkXzf}9K*PKtbtD>=B1xJvbUl^O*Cx^8VBnpM3^kt@OT?vt+NU( z?r1rdeJ-pyC^ci%>yx5=JJDY>zS2pgdl4srV?xF z(!*6ZGLgOQlATv`b|sgM4fzkm8;DTK^cxnXi~1+IOk))K4sJ(mAE_ zZSI@Jjjcxl78-wZ@wtJ;iKZpLm49vWG&=Tu^lF?@jY<~EirrmwUk!Ioj*VE6EHO%$ z@N}y|8gf*WLo{xSjOpnIS1U({)KhRBTU*(7s@V>Nkv!x$-}9+_OkIRqf`uY<)!X%t z>plsy15C3L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$xh)#c` zcD)Q*ii{OL$-;aA_%2_b=8GgJS zJTfB}s=6>Vxn9PE9s8gJ9qR)4o5F_Yy=#Q_901CA^i?8aH3EWc^6e>Q7%bBXbB%=m VvLc}p3C_m9e*ItwI{EwQ|8G0)erf;! literal 0 HcmV?d00001 diff --git a/resources/icon.png b/resources/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..4bc948529d8a7268b779e7fba1fa4633a8771956 GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|ay?xfLo9mt zPWI+vP~>qIp7}f8a`UQ$dSU){}Qy(Ywi%W{g?9-;r6L#2|^7H=vm=Th50yJi3EhPSPU c9$M|cGF{)4@y6`0K#LhXUHx3vIVCg!0Evb{OaK4? literal 0 HcmV?d00001