gui.rpy 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. ################################################################################
  2. ## Initialization
  3. ################################################################################
  4. ## The init offset statement causes the initialization statements in this file
  5. ## to run before init statements in any other file.
  6. init offset = -2
  7. ## Calling gui.init resets the styles to sensible default values, and sets the
  8. ## width and height of the game.
  9. init python:
  10. gui.init(1280, 720)
  11. ################################################################################
  12. ## GUI Configuration Variables
  13. ################################################################################
  14. ## Colors ######################################################################
  15. ##
  16. ## The colors of text in the interface.
  17. ## An accent color used throughout the interface to label and highlight text.
  18. define gui.accent_color = u'#cc6600'
  19. ## The color used for a text button when it is neither selected nor hovered.
  20. define gui.idle_color = u'#888888'
  21. ## The small color is used for small text, which needs to be brighter/darker to
  22. ## achieve the same effect.
  23. define gui.idle_small_color = u'#aaaaaa'
  24. ## The color that is used for buttons and bars that are hovered.
  25. define gui.hover_color = u'#e0a366'
  26. ## The color used for a text button when it is selected but not focused. A
  27. ## button is selected if it is the current screen or preference value.
  28. define gui.selected_color = u'#ffffff'
  29. ## The color used for a text button when it cannot be selected.
  30. define gui.insensitive_color = u'#8888887f'
  31. ## Colors used for the portions of bars that are not filled in. These are not
  32. ## used directly, but are used when re-generating bar image files.
  33. define gui.muted_color = u'#512800'
  34. define gui.hover_muted_color = u'#7a3d00'
  35. ## The colors used for dialogue and menu choice text.
  36. define gui.text_color = u'#ffffff'
  37. define gui.interface_text_color = u'#ffffff'
  38. ## Fonts and Font Sizes ########################################################
  39. ## The font used for in-game text.
  40. define gui.text_font = "DejaVuSans.ttf"
  41. ## The font used for character names.
  42. define gui.name_text_font = "DejaVuSans.ttf"
  43. ## The font used for out-of-game text.
  44. define gui.interface_text_font = "DejaVuSans.ttf"
  45. ## The size of normal dialogue text.
  46. define gui.text_size = 22
  47. ## The size of character names.
  48. define gui.name_text_size = 30
  49. ## The size of text in the game's user interface.
  50. define gui.interface_text_size = 22
  51. ## The size of labels in the game's user interface.
  52. define gui.label_text_size = 24
  53. ## The size of text on the notify screen.
  54. define gui.notify_text_size = 16
  55. ## The size of the game's title.
  56. define gui.title_text_size = 50
  57. ## Main and Game Menus #########################################################
  58. ## The images used for the main and game menus.
  59. define gui.main_menu_background = "gui/main_menu.png"
  60. define gui.game_menu_background = "gui/game_menu.png"
  61. ## Dialogue ####################################################################
  62. ##
  63. ## These variables control how dialogue is displayed on the screen one line at a
  64. ## time.
  65. ## The height of the textbox containing dialogue.
  66. define gui.textbox_height = 185
  67. ## The placement of the textbox vertically on the screen. 0.0 is the top, 0.5 is
  68. ## center, and 1.0 is the bottom.
  69. define gui.textbox_yalign = 1.0
  70. ## The placement of the speaking character's name, relative to the textbox.
  71. ## These can be a whole number of pixels from the left or top, or 0.5 to center.
  72. define gui.name_xpos = 240
  73. define gui.name_ypos = 0
  74. ## The horizontal alignment of the character's name. This can be 0.0 for left-
  75. ## aligned, 0.5 for centered, and 1.0 for right-aligned.
  76. define gui.name_xalign = 0.0
  77. ## The width, height, and borders of the box containing the character's name, or
  78. ## None to automatically size it.
  79. define gui.namebox_width = None
  80. define gui.namebox_height = None
  81. ## The borders of the box containing the character's name, in left, top, right,
  82. ## bottom order.
  83. define gui.namebox_borders = Borders(5, 5, 5, 5)
  84. ## If True, the background of the namebox will be tiled, if False, the
  85. ## background of the namebox will be scaled.
  86. define gui.namebox_tile = False
  87. ## The placement of dialogue relative to the textbox. These can be a whole
  88. ## number of pixels relative to the left or top side of the textbox, or 0.5 to
  89. ## center.
  90. define gui.dialogue_xpos = 268
  91. define gui.dialogue_ypos = 50
  92. ## The maximum width of dialogue text, in pixels.
  93. define gui.dialogue_width = 744
  94. ## The horizontal alignment of the dialogue text. This can be 0.0 for left-
  95. ## aligned, 0.5 for centered, and 1.0 for right-aligned.
  96. define gui.dialogue_text_xalign = 0.0
  97. ## Buttons #####################################################################
  98. ##
  99. ## These variables, along with the image files in gui/button, control aspects of
  100. ## how buttons are displayed.
  101. ## The width and height of a button, in pixels. If None, Ren'Py computes a size.
  102. define gui.button_width = None
  103. define gui.button_height = None
  104. ## The borders on each side of the button, in left, top, right, bottom order.
  105. define gui.button_borders = Borders(4, 4, 4, 4)
  106. ## If True, the background image will be tiled. If False, the background image
  107. ## will be linearly scaled.
  108. define gui.button_tile = False
  109. ## The font used by the button.
  110. define gui.button_text_font = gui.interface_text_font
  111. ## The size of the text used by the button.
  112. define gui.button_text_size = gui.interface_text_size
  113. ## The color of button text in various states.
  114. define gui.button_text_idle_color = gui.idle_color
  115. define gui.button_text_hover_color = gui.hover_color
  116. define gui.button_text_selected_color = gui.selected_color
  117. define gui.button_text_insensitive_color = gui.insensitive_color
  118. ## The horizontal alignment of the button text. (0.0 is left, 0.5 is center, 1.0
  119. ## is right).
  120. define gui.button_text_xalign = 0.0
  121. ## These variables override settings for different kinds of buttons. Please see
  122. ## the gui documentation for the kinds of buttons available, and what each is
  123. ## used for.
  124. ##
  125. ## These customizations are used by the default interface:
  126. define gui.radio_button_borders = Borders(18, 4, 4, 4)
  127. define gui.check_button_borders = Borders(18, 4, 4, 4)
  128. define gui.confirm_button_text_xalign = 0.5
  129. define gui.page_button_borders = Borders(10, 4, 10, 4)
  130. define gui.quick_button_borders = Borders(10, 4, 10, 0)
  131. define gui.quick_button_text_size = 14
  132. define gui.quick_button_text_idle_color = gui.idle_small_color
  133. define gui.quick_button_text_selected_color = gui.accent_color
  134. ## You can also add your own customizations, by adding properly-named variables.
  135. ## For example, you can uncomment the following line to set the width of a
  136. ## navigation button.
  137. # define gui.navigation_button_width = 250
  138. ## Choice Buttons ##############################################################
  139. ##
  140. ## Choice buttons are used in the in-game menus.
  141. define gui.choice_button_width = 790
  142. define gui.choice_button_height = None
  143. define gui.choice_button_tile = False
  144. define gui.choice_button_borders = Borders(100, 5, 100, 5)
  145. define gui.choice_button_text_font = gui.text_font
  146. define gui.choice_button_text_size = gui.text_size
  147. define gui.choice_button_text_xalign = 0.5
  148. define gui.choice_button_text_idle_color = "#cccccc"
  149. define gui.choice_button_text_hover_color = "#ffffff"
  150. define gui.choice_button_text_insensitive_color = "#444444"
  151. ## File Slot Buttons ###########################################################
  152. ##
  153. ## A file slot button is a special kind of button. It contains a thumbnail
  154. ## image, and text describing the contents of the save slot. A save slot uses
  155. ## image files in gui/button, like the other kinds of buttons.
  156. ## The save slot button.
  157. define gui.slot_button_width = 276
  158. define gui.slot_button_height = 206
  159. define gui.slot_button_borders = Borders(10, 10, 10, 10)
  160. define gui.slot_button_text_size = 14
  161. define gui.slot_button_text_xalign = 0.5
  162. define gui.slot_button_text_idle_color = gui.idle_small_color
  163. define gui.slot_button_text_selected_idle_color = gui.selected_color
  164. define gui.slot_button_text_selected_hover_color = gui.hover_color
  165. ## The width and height of thumbnails used by the save slots.
  166. define config.thumbnail_width = 256
  167. define config.thumbnail_height = 144
  168. ## The number of columns and rows in the grid of save slots.
  169. define gui.file_slot_cols = 3
  170. define gui.file_slot_rows = 2
  171. ## Positioning and Spacing #####################################################
  172. ##
  173. ## These variables control the positioning and spacing of various user interface
  174. ## elements.
  175. ## The position of the left side of the navigation buttons, relative to the left
  176. ## side of the screen.
  177. define gui.navigation_xpos = 40
  178. ## The vertical position of the skip indicator.
  179. define gui.skip_ypos = 10
  180. ## The vertical position of the notify screen.
  181. define gui.notify_ypos = 45
  182. ## The spacing between menu choices.
  183. define gui.choice_spacing = 22
  184. ## Buttons in the navigation section of the main and game menus.
  185. define gui.navigation_spacing = 4
  186. ## Controls the amount of spacing between preferences.
  187. define gui.pref_spacing = 10
  188. ## Controls the amount of spacing between preference buttons.
  189. define gui.pref_button_spacing = 0
  190. ## The spacing between file page buttons.
  191. define gui.page_spacing = 0
  192. ## The spacing between file slots.
  193. define gui.slot_spacing = 10
  194. ## The position of the main menu text.
  195. define gui.main_menu_text_xalign = 1.0
  196. ## Frames ######################################################################
  197. ##
  198. ## These variables control the look of frames that can contain user interface
  199. ## components when an overlay or window is not present.
  200. ## Generic frames.
  201. define gui.frame_borders = Borders(4, 4, 4, 4)
  202. ## The frame that is used as part of the confirm screen.
  203. define gui.confirm_frame_borders = Borders(40, 40, 40, 40)
  204. ## The frame that is used as part of the skip screen.
  205. define gui.skip_frame_borders = Borders(16, 5, 50, 5)
  206. ## The frame that is used as part of the notify screen.
  207. define gui.notify_frame_borders = Borders(16, 5, 40, 5)
  208. ## Should frame backgrounds be tiled?
  209. define gui.frame_tile = False
  210. ## Bars, Scrollbars, and Sliders ###############################################
  211. ##
  212. ## These control the look and size of bars, scrollbars, and sliders.
  213. ##
  214. ## The default GUI only uses sliders and vertical scrollbars. All of the other
  215. ## bars are only used in creator-written screens.
  216. ## The height of horizontal bars, scrollbars, and sliders. The width of vertical
  217. ## bars, scrollbars, and sliders.
  218. define gui.bar_size = 25
  219. define gui.scrollbar_size = 12
  220. define gui.slider_size = 25
  221. ## True if bar images should be tiled. False if they should be linearly scaled.
  222. define gui.bar_tile = False
  223. define gui.scrollbar_tile = False
  224. define gui.slider_tile = False
  225. ## Horizontal borders.
  226. define gui.bar_borders = Borders(4, 4, 4, 4)
  227. define gui.scrollbar_borders = Borders(4, 4, 4, 4)
  228. define gui.slider_borders = Borders(4, 4, 4, 4)
  229. ## Vertical borders.
  230. define gui.vbar_borders = Borders(4, 4, 4, 4)
  231. define gui.vscrollbar_borders = Borders(4, 4, 4, 4)
  232. define gui.vslider_borders = Borders(4, 4, 4, 4)
  233. ## What to do with unscrollable scrollbars in the gui. "hide" hides them, while
  234. ## None shows them.
  235. define gui.unscrollable = "hide"
  236. ## History #####################################################################
  237. ##
  238. ## The history screen displays dialogue that the player has already dismissed.
  239. ## The number of blocks of dialogue history Ren'Py will keep.
  240. define config.history_length = 250
  241. ## The height of a history screen entry, or None to make the height variable at
  242. ## the cost of performance.
  243. define gui.history_height = 140
  244. ## The position, width, and alignment of the label giving the name of the
  245. ## speaking character.
  246. define gui.history_name_xpos = 155
  247. define gui.history_name_ypos = 0
  248. define gui.history_name_width = 155
  249. define gui.history_name_xalign = 1.0
  250. ## The position, width, and alignment of the dialogue text.
  251. define gui.history_text_xpos = 170
  252. define gui.history_text_ypos = 2
  253. define gui.history_text_width = 740
  254. define gui.history_text_xalign = 0.0
  255. ## NVL-Mode ####################################################################
  256. ##
  257. ## The NVL-mode screen displays the dialogue spoken by NVL-mode characters.
  258. ## The borders of the background of the NVL-mode background window.
  259. define gui.nvl_borders = Borders(0, 10, 0, 20)
  260. ## The maximum number of NVL-mode entries Ren'Py will display. When more entries
  261. ## than this are to be show, the oldest entry will be removed.
  262. define gui.nvl_list_length = 6
  263. ## The height of an NVL-mode entry. Set this to None to have the entries
  264. ## dynamically adjust height.
  265. define gui.nvl_height = 115
  266. ## The spacing between NVL-mode entries when gui.nvl_height is None, and between
  267. ## NVL-mode entries and an NVL-mode menu.
  268. define gui.nvl_spacing = 10
  269. ## The position, width, and alignment of the label giving the name of the
  270. ## speaking character.
  271. define gui.nvl_name_xpos = 430
  272. define gui.nvl_name_ypos = 0
  273. define gui.nvl_name_width = 150
  274. define gui.nvl_name_xalign = 1.0
  275. ## The position, width, and alignment of the dialogue text.
  276. define gui.nvl_text_xpos = 450
  277. define gui.nvl_text_ypos = 8
  278. define gui.nvl_text_width = 590
  279. define gui.nvl_text_xalign = 0.0
  280. ## The position, width, and alignment of nvl_thought text (the text said by the
  281. ## nvl_narrator character.)
  282. define gui.nvl_thought_xpos = 240
  283. define gui.nvl_thought_ypos = 0
  284. define gui.nvl_thought_width = 780
  285. define gui.nvl_thought_xalign = 0.0
  286. ## The position of nvl menu_buttons.
  287. define gui.nvl_button_xpos = 450
  288. define gui.nvl_button_xalign = 0.0
  289. ## Localization ################################################################
  290. ## This controls where a line break is permitted. The default is suitable
  291. ## for most languages. A list of available values can be found at https://
  292. ## www.renpy.org/doc/html/style_properties.html#style-property-language
  293. define gui.language = "unicode"
  294. ################################################################################
  295. ## Mobile devices
  296. ################################################################################
  297. init python:
  298. ## This increases the size of the quick buttons to make them easier to touch
  299. ## on tablets and phones.
  300. @gui.variant
  301. def touch():
  302. gui.quick_button_borders = Borders(40, 14, 40, 0)
  303. ## This changes the size and spacing of various GUI elements to ensure they
  304. ## are easily visible on phones.
  305. @gui.variant
  306. def small():
  307. ## Font sizes.
  308. gui.text_size = 30
  309. gui.name_text_size = 36
  310. gui.notify_text_size = 25
  311. gui.interface_text_size = 30
  312. gui.button_text_size = 30
  313. gui.label_text_size = 34
  314. ## Adjust the location of the textbox.
  315. gui.textbox_height = 240
  316. gui.name_xpos = 80
  317. gui.dialogue_xpos = 90
  318. gui.dialogue_width = 1100
  319. ## Change the size and spacing of various things.
  320. gui.slider_size = 36
  321. gui.choice_button_width = 1240
  322. gui.choice_button_text_size = 30
  323. gui.navigation_spacing = 20
  324. gui.pref_button_spacing = 10
  325. gui.history_height = 190
  326. gui.history_text_width = 690
  327. gui.quick_button_text_size = 20
  328. ## File button layout.
  329. gui.file_slot_cols = 2
  330. gui.file_slot_rows = 2
  331. ## NVL-mode.
  332. gui.nvl_height = 170
  333. gui.nvl_name_width = 305
  334. gui.nvl_name_xpos = 325
  335. gui.nvl_text_width = 915
  336. gui.nvl_text_xpos = 345
  337. gui.nvl_text_ypos = 5
  338. gui.nvl_thought_width = 1240
  339. gui.nvl_thought_xpos = 20
  340. gui.nvl_button_width = 1240
  341. gui.nvl_button_xpos = 20