Button opacity in main menu screen

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
jess
Newbie
Posts: 2
Joined: Fri Feb 13, 2009 5:09 pm
Contact:

Button opacity in main menu screen

#1 Post by jess »

hey. I'm pretty new to Ren'Py, and I'm trying to form my short story, but I'm new to coding and have a question.

is there any way to dim the opacity of the buttons on the main menu ("Start Game", "Load Game", etc.) so that they are semi-transparent?

thanks. :)

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Button opacity in main menu screen

#2 Post by PyTom »

Sure. Any of the colors used in options.rpy can include an alpha, which will make the appropriate elements transparent.

So instead of

widget = "#003c78",

one can have

widget = "#003c7880",

which is 50% transparent.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

jess
Newbie
Posts: 2
Joined: Fri Feb 13, 2009 5:09 pm
Contact:

Re: Button opacity in main menu screen

#3 Post by jess »

thank you for the reply! though I'm not exactly sure how to generate a color code that includes an alpha.

I'm looking to go down to 75% opacity with #d9d9d9. how would I determine the correct value for this?

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Button opacity in main menu screen

#4 Post by PyTom »

Here's a handy* chart:

Code: Select all

percent decimal hex
     0%       0  00
     5%      12  0c
    10%      25  19
    15%      38  26
    20%      51  33
    25%      63  3f
    30%      76  4c
    35%      89  59
    40%     102  66
    45%     114  72
    50%     127  7f
    55%     140  8c
    60%     153  99
    65%     165  a5
    70%     178  b2
    75%     191  bf
    80%     204  cc
    85%     216  d8
    90%     229  e5
    95%     242  f2
   100%     255  ff
* Handiness not guaranteed.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Google [Bot]