Coding Blues 2

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
Alex~kun
Newbie
Posts: 10
Joined: Fri Aug 07, 2009 2:11 am
Completed: N/A
Projects: Tatari
Contact:

Coding Blues 2

#1 Post by Alex~kun » Tue Jan 10, 2012 7:28 pm

Just some quick questions;

1) How do you move a choice menu.

For example, if I wanted to move something like this;

Code: Select all

menu:
Choice 1
"Words"
Choice 2
Words"
To, say, the left hand side, how would I do it, just for one or two menus?

Second, how would I crop an image to fit the screen, or certain space?

Thanks in advance.

User avatar
DragoonHP
Miko-Class Veteran
Posts: 758
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: Coding Blues 2

#2 Post by DragoonHP » Tue Jan 10, 2012 8:14 pm

1) I dont understand what you mean...

2) http://www.renpy.org/wiki/renpy/doc/ref ... ns/im.Crop

User avatar
redeyesblackpanda
Eileen-Class Veteran
Posts: 1006
Joined: Thu Dec 22, 2011 4:26 am
Projects: Eternal Memories, plot bunnies that won't die.
Organization: HellPanda Studios
Location: United States
Contact:

Re: Coding Blues 2

#3 Post by redeyesblackpanda » Tue Jan 10, 2012 8:27 pm

Alex~kun wrote:Just some quick questions;

1) How do you move a choice menu.

For example, if I wanted to move something like this;

Code: Select all

menu:
Choice 1
"Words"
Choice 2
Words"
To, say, the left hand side, how would I do it, just for one or two menus?
Like DragoonHP, I don't really know what you're talking about. I did notice your menu code though. Pretty sure it should have colons and quotations, as in:

Code: Select all

menu:
    "Choice 1":
       "Words"
    "Choice 2":
       "Words"
Edit: I see. Sorry, I can't help you with that. I'm not too good :lol:
I'm editing this instead of posting, because this comment isn't really worth a post. Good luck in getting an answer!
Last edited by redeyesblackpanda on Tue Jan 10, 2012 8:50 pm, edited 1 time in total.
(All projects currently on a hiatus of sorts. I blame life.)
Tsundere VN
Not really checking the forums any more due to time constraints, so if you want to contact me, PM. I'll get a notification and log in. :mrgreen:
Also, I've been hit and run posting, which means I don't see many replies. If you want to respond to something I've said, also feel free to PM me.

NOTE: if you've got questions about vnovel or things like that, it's Leon that you should be contacting. Leon's been pretty much handling everything, but due to various reasons, I've had to withdraw entirely.

Alex~kun
Newbie
Posts: 10
Joined: Fri Aug 07, 2009 2:11 am
Completed: N/A
Projects: Tatari
Contact:

Re: Coding Blues 2

#4 Post by Alex~kun » Tue Jan 10, 2012 8:37 pm

Sorry, I was in a bit of a rush when I wrote it, so let me explain (hopefully) a little better.

When using this code as you described;

Code: Select all

menu:
    "Choice 1":
       "Words"
    "Choice 2":
       "Words"
Those choices will usually appear in the middle of the screen. My question is, how do I make it, so instead of appearing in the middle of the screen, it'll appear on the left side of the screen. I only need to do it for one or two different situations.

As for my second questions, thank you for that.

User avatar
DragoonHP
Miko-Class Veteran
Posts: 758
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: Coding Blues 2

#5 Post by DragoonHP » Tue Jan 10, 2012 8:49 pm

You will have to customise choice screen (found in screens.rpy)

But I don't think it is possible to do that just for a few choices... but I might be wrong...

User avatar
MoPark
Regular
Posts: 98
Joined: Sat Dec 31, 2011 7:05 pm
Projects: Kangaroo, Terminal Love
Location: DC
Contact:

Re: Coding Blues 2

#6 Post by MoPark » Tue Jan 10, 2012 8:54 pm

DragoonHP wrote:You will have to customise choice screen (found in screens.rpy)

But I don't think it is possible to do that just for a few choices... but I might be wrong...
I think it's possible to, instead of customizing that screen, create a very similar, but different type of screen, and call that one when you want the menu to the left, is it not?

Alex~kun
Newbie
Posts: 10
Joined: Fri Aug 07, 2009 2:11 am
Completed: N/A
Projects: Tatari
Contact:

Re: Coding Blues 2

#7 Post by Alex~kun » Tue Jan 10, 2012 9:03 pm

MoPark wrote:
DragoonHP wrote:You will have to customise choice screen (found in screens.rpy)

But I don't think it is possible to do that just for a few choices... but I might be wrong...
I think it's possible to, instead of customizing that screen, create a very similar, but different type of screen, and call that one when you want the menu to the left, is it not?
So... basically, it'll probably work if I copy/paste the original choice menu code, rename it, and re-align it to how I want it, then use that for any choices I want in that way?

User avatar
MoPark
Regular
Posts: 98
Joined: Sat Dec 31, 2011 7:05 pm
Projects: Kangaroo, Terminal Love
Location: DC
Contact:

Re: Coding Blues 2

#8 Post by MoPark » Tue Jan 10, 2012 9:07 pm

I haven't done this before myself, but the idea seems sound enough, seeing as how you want two menus. There likely is a better method, but that was my first thought.

Alex~kun
Newbie
Posts: 10
Joined: Fri Aug 07, 2009 2:11 am
Completed: N/A
Projects: Tatari
Contact:

Re: Coding Blues 2

#9 Post by Alex~kun » Tue Jan 10, 2012 9:11 pm

MoPark wrote:I haven't done this before myself, but the idea seems sound enough, seeing as how you want two menus. There likely is a better method, but that was my first thought.
I'll test it when I get the chance, and let you know. If not, maybe someone else has an idea.

Alex~kun
Newbie
Posts: 10
Joined: Fri Aug 07, 2009 2:11 am
Completed: N/A
Projects: Tatari
Contact:

Re: Coding Blues 2

#10 Post by Alex~kun » Wed Jan 11, 2012 12:16 am

So, I got it to work, kinda. The menu does move to the left side, but it overrides the original choice command. So, basically, I can't make it one or the other at any time, it's either completely left, or middle.

Code: Select all

screen choice: <- This is where it should be originally

    window: 
        style "menu_window"        
        xalign 0.5
        yalign 0.5
        
        vbox:
            style "menu"
            spacing 2
            
            for caption, action, chosen in items:
                
                if action:  
                    
                    button:
                        action action
                        style "menu_choice_button"                        

                        text caption style "menu_choice"
                    
                else:
                    text caption style "menu_caption"

init -2 python:
    config.narrator_menu = True
    
    style.menu_window.set_parent(style.default)
    style.menu_choice.set_parent(style.button_text)
    style.menu_choice.clear()
    style.menu_choice_button.set_parent(style.button)
    style.menu_choice_button.xminimum = int(config.screen_width * 0.75)
    style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)


screen choice2: <- This is the new menu, placed to the left. 

    window: 
        style "menu_window"        
        xalign 0.0
        yalign 0.0
        
        vbox:
            style "menu"
            spacing 2
            
            for caption, action, chosen in items:
                
                if action:  
                    
                    button:
                        action action
                        style "menu_choice_button"                        

                        text caption style "menu_choice"
                    
                else:
                    text caption style "menu_caption"

init -2 python:
    config.narrator_menu = True
    
    style.menu_window.set_parent(style.default)
    style.menu_choice.set_parent(style.button_text)
    style.menu_choice.clear()
    style.menu_choice_button.set_parent(style.button)
    style.menu_choice_button.xminimum = int(config.screen_width * 0.75)
    style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)


Choice2 was originally choice, but then it'd just override the first choice coding. So I renamed it choice2, but I'm not quite sure how to change it so I can use it.

User avatar
Mickychi
Veteran
Posts: 296
Joined: Sun Jun 26, 2011 3:01 am
Projects: Current: Prologue: Caged Bird
Contact:

Re: Coding Blues 2

#11 Post by Mickychi » Wed Jan 11, 2012 5:04 am

I'm not quite sure what you have done but maybe copy the original menu script bit for choices and copy it, rename it (example: Menu2) and what you would need to rename and just change where it shows. I'm not sure if this would work but you could try.
Check out my WIP Prologue: Caged Bird!
Image

User avatar
DragoonHP
Miko-Class Veteran
Posts: 758
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: Coding Blues 2

#12 Post by DragoonHP » Wed Jan 11, 2012 8:02 am

MoPark wrote:
DragoonHP wrote:You will have to customise choice screen (found in screens.rpy)

But I don't think it is possible to do that just for a few choices... but I might be wrong...
I think it's possible to, instead of customizing that screen, create a very similar, but different type of screen, and call that one when you want the menu to the left, is it not?
It isn't... there can be only one behaviour for menu...

@Alex~kun: You can fake a menu screen by using ui.textbuttons (or simple textbutton in screens) if you want to have it for one or two menus...
Or you can also use Style Preferences to update the menu position at run-time (not quite sure if it is possible...)

Post Reply

Who is online

Users browsing this forum: Bing [Bot]