问题
I am making a game using pygame and I wanted to add cut scenes to it. The pygame movie module however doesn’t work anymore so I had to resort to using moviepy. Moviepy isn’t that well documented from what I can see so I’m having some trouble figuring it out. I got it to work using this block of code but all I need now is to full screen it (desired window screen is 640x400). So how would I go about doing so? Thank you in advance.
from moviepy.editor import *
from pygame import *# Window display
WIN_WIDTH = 640
WIN_HEIGHT = 400
HALF_WIDTH = int(WIN_WIDTH / 2)
HALF_HEIGHT = int(WIN_HEIGHT / 2)
DISPLAY = (WIN_WIDTH, WIN_HEIGHT)
DEPTH = 32
FLAGS = FULLSCREEN
#display.set_mode(DISPLAY, FLAGS, DEPTH) #define screen values
display.set_caption("I'm Working!")
Credits = 'Untitled.mp4'
def playVid(video):
clip = VideoFileClip(video)
clip.resize(DISPLAY).preview()
return
playVid(Credits)
回答1:
As of moviepy version 0.2.3.4, you can call clip.preview(fullscreen=True)
to make your preview fullscreen. Press Esc
or the quit button to quit. See the pull request for further info.
Run pip install moviepy --upgrade
to update moviepy to the latest version.
来源:https://stackoverflow.com/questions/49941881/how-to-resize-moviepy-to-fullscreen