Several questions about GUI coding

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
clua
Miko-Class Veteran
Posts: 537
Joined: Sat Dec 12, 2009 1:38 pm
Completed: Stormy Night /The Knife of the Traitor/Charlatans
Projects: The Hurtful Wall /_Salomon/Infurubia
Tumblr: notttt-che
itch: chegovia
Location: In a jar with pirañas
Contact:

Several questions about GUI coding

#1 Post by clua » Wed Jul 08, 2015 9:20 pm

I can't manage to get this right, please help!

I made an extra screen using this and this, and I got:

Code: Select all

# Extra Screen

screen extras:

    tag menu

    imagemap:   
        ground "menu/extra_idle.png"
        idle "menu/extra_idle.png"
        hover "menu/extra_hover.png"
        
        hotspot (309, 133, 109, 454) action ShowMenu("extradress") activate_sound "sfx/decide15.wav"
        hotspot (420, 133, 109, 454) action ShowMenu("extrapet") activate_sound "sfx/decide15.wav"
        hotspot (642, 133, 109, 454) action ShowMenu("extraloli") activate_sound "sfx/decide15.wav"
    imagemap:
            idle "menu/extramenu_idle.png"
            hover "menu/extramenu_hover.png"
            ground "menu/extramenu_idle.png"
            
                
            hotspot (14,610,158,77) action MainMenu()
Which worked perfectly but for some issues:

-The back button doesn't work for some reason I don't understand. It worked previously btw so I'm not sure if it's an issue of the imagemap...I'm attaching those just in case:
question1.jpg
-When jumping to each scene from the extra screen, back, save, skip buttons from the quick menu doesn't work.

Other questions about my GUI would be:

-I'm using subtitles for my cg scenes so people can see the whole thing, but since the quick menu is in the same placement of the text box, I find it difficult to find a medium point where it can work for both. Is there a way to have a quick menu placement just for the textbox and other for the subtitles?


-When my characters think something I use this format:

Code: Select all

k"{i}{color=#8b707a}...A woman?{/color}{/i}"
Is there a way to format it once so I don't have to paste this every time I need it?(Not that bothers me much to
add this, but it's bothersome when it comes to edit the color of the format for each sentence)

Thank you.
♦WIP♦
Infurubia
The hurtful wall
_Salomon

♦COMPLETE♦
+The Knife of the Traitor(Nanoreno 2012)
+Charlatans(Nanoreno 2015)

Dev tumblr
EVN Store

User avatar
kitsalai
Regular
Posts: 65
Joined: Wed Jan 08, 2014 11:05 pm
Projects: Imaginatum
Location: US
Contact:

Re: Several questions about GUI coding

#2 Post by kitsalai » Thu Jul 09, 2015 2:51 am

I've never used those tutorials but is there a reason you're using 2 imagemaps instead of one? Unless you're planning to use the same imagemap on multiple screens, I feel that having 2 of them might cause problems with possible overlap.
The back button doesn't work for some reason I don't understand
When jumping to each scene from the extra screen, back, save, skip buttons from the quick menu doesn't work.
Can you show the code where the back button is defined and where quick_menu screen is defined? As long as the back button has action Return(), it should work.
Is there a way to have a quick menu placement just for the textbox and other for the subtitles?
http://lemmasoft.renai.us/forums/viewto ... 29#p160572
Tom's way allows you to hide the quick menu by toggling the variable quick_menu. However if you want to change the placement, what you can do is cast the if statement to the xalign and yalign of the screen quick_menu.
Is there a way to format it once so I don't have to paste this every time I need it?
There is always a way to write less code =D When you define the character k, you can use
Character("Name", what_prefix="{i}{color=#8b707a}", what_suffix="{/color}{/i}")

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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: Several questions about GUI coding

#3 Post by PyTom » Thu Jul 09, 2015 9:24 am

There was a bug in imagemaps fixed last night, so if you get a chance, try the nightly and see if that fixes the problem.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot]