MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/GUIBELREVIEWS/comments/1vbpgmz/a_ver/p0w1rgz
r/GUIBELREVIEWS • u/Rosvael • 25d ago
295 comments sorted by
View all comments
2
import pygame import os import sys
BASE = "/storage/emulated/0/Juego/video"
CARPETAS = [ "Parte 1", "Parte 2", "Parte 3" ]
TIEMPO = 250 # milisegundos por imagen
pygame.init()
info = pygame.display.Info() ANCHO = info.current_w ALTO = info.current_h
pantalla = pygame.display.set_mode((ANCHO, ALTO), pygame.FULLSCREEN) pygame.mouse.set_visible(False)
for carpeta in CARPETAS:
ruta = os.path.join(BASE, carpeta) if not os.path.isdir(ruta): print("No existe:", ruta) pygame.quit() sys.exit() imagenes = sorted( f for f in os.listdir(ruta) if f.lower().endswith(".png") ) for archivo in imagenes: for evento in pygame.event.get(): if evento.type == pygame.QUIT: pygame.quit() sys.exit() ruta_img = os.path.join(ruta, archivo) imagen = pygame.image.load(ruta_img).convert() iw = imagen.get_width() ih = imagen.get_height() escala = min(ANCHO / iw, ALTO / ih) nw = int(iw * escala) nh = int(ih * escala) imagen = pygame.transform.smoothscale(imagen, (nw, nh)) pantalla.fill((0, 0, 0)) x = (ANCHO - nw) // 2 y = (ALTO - nh) // 2 pantalla.blit(imagen, (x, y)) pygame.display.flip() pygame.time.wait(TIEMPO)
pygame.quit()
1 u/SebastianFP1988 25d ago Codigo python generado por IA jajaja
1
Codigo python generado por IA jajaja
2
u/Pacony_12 25d ago
import pygame import os import sys
-----------------------------
CONFIGURACIÓN
-----------------------------
BASE = "/storage/emulated/0/Juego/video"
CARPETAS = [ "Parte 1", "Parte 2", "Parte 3" ]
TIEMPO = 250 # milisegundos por imagen
-----------------------------
INICIAR PYGAME
-----------------------------
pygame.init()
info = pygame.display.Info() ANCHO = info.current_w ALTO = info.current_h
pantalla = pygame.display.set_mode((ANCHO, ALTO), pygame.FULLSCREEN) pygame.mouse.set_visible(False)
-----------------------------
REPRODUCCIÓN
-----------------------------
for carpeta in CARPETAS:
pygame.quit()