clone and modify arcade to stop text scale and speed up text display

This commit is contained in:
2019-09-27 17:43:53 +02:00
parent f8e8336fa7
commit 55b6805c41
825 changed files with 31523 additions and 84 deletions

View File

@ -0,0 +1,8 @@
rem @echo off
for /f %%i in ('python -c "import site; print(site.getsitepackages()[0])"') do set PYTHON_ROOT="%%i"
rem copy %PYTHON_ROOT%\Lib\site-packages\arcade\Win64\avbin.dll .
rem copy avbin.dll avbin64.dll
rem pyinstaller --exclude-module tkinter --add-data resources;resources --add-data ./avbin64.dll;. --add-data ./avbin.dll;Win64 --onefile --noconsole sample.py
rem del avbin.dll
rem del avbin64.dll
rem pause

View File

@ -0,0 +1,16 @@
import site
import shutil
import os
import subprocess
python_root = site.getsitepackages()[0]
shutil.copyfile(f"{python_root}/Lib/site-packages/arcade/Win64/avbin.dll", "avbin.dll")
shutil.copyfile(f"avbin.dll", "avbin64.dll")
sp = subprocess.run(["pyinstaller", "--exclude-module", "tkinter", "--add-data", "resources;resources", "--add-data", "./avbin64.dll;.", "--add-data", "./avbin.dll;Win64", "--onefile", "--noconsole", "sample.py"], stdout=subprocess.PIPE)
# rem pyinstaller --exclude-module tkinter --add-data resources;resources --add-data ./avbin64.dll;. --add-data ./avbin.dll;Win64 --onefile --noconsole sample.py
# print(sp.stdout)
os.unlink("avbin.dll")
os.unlink("avbin64.dll")

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -0,0 +1,36 @@
import arcade
import pyglet
import time
import sys
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 500
TITLE = 'Arcade cx_Freeze Sample'
BACKGROUND_COLOR = arcade.color.WHITE
def resource_path(file):
path = 'resources/' + file
# are we in a frozen environment (e.g. pyInstaller)?
if getattr(sys, 'frozen', False):
path = sys._MEIPASS.replace('\\', '/') + '/' + path
return path
def main():
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, TITLE)
arcade.set_background_color(BACKGROUND_COLOR)
arcade.start_render()
arcade.draw_circle_filled(400, 250, 100, arcade.color.BLACK)
# load image
image = arcade.load_texture(resource_path('character.png'))
arcade.draw_texture_rectangle(200, 250, image.width, image.height, image)
# load sound
sound = arcade.sound.load_sound(resource_path('cat-meow.wav'))
arcade.sound.play_sound(sound)
arcade.finish_render()
arcade.run()
return
main()