Advertisement
barsunduk

renpy change wallpaper

Sep 9th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. init python:
  2.     import ctypes, os
  3.     # здесь лежат старые обои:
  4.     def_wall_fn = os.getenv("APPDATA") + "/Microsoft/Windows/Themes/TranscodedWallpaper.jpg"
  5.     # папка с картинками игры
  6.     imgs_path = config.basedir + "/game/images/"
  7.     # копируем старые обои в папку картинок
  8.     temp_wall_fn = imgs_path + "TranscodedWallpaper.jpg"
  9.     os.system ('copy "%s" "%s"' % (def_wall_fn, temp_wall_fn))
  10.     # функция для смены обоев
  11.     def set_wall(name):
  12.         fn = imgs_path + name
  13.         ctypes.windll.user32.SystemParametersInfoW(20, 0, fn, 0)
  14.     # функция для возвращения старых обоев
  15.     def res_wall():
  16.         ctypes.windll.user32.SystemParametersInfoW(20, 0, temp_wall_fn, 0)
  17.  
  18. label start:
  19.     # сменить обои
  20.     $ set_wall("wallpaper.jpg")
  21.     pause
  22.     # вернуть прежние
  23.     $ res_wall()
  24.     return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement