Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Commit

Permalink
finally icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico040 committed Apr 7, 2022
1 parent 2dd9585 commit 33c1a20
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyinstaller --add-data ./resources;resources --upx-dir "C:\Program Files\upx-3.96-win64" -w -F main.py
pyinstaller --add-data ./resources;resources -i ./resources/icon.ico --upx-dir "C:\Program Files\upx-3.96-win64" -w -F main.py
21 changes: 10 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'))
Expand All @@ -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)
Expand Down
Binary file added resources/icon.ico
Binary file not shown.
Binary file added resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 33c1a20

Please sign in to comment.