私は240x160のビデオを持っていますが、私はユーザーが最終的なゲームで(ソースに見られるように)解像度をいくつかの異なるサイズに変更できるようにしたいと考えています。私はdocsを読んで、私の経験ではビデオが自動的にサイズ変更されるはずだと言っていました。長さおよそResize PyGame Video
import pygame
#Scales
GAMEBOY = 1 #240x160 (Standard gameboy resolution)
FOUREIGHTYP = 2 #480x320 (480p resolution)
SEVENTWENTYP = 4 #960x640 (720p resolution)
TENEIGHTYP = 6 #1440x960 (1080p resolution)
chosenScale = SEVENTWENTYP
resolution = (240*chosenScale, 160*chosenScale)
FPS = 60
movie1Counter = 0
movie2Counter = 1
movie1Playing = True
movie2Playing = False
playedEarly = False
earlyCounter = 0
keypressed = False
pygame.init()
pygame.mixer.quit()
clock = pygame.time.Clock()
movie = pygame.movie.Movie('./intromovie1.mpg')
screen = pygame.display.set_mode(movie.get_size())
movie_screen = pygame.Surface(movie.get_size()).convert()
movie.set_display(movie_screen)
movie.play()
movie.set_volume(0.5)
playing = True
while playing:
for event in pygame.event.get():
if event.type == pygame.QUIT:
movie1.stop()
playing = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
if movie1Playing:
movie.stop()
playedEarly = True
movie1Playing = False
movie2Playing = True
movie = pygame.movie.Movie('./intromovie2.mpg')
movie = pygame.movie.Movie('./intromovie2.mpg')
movie_screen = pygame.Surface(movie.get_size()).convert()
movie.set_display(movie_screen)
movie.play()
movie.set_volume(0)
if event.type == pygame.KEYUP:
pass
if movie.get_busy() == 0:
if movie1Playing == True:
movie.stop()
movie1Playing = False
movie2Playing = True
movie = pygame.movie.Movie('./intromovie2.mpg')
movie = pygame.movie.Movie('./intromovie2.mpg')
movie_screen = pygame.Surface(movie.get_size()).convert()
movie.set_display(movie_screen)
movie.play()
movie.set_volume(0.5)
else:
movie.stop()
movie1Playing = True
movie2Playing = False
movie = pygame.movie.Movie('./intromovie1.mpg')
movie = pygame.movie.Movie('./intromovie1.mpg')
movie_screen = pygame.Surface(movie.get_size())
movie.set_display(movie_screen)
movie.play()
movie.set_volume(0.5)
if playedEarly:
earlyCounter += 1
if earlyCounter > 67:
movie.set_volume(0.5)
playedEarly = False
earlyCounter = 0
screen.blit(movie_screen,(0,0))
pygame.display.update()
clock.tick(FPS)
pygame.quit()
申し訳ありませんが、私はpygameのダウンロードに新たなんだと私はあなたたちはこの問題を解決するために必要なものはよく分からない:ここに私のソースコードです。また、screenとmovie_screenを変更しようとしましたが、ウィンドウの解像度をビデオよりも大きくすると、画面の左上に表示されます。
ありがとうございます!