Menu buttons have individual styles

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
abysswatcher
Regular
Posts: 42
Joined: Sun Apr 12, 2020 11:50 pm
Projects: To-Live:The Struggle
Organization: Youyu de Shijie(憂鬱的世界)
Github: LuYifeng112
itch: https://luyifeng.itc
Location: New Zealand
Contact:

Menu buttons have individual styles

#1 Post by abysswatcher »

I was wondering for the choice many how can I make a button different? For example, if one of the choices was a "judgement" stat dice roll (to unlock a possible path) how would I be able to change the colour or button background by defining it as a special button?
The goal of the revolution is to achieve the people's rights, but during the course of the revolution, we must stress military power - and the two are mutually contradictory.
-Sun Yat-sen
"Become a Visual Novel writer they said, it will be fun" (little did they know they were right)

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Menu buttons have individual styles

#2 Post by Per K Grok »

abysswatcher wrote: Tue Jun 30, 2020 9:47 pm I was wondering for the choice many how can I make a button different? For example, if one of the choices was a "judgement" stat dice roll (to unlock a possible path) how would I be able to change the colour or button background by defining it as a special button?
You could try this

Code: Select all

menu:
        "This is a question"
        "This is an answer":
            jump start
        "This is an other answer":
            jump start
        "{color=#F00}This is an answer of a different color{/color}":
            jump start

abysswatcher
Regular
Posts: 42
Joined: Sun Apr 12, 2020 11:50 pm
Projects: To-Live:The Struggle
Organization: Youyu de Shijie(憂鬱的世界)
Github: LuYifeng112
itch: https://luyifeng.itc
Location: New Zealand
Contact:

Re: Menu buttons have individual styles

#3 Post by abysswatcher »

Per K Grok wrote: Wed Jul 01, 2020 9:30 am You could try this

Code: Select all

menu:
        "This is a question"
        "This is an answer":
            jump start
        "This is an other answer":
            jump start
        "{color=#F00}This is an answer of a different color{/color}":
            jump start
That's a good idea! Thanks for this :)
The goal of the revolution is to achieve the people's rights, but during the course of the revolution, we must stress military power - and the two are mutually contradictory.
-Sun Yat-sen
"Become a Visual Novel writer they said, it will be fun" (little did they know they were right)

rames44
Veteran
Posts: 233
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: Menu buttons have individual styles

#4 Post by rames44 »

It’s also possible to include arguments to menu items.

https://www.renpy.org/doc/html/menus.ht ... -arguments

https://www.renpy.org/doc/html/screen_s ... tml#choice

In theory, you could modify the choice screen so that it looked for an argument and changed the style of the individual choice accordingly.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Jackkel Dragon