Page 1 of 1

Way to make the analog clock pretty?

Posted: Sat Nov 18, 2017 11:15 pm
by justloveme94
Hello everyone,

I am very new to Ren'Py and coding in general. I am currently just messing around with the system at the moment. I stumbled upon the analog clock and I followed the tutorial on the wiki and it worked. My only compliant is that it is a bit of eye sore. I was hoping to insert a clock with a transparent background. One that would just sit on top of the background. Any help would be appreciated.
Clock Example.PNG

Re: Way to make the analog clock pretty?

Posted: Sat Nov 18, 2017 11:56 pm
by mitoky
For it to be transparent, you have to delete the black part in an art programm and then safe it as png file.

Re: Way to make the analog clock pretty?

Posted: Sun Nov 19, 2017 12:16 am
by justloveme94
Ah yes, I did think of that! Unfortunately, I went into Gimp and noticed that the clock face already had a transparent background.

Re: Way to make the analog clock pretty?

Posted: Sun Nov 19, 2017 12:21 am
by mitoky
So the images are transparent but it doenst appears transparent in renpy or the images arent transparent? (Please excuse, i am a bit confused)

Re: Way to make the analog clock pretty?

Posted: Sun Nov 19, 2017 12:24 am
by trooper6
I assume you are using the old code from the wiki that is no longer supported. How are you adding that clock to the game? Also, you might want to check out my Clock tutorial which is linked in my signature.

Re: Way to make the analog clock pretty?

Posted: Sun Nov 19, 2017 12:31 am
by justloveme94
Yes, I was using the wikia! I couldn't find a more recent post but I guess I wasn't looking hard enough! Thank you very much. I will definitely check out the link in your sig and give it a try.

Re: Way to make the analog clock pretty?

Posted: Sun Nov 19, 2017 1:27 am
by Scribbles
it looks like your clock is inside of a frame, so you can either change the frame to be transparent in GUI, or change the type of frame in the code for that screen? If you post the code you used, maybe we can help better :) (between [ code ] [ /code ] tags)

https://www.renpy.org/doc/html/screens.html

Re: Way to make the analog clock pretty?

Posted: Mon Nov 20, 2017 8:10 pm
by justloveme94
I tried using the other instructions that were provided in the signature but unfortunately it is still coming up the same, even with the different code. The clock image is still the same from the wikia.

Code: Select all

image clock = "clock.png" # Short Clockhand
image clock_1 = "clock_1.png" # Long Clockhand
image clock_2 = "clock_2.png" # Clockface
image bg Fates Background = "bg Fates Background.png"

init:
    $ minutes = 540

transform rotateshort:
    xanchor 0.5
    yanchor 0.5
    xalign 0.5
    yalign 0.5
    rotate (minutes*6)
    
transform rotatelong:
    xanchor 0.5
    yanchor 0.5
    xalign 0.5
    yalign 0.5
    rotate (minutes*0.5)

transform alpha_dissolve:
    alpha 0.0
    linear 0.5 alpha 1.0
    on hide:
        linear 0.5 alpha 0
    # This is to fade in the clock.

screen clock:
    frame at alpha_dissolve:
        xmaximum 250 # X size of clock graphic
        ymaximum 250 # Y size of clock graphic
        xalign 0.99 # X placement on screen
        yalign 0.02 # Y placement on screen
        add "clock_2"
        add "clock_1" at rotatelong
        add "clock" at rotateshort

label start:

    scene bg Fates Background
    
    show screen clock

    "It is already 9:00AM."
    "He is very late."
    "But he is my friend so I will wait."
    $ minutes += 2
    "Two minutes has passed."
    $ minutes += 2
    "Four minutes has passed."
    $ minutes += 2
    "Six minutes has passed."
    "HE IS LATE! I KILL HIM!"

    hide screen clock

Re: Way to make the analog clock pretty?

Posted: Mon Nov 20, 2017 9:26 pm
by Imperf3kt
Try adding alpha True to your frame (not alpha = True) within the clock screen