How to: Multiple Novel Mode Windows and Gradient Text?

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
famakki1
Regular
Posts: 55
Joined: Wed Oct 12, 2016 7:40 am
Contact:

How to: Multiple Novel Mode Windows and Gradient Text?

#1 Post by famakki1 » Wed Oct 12, 2016 7:54 am

Hi all,

I am currently working on going through the basics of using renpy to make vn's. There are a couple of things I wish to get done but have no idea how to do so. I have searched a lot in google and the forums but haven't found what I am looking for.

Firstly, in novel mode, I understand you can define an image for the novel window, however I wish to know how to define different images for different novel mode scenes.

Secondly, I can choose my text color, however I am wondering if it is possible to chose a gradient as a color (e.g. red to white from bottom to top).

Finally, I wish to know if it is possible to force transitions to keep playing despite the player clicking continuously (e.g. show image with Dissolve(10.0) > keeps running despite clicking through the script)

Thanks a lot in advance.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1919
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: How to: Multiple Novel Mode Windows and Gradient Text?

#2 Post by Donmai » Wed Oct 12, 2016 9:55 am

1- You can assign a different dialogue window background to each character of the game, if you want. for example:

Code: Select all

define e = Character("Eileen", window_background="any_image_you_prefer_for_her.png")
2- No way. But, if you want a colorful game, you can also give a different dialogue color to each character of the game, using what_color:

Code: Select all

define e = Character("Eileen", who_color="#ffc8c8", what_color="#c8ffc8")

3- You can use ATL transforms instead of transitions. Transitions interrupt game flow while they are running, but ATL transforms don't.
https://www.renpy.org/doc/html/atl.html ... n-language
viewtopic.php?f=51&t=16604
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

famakki1
Regular
Posts: 55
Joined: Wed Oct 12, 2016 7:40 am
Contact:

Re: How to: Multiple Novel Mode Windows and Gradient Text?

#3 Post by famakki1 » Wed Oct 12, 2016 10:15 am

Hi Donmai,

Thanks for your input. However, if I use the code for assigning window background to any character, it forces it to go out of Novel mode into adventure mode. I would like to know if it is possible to freely change the novel window background.

The problem seems to be that the novel background is tied to the command style.nvl_window.background

Code: Select all

define novel_window = "novel_window.png"
style.nvl_window.background = novel_window
I want to know if I can change the image defining freely in different points of the script.

Thanks

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: How to: Multiple Novel Mode Windows and Gradient Text?

#4 Post by Ocelot » Wed Oct 12, 2016 10:55 am

You can try to make novel_window something else. Like ConditionSwitch: image which can change depending on conditions.
https://www.renpy.org/doc/html/displaya ... tionSwitch
viewtopic.php?f=51&t=19063

Aso you can try image-based fonts for your text problem. IIRC black is mapped to transparent, white is changed to whichever color your text is and other colors are not changed. https://www.renpy.org/doc/html/text.htm ... ased-fonts
< < insert Rick Cook quote here > >

famakki1
Regular
Posts: 55
Joined: Wed Oct 12, 2016 7:40 am
Contact:

Re: How to: Multiple Novel Mode Windows and Gradient Text?

#5 Post by famakki1 » Wed Oct 12, 2016 12:14 pm

Hi Ocelot,

Thanks a lot for your feedback. Condition Switch seems to have done the trick. The code is below for anyone else to use if they want different backgrounds in novel mode for difference scenes:

Code: Select all


init:

        image nvlwin = im.Alpha("nvl_window.bmp", 0.7)   #to make background transparent
        image nvlwin_2 = im.Alpha("nvl_window_2.bmp", 0.7)
    
        image windowtrigger = ConditionSwitch (
                "nvlwindow == 1","nvlwin",
                "nvlwindow == 2","nvlwin_2",
                
                )
        
        $ nvlwindow = 1
        
                    
        # Declare characters used by this game.
        $ n = Character(None, window_left_margin = 20, kind=nvl,)
        

init python:
        menu = nvl_menu
        config.empty_window = nvl_show_core
        config.window_hide_transition = dissolve
        config.window_show_transition = dissolve
    
        # Set the background of the NVL window; this image should be the
        # same size as the screen.
        style.nvl_window.background = "windowtrigger" 
        
        # Add some additional padding around the contents of the NVL window.
        # This keeps the text inside the borders of our image.
        style.nvl_window.xpadding = 55
        style.nvl_window.ypadding = 55
        
        style.nvl_window.top_margin = 30
        style.nvl_window.bottom_margin = 0
        style.nvl_window.left_margin = 0
        style.nvl_window.right_margin = 0
        
        # Set the spacing between each block of text on the page.
        # The default is 10 pixels.
        style.nvl_vbox.box_spacing = 20
        
        style.nvl_menu_choice.xalign = 0.45 
        style.nvl_menu_choice.ypos = 250 
        

# The game starts here.
label start:      

        $ nvlwindow = 1    
    
        show window
        
        n "Novel window test."
            
        n "Novel window is working right now"
            
        n "This is the first novel window."
            
        nvl clear
            
        n " ..."
            
        window hide
        
        $ nvlwindow = 2
        
        window show
        
        n "This is the second window."
        
        n "..."
        
        nvl clear
        window hide
        
        "ADV mode enabled"
         
    
        return


Post Reply

Who is online

Users browsing this forum: No registered users