Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Thu May 23, 2013 12:26 am

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Jul 19, 2011 7:38 am 
Regular
User avatar

Joined: Thu Jul 07, 2011 5:13 am
Posts: 143
Projects: Water's Edge
Organization: Etoranze
I know this is a really small thing, but I added a menu button (an imagebutton) that remains on screen during the game that toggles skip, and I'm wondering if it's possible to keep it "greyed out" (a.k.a. show the hover image) when skip is occurring after clicking the button and vice versa. Just an aesthetic thing. :'D

_________________
Image
Image (devblog) || tumblr


Top
 Profile Send private message  
 
PostPosted: Tue Jul 19, 2011 7:46 am 
Lemma-Class Veteran
User avatar

Joined: Fri May 23, 2008 2:11 pm
Posts: 2545
Location: USA
Projects: RockRobin
Code:
if config.skipping:
    #what you want your button to look like while skipping
else:
    #what you want your button to look like while not skipping

Put that where your imagebutton is now and make 2 versions of the same button (one where the hover graphic is the idle graphic).

_________________
I apologize in advance for being extremely opinionated.
[Tutorial] How to Customize the Textbox
[Tutorial] How to Customize Game Menus
Icon art by Mocha07734


Top
 Profile Send private message  
 
PostPosted: Tue Jul 19, 2011 8:20 am 
Regular
User avatar

Joined: Thu Jul 07, 2011 5:13 am
Posts: 143
Projects: Water's Edge
Organization: Etoranze
Thanks, it works! \o/

_________________
Image
Image (devblog) || tumblr


Top
 Profile Send private message  
 
PostPosted: Tue Jul 19, 2011 5:31 pm 
Regular
User avatar

Joined: Wed Aug 11, 2010 8:49 pm
Posts: 160
Projects: What Do You See?
Aleema wrote:
Code:
if config.skipping:
    #what you want your button to look like while skipping
else:
    #what you want your button to look like while not skipping

Put that where your imagebutton is now and make 2 versions of the same button (one where the hover graphic is the idle graphic).


I don't get it very well. What exactly is placed between the if config.skipping and else: ? Sorry if it annoys the one who asked it the first time, but I really would like to know.

_________________
Dev Blog
What Do You See? [NaNo13]


Top
 Profile Send private message  
 
PostPosted: Wed Jul 20, 2011 1:41 am 
Lemma-Class Veteran
User avatar

Joined: Fri May 23, 2008 2:11 pm
Posts: 2545
Location: USA
Projects: RockRobin
lol ... I was happy when Niki understood and I didn't have to explain!!

Look at this cookbook code. As Niki said, she was using an imagebutton. I didn't put anything in the code because what button you use will so radically differ from each game. It may even be a textbutton, not an imagebutton.

_________________
I apologize in advance for being extremely opinionated.
[Tutorial] How to Customize the Textbox
[Tutorial] How to Customize Game Menus
Icon art by Mocha07734


Top
 Profile Send private message  
 
PostPosted: Wed Jul 20, 2011 2:10 am 
Regular
User avatar

Joined: Wed Aug 11, 2010 8:49 pm
Posts: 160
Projects: What Do You See?
Could you show me an example if i were using image buttons? and where to place them in the code? Sorry for troubling you. ^^,
And thanks.

_________________
Dev Blog
What Do You See? [NaNo13]


Top
 Profile Send private message  
 
PostPosted: Wed Jul 20, 2011 3:44 am 
Lemma-Class Veteran
User avatar

Joined: Fri May 23, 2008 2:11 pm
Posts: 2545
Location: USA
Projects: RockRobin
Code:
init python:

    # Give us some space on the right side of the screen.
    style.window.right_padding = 100

    def toggle_skipping():
        config.skipping = not config.skipping

    show_button_game_menu = True

    def button_game_menu():
       
        if show_button_game_menu:

            # to save typing
            ccinc = renpy.curried_call_in_new_context

            ui.vbox(xpos=0.99, ypos=0.98, xanchor='right', yanchor='bottom')
           
            if config.skipping:
                ui.imagebutton("skip_hover.png","skip_hover.png", clicked=toggle_skipping)
            else:
                ui.imagebutton("skip_idle.png","skip_hover.png", clicked=toggle_skipping)
               
            ui.imagebutton("save_idle.png","save_hover.png", clicked=ccinc("_game_menu_save"))
            ui.imagebutton("load_idle.png","load_hover.png", clicked=ccinc("_game_menu_load"))
            ui.imagebutton("prefs_idle.png","prefs_hover.png", clicked=ccinc("_game_menu_preferences"))
            ui.close()


    config.window_overlay_functions.append(button_game_menu)

Put it anywhere you want.

_________________
I apologize in advance for being extremely opinionated.
[Tutorial] How to Customize the Textbox
[Tutorial] How to Customize Game Menus
Icon art by Mocha07734


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group