A tip for Photoshop-Ren’Py that Gamma only just discovered which Dovah secretly knew for years
Rectangle coordinates
tl;dr create a rectangle with the right aspect ratio in your photoshop file, and activate the Transformation tool (ctrl-t, command-t), and move the rectangle around. In the information panel, the (x,y) coordinate will be the upper left corner of the rectangle, and it will be static. You can move your cursor around or alt-tab between programs, and that value will remain the same.
To animate backgrounds (and other images) in Ren’Py, we use the built-in Animation and Transformation Language (ATL). A common use case is panning between different areas on a large background.
scene bg saloon_night4 with dissolve:
size (1280,720) crop (0,0,3840,2160)
pause .4
linear 1.3 crop (0,400, 1280,720)
In the above snippet, we have a background of size 3840x2160. When the background is first shown on screen, you see the entire image. A short whiile later, the view moves to the upper left corner in a zoomed-in manner. That upper left corner is defined by grabbing a 1280x720 rectangle starting at the coordinate (0,400).
To get these coordinates for arbitrarily located rectangles in the image, Gamma was very painstakingly using the rectangle select tool to draw a rectangle, move it around, hovering the cursor over the upper left corner to get the (X,Y) coordinate, and then memorizing the numbers to rapidly type them into the game code before the numbers disappeared fromm memory. Needless to say, this was an extremely painful (both mentally and physically, ouch wrist) process.
It only just recently occurred to Gamma to create a rectangle and drag it around on top of the background in order to determine where to crop the image. An added bonus from this idea is that using the Transform tool to move it around, Gamma discovered that the upper left corner coordinate would remain fixed in the information panel!
Dov had been using the rectangle technique for at least two years.
Questions or Comments?
Feel free to send in any AG-related questions! Our Ask Box is always open.
Thanks so much for all of your amazing support, and stay safe out there!