I have this VN where you sell fried lizards. And in the middle of it all is a clock system where every decision you make will have to revolve around the clock. This is a very important component of the VN... without it, everything falls apart.
What I have here is the working code (thanks Alex) that works almost perfectly (position, rotation, everything) but doesn't quite disappear out of screen as intended. So PyTom provided an edited and updated code (thanks) which eliminates the dissolve problem but there is another problem.
Here are the images used in the clock code:

The Clock Face (clock_2.png)

Long Clock Hand (clock.png)

Short Clock Hand (clock_1.png)
Here is the updated clock code:
Code: Select all
init python:
renpy.image("clock", "gui_set/clock.png") # Short Clockhand
renpy.image("clock_1", "gui_set/clock_1.png") # Long Clockhand
renpy.image("clock_2", "gui_set/clock_2.png") # Clockface
def Clocks():
if clock: # if False - clock is hide
ui.at(Position(xpos=150, ypos=140, xanchor="center", yanchor="center"))
ui.add("clock_2")
# xalign and yalign can be replaced by xpos and ypos - position where the center of the clock should be
# this segment is the one responsible for the clockface
ui.at(RotoZoom((minutes*6), (minutes*6), 5.0, 1, 1, 1, rot_bounce= False, rot_anim_timebase=False, opaque=False))
ui.at(Position(xpos=150, ypos=140, xanchor="center", yanchor="center"))
ui.add("clock")
# this segment is the one responsible for the short clock hand.
ui.at(RotoZoom ((minutes*0.5), (minutes*0.5), 5.0, 1, 1, 1, rot_bounce= False, rot_anim_timebase=False, opaque=False))
ui.at(Position(xpos=150, ypos=140, xanchor="center", yanchor="center"))
ui.add("clock_1")
# this segment is the one responsible for the long clock hand.
config.overlay_functions.append(Clocks)The clock face will be shown on screen at position xpos=150, ypos=140 with center anchor followed by the clock hands, PNG's with transparencies that are the same size as the clockface.
Code: Select all
$ clock = False
with dissolveWhen set to "False" Clock will disappear with "dissolve"
Code: Select all
$ minutes = 720To add time you use code like this
Code: Select all
$ minutes += 1So if your clock count is...
Code: Select all
$ minutes = 0And you add something like this
Code: Select all
$ minutes += 60So it's like this...
Code: Select all
# Clock Guide
# 12:00 MN - 0
# 1:00 AM - 60
# 2:00 AM - 120
# 3:00 AM - 180
# 4:00 AM - 240
# 5:00 AM - 300
# 6:00 AM - 360
# 7:00 AM - 420
# 8:00 AM - 480
# 9:00 AM - 540
# 10:00 AM - 600
# 11:00 AM - 660
# 12:00 NN - 720
# 1:00 PM - 780
# 2:00 PM - 840
# 3:00 PM - 900
# 4:00 PM - 960
# 5:00 PM - 1020
# 6:00 PM - 1080
# 7:00 PM - 1140
# 8:00 PM - 1200
# 9:00 PM - 1260
# 10:00 PM - 1320
# 11:00 PM - 1380
All I needed now is to position the clock hands precisely at the center of the clockface. I tried everything in my limited capabilities but I've exhausted every once of my processing power.
Please help me... this poor old battered man...
