A visual novel made for the Ludum Dare 38 72-hour game development jam. https://gelatolabs.xyz/sdbwvn/

gui.rpy 15KB

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