Page 1 of 1

Bug With Button? And Transition Animation ? [SOLVED]

Posted: Wed Jun 15, 2016 1:32 pm
by pratomoastan
Umm Why,
When I Click This Button Something Went Wrong With The Button Animation.
This also happend to my home screen but with diffrent button layout instead use

Code: Select all

has vbox
i use

Code: Select all

has hbox

Code: Select all

screen othperfs():
    tag menu
    # The background of the game menu.
    window:
        style "gm_root"

    # The various buttons.
    frame:
        style_group "gm_nav"
        xalign .98
        yalign .98
        
        has vbox 
        
        #textbutton _("Preferences") action ShowMenu("preferences")
        #textbutton _("Save Game") action ShowMenu("save")
        #textbutton _("Load Game") action ShowMenu("load")
        textbutton ("Music Room") action ShowMenu("music_room")
        textbutton _("Credits") action ShowMenu("credits")
        textbutton _("Help") action Help()
        
        spacing 0
        null height 20
        
        textbutton _("Back") action ShowMenu ("preferences") 

Also At The Music Room I Also Have A Problem -.- There 1 Button That I Cant Click :

The Code Is :

Code: Select all

init python:

    mr2 = MusicRoom(fadeout=1.0)

    mr2.add("music/floatingcity.ogg", always_unlocked=True)
    mr2.add("music/great.ogg")
    mr2.add("music/cots.ogg")

screen music_room2:

    tag menu

    window:
        background "images/system/mroom.png"

    frame:
        style_group "gm_nav"
        xalign .98
        yalign .98
        
        has vbox

        textbutton "Floating City" action mr2.Play("music/floatingcity.ogg")
        textbutton "Great" action mr2.Play("music/great.ogg")
        textbutton "Curse" action mr2.Play("music/cots.ogg")

        null height 20

        textbutton "Next" action mr2.Next()
        textbutton "Previous" action mr2.Previous()

        null height 20

        textbutton _("Back") action ShowMenu ("music_room")

    on "replace" action mr2.Play()

    on "replaced" action Play("music", "music/mnutheme.ogg")

Also in the credits screen i want to play a diffrent music automatically, and when user click back the main menu music re played .
i try the method that used in music room but it wont work ><.

Im just a beginner at renpy so i dont know much to do ><.
i try to read the documentation but it doesnt help me ><.


And wich one is better to be used in the back button

Code: Select all

textbutton _("Back") action Hide("xxxxxx")
or

Code: Select all

textbutton _("Back") action ShowMenu ("xxxxxxxx")

Re: Bug With Button? And Transition Animation ?

Posted: Sat Jun 18, 2016 8:06 am
by pratomoastan
Hello ? Any Help ?

Re: Bug With Button? And Transition Animation ?

Posted: Sat Jun 18, 2016 12:53 pm
by Alex
Mmm, it's hard to tell what's wrong with the button 'cause gif animation is too fast.
And there is no "has hbox" in the code you've posted, so it's unclear what's the problem with it...

In music room the button will be unlocked (clickable) only when player heared the track associated with this button in one of his playthroughs. So try to play your game untill you'll hear the "cots.ogg" tune, then go to music room - the button should be clickable.

As for issue with music in credits screen - you need to show the code for this screen as well as the main menu screen.

What action you should use for the "Back" button depends on how you show your screens - in the code you've posted buttons showing screens using "ShowMenu" action (and I suppose all the screens have "tag menu", so they just replace eachother). In this case use "ShowMenu ("preferences")" action for the "Back" button.

Re: Bug With Button? And Transition Animation ?

Posted: Mon Jun 20, 2016 2:11 am
by pratomoastan

Code: Select all

screen main_menu():

    # This ensures that any other menu screen is replaced.
    tag menu

    # The background of the main menu.
    window:
        style "mm_root"

    # The main menu buttons.
    frame:
        style_group "mm"
        xalign .98
        yalign .98

        has hbox

        textbutton _("Start Game") action Start()
        textbutton _("Load Game") action ShowMenu("load")
        textbutton _("Preferences") action ShowMenu("preferences")
        textbutton _("Quit") action Quit(confirm=False)

init -2:

    # Make all the main menu buttons be the same size.
    style mm_button:
        size_group "mm"
Thats the code from my main menu screen


anyways i make the gif into a video

[youtube]https://www.youtube.com/embed/F74pAZuptas[/youtube]

Re: Bug With Button? And Transition Animation ?

Posted: Mon Jun 20, 2016 3:30 am
by pratomoastan
should i do this :

Code: Select all

mr.add("music/blueska.ogg", always_unlocked=True)
 mr.add("music/brighteningway.ogg", always_unlocked=True)
 mr.add("music/duck.ogg", always_unlocked=True)
Or just add the always_unlocked=True to just one music only ?

Code: Select all

 mr.add("music/blueska.ogg", always_unlocked=True)
 mr.add("music/brighteningway.ogg")
 mr.add("music/duck.ogg")
I Want all of the music in not unlocked so the user can play it whenever they want

Re: Bug With Button? And Transition Animation ?

Posted: Mon Jun 20, 2016 2:28 pm
by Alex
I think the problem is that you've used navigation buttons of different sizes in different screens, but set the same style_group for the frames that contain them, so Ren'Py is trying to show them all the same size.
Try to set different style_group parameters in your screens.

If you want to make all the tracks in music room unlocked for player you need to set the always_unlocked parameter for each track.

Re: Bug With Button? And Transition Animation ?

Posted: Sat Jun 25, 2016 1:01 pm
by pratomoastan
Okay thanks i will try it ><