[SOLVED] Change main menu image when selecting different language?

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
schivafrecce
Regular
Posts: 39
Joined: Tue Apr 04, 2017 3:06 pm
Completed: BLACK
Projects: /!\Work in progress/!\
itch: schivafrecce
Location: Saturn's 6th Moon
Contact:

[SOLVED] Change main menu image when selecting different language?

#1 Post by schivafrecce »

Hi guys, I'm once again in need of assistance :? I was trying to add a russian translation to my game, and so far everything went smoothly except for this:
This is the code of my main menu: it's a live composite, and one of the layers is an image called "scritta" which is the title of the game, in English.
I wanted to change said image with another one with the title in Russian when the player selects the language, and I tried writing this code:

Code: Select all

define gui.main_menu_background = ConditionSwitch(
    "persistent.ending == 'True Ending' ",
    LiveComposite(
        (1920, 1080),
        (0, 0), "white.png",   
        (-300, -300), "lighto",
        (0, 0), "blossoms2",
        (0, 0), "black main3.png",
        (0, 0), "scritta"
        ),
    'not persistent.ending',
    LiveComposite(
        (1920, 1080),
        (0, 0), "white.png",     
        (-300, -300), "lighto",
        (-800, 0), "blossoms",
        (0, 0), "blossoms2",
        (0, 0), "1.png",
        (0, 0), "scritta"
        )
    )

image scritta = ConditionSwitch(
    "lang == 'English'", "gui/scritta.png",
    "lang == 'Russian'", "gui/scritta_ru.png",
    )
But it doesn't work...what can I do? Thanks :oops:

(I also tried the code below from the cookbook https://www.renpy.org/wiki/renpy/doc/co ... ialization, but...nothing)

Code: Select all

init:
    if lang == "english":
        image bg city = "city_en.jpg"
    elif lang == "japanese":
        image bg city = "city_jp.jpg"
Last edited by schivafrecce on Sun Sep 10, 2017 3:30 am, edited 1 time in total.
Image

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Change main menu image when selecting different language?

#2 Post by Donmai »

Avoid using pre historic code from the wiki, that red alert in the page header really means something. :)
See the documentation here: https://www.renpy.org/doc/html/translat ... anslations
You only need to put the translated image file in the corresponding language folder.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
schivafrecce
Regular
Posts: 39
Joined: Tue Apr 04, 2017 3:06 pm
Completed: BLACK
Projects: /!\Work in progress/!\
itch: schivafrecce
Location: Saturn's 6th Moon
Contact:

Re: [SOLVED] Change main menu image when selecting different language?

#3 Post by schivafrecce »

Avoid using pre historic code from the wiki, that red alert in the page header really means something. :)
I was desperate XD thank you so much for your help! :)
Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], mold.FF