Advertisement
barsunduk

renpy change resolution

Apr 27th, 2016
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.40 KB | None | 0 0
  1. init python:
  2.     # своя версия команды show
  3.     def my_show(name, at_list=[], layer=None, what=None, zorder=None, tag=None, behind=[], atl=None, transient=False, munge_name=True):
  4.         # добавляем в хвост имени разрешение
  5.         name = name + ("x" + str(config.screen_width) + "x" + str(config.screen_height), )
  6.         # вызываем стандартную команду show
  7.         renpy.show(name, at_list, layer, what, zorder, tag, behind, atl, transient, munge_name)
  8.     # меняем вызов команды show на наш вариант
  9.     config.show = my_show
  10.     # смена разрешения
  11.     def resolution(w = 800, h = 600):
  12.         config.screen_width, config.screen_height = (w, h)
  13.         # перерисовка окна (способ дурацкий, но другого не придумалось)
  14.         fs = _preferences.fullscreen
  15.         Preference("display", 1.0)()
  16.         if fs:
  17.             Preference("display", "fullscreen")()
  18.     # превращаем в action, чтобы можно было привязать к кнопке
  19.     Resolution = renpy.curry(resolution)
  20. init:
  21.     image cg x800x600 = "images/cg_x800x600.jpg"
  22.     image cg x1920x1080 = "images/cg_x1920x1080.jpg"
  23. label start:
  24.     show cg
  25.     pause
  26.     $ resolution(1920, 1080)
  27.     show cg
  28.     pause
  29.     $ resolution(800, 600)
  30.     return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement