Way to make the analog clock pretty?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
justloveme94
Newbie
Posts: 20
Joined: Sat Nov 18, 2017 11:07 pm
Contact:

Way to make the analog clock pretty?

#1 Post 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

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Way to make the analog clock pretty?

#2 Post 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.

User avatar
justloveme94
Newbie
Posts: 20
Joined: Sat Nov 18, 2017 11:07 pm
Contact:

Re: Way to make the analog clock pretty?

#3 Post 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.

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Way to make the analog clock pretty?

#4 Post 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)

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Way to make the analog clock pretty?

#5 Post 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.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
justloveme94
Newbie
Posts: 20
Joined: Sat Nov 18, 2017 11:07 pm
Contact:

Re: Way to make the analog clock pretty?

#6 Post 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.

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Way to make the analog clock pretty?

#7 Post 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
Image - Image -Image

User avatar
justloveme94
Newbie
Posts: 20
Joined: Sat Nov 18, 2017 11:07 pm
Contact:

Re: Way to make the analog clock pretty?

#8 Post 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

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Way to make the analog clock pretty?

#9 Post by Imperf3kt »

Try adding alpha True to your frame (not alpha = True) within the clock screen
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Ocelot