It really seems like it should be easier to pull off than this, doesn't it? In any case, I'm having...
immense difficulty figuring out how to rotate something.
This is the relevant code, in my screens.rpy.
Code: Select all
transform rotateshort:
rotate (284 - minutes) / 284 * 360
transform alpha_dissolve:
xpos 0.85
ypos 0.2
xanchor 0.5
yanchor 0.5
alpha 0.0
linear 0.5 alpha 1.0
on hide:
linear 0.5 alpha 0
##This is to fade in the clock.
screen ticktock:
add "clockback.png" at alpha_dissolve
add "clockhand.png" at alpha_dissolve, rotateshort
The relevant variable, is declared in variable.rpy, in the following format...
And, finally, the value of minutes is modified elsewhere, in a custom file, 01functions.rpy, where it says...
Code: Select all
label addtime(amount):
show screen ticktock
play sound "sounds/ticktock.wav"
pause(2)
$ minutes -= amount * 20
halt ""
hide screen ticktock
return
I created this as a custom function, because I'm expecting to use it multiple times. The rest of the function is called, and executes, correctly, so I don't know what the malfunction is here. The clock simply isn't rotated at all, and, for some reason, it appears on the left hand side of the screen instead of the right hand the first time the ticktock screen is run. But only the first time. Of note, however, is that the image
will rotate if I replace "(284 - minutes) / 284 * 360" with an actual number. So the problem must be in minutes... somehow. I've confirmed elsewhere that the minutes variable
does actually decrease when that addtime function is called, so I really can't understand what I'm doing wrong. Still, if you can, please help. I've been going insane trying to figure this out all day.