- Ren'py screen.rpy file
The screen.rpy that holds the bulk of code for the games interface is 1509 lines long, to construct a new interface we often have to change every single line in this file, however, most of the time you are working only on two or three sections of the file, usually the top that holds the styles and a section in the middle.
but scrolling down and finding the screen you have been working on, often take more of your time than the actual coding.
My solution always been breaking down the file into more manageable chunks:
- styles.rpy holds the code for general styling of the projects interface.
- main.rpy holds the code for the main menu and the navigation bar.
- chat.rpy holds the code for anything related to the games dialogue such as say, input, choice, quick menu, history and NVL screens.
- menus.rpy holds the code to save, load and preferences screens.
- others.rpy for all other small bits and parts of the interface plusd help and about screen that usually remain untouched.
I keep these files in a folder named "ui" alongside any graphics I create for interface.
this way instead of going up and down to find the part I want to edit, I simply open all of those or the ones I want to edit in the editor and click the tabs for a fast and easy workflow.
my suggestion is: implementing this change as a default, for all of renpy users to benefit from this workflow boost on all of the projects that they create.
Mockups / Examples
you can imagine how easier it is to work on few lines of code at a time.
also finding the right file.
it's not that hard to do but to make it even easier, here's the screen broken into those chunks:
- speeding up the workflow
- stripping down few lines in the code that are not necessary anymore
- easier to find and debug problems in the code
- different members of the team can work on different part of the code without worrying about messing up each other's work
- it's easier to grab and send only the interface to the client or other members of your team when all of it is contained in a single folder
as a side suggestion: I suggest moving the "GUI.rpy" into the GUI folder to make it easier to move a changed GUI to another project
Posted on Utopian.io - Rewarding Open Source Contributors