Animations repeating on imagebutton press

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
Ultra_HR
Regular
Posts: 39
Joined: Tue Dec 02, 2014 4:50 pm
Completed: Surkea, Arcadia, Cerulean
Projects: Missing Stars
Organization: Somnova Studios
IRC Nick: Ultra_HR
Contact:

Animations repeating on imagebutton press

#1 Post by Ultra_HR » Thu Aug 13, 2015 3:49 pm

Hi,

Got a bit of a strange bug. Imagebutton transforms repeat if a button is pressed twice or more. Basically, it looks like this:
http://awvo.uk/share/2015-08-13_20-39-56.mp4

And here's the code for all of that screen and the transforms:

Code: Select all

##############################################################################
# Preferences
#
# Screen that allows the user to change the preferences.
# http://www.renpy.org/doc/html/screen_special.html#prefereces

screen preferences():

    tag menu
    add "ui/settingsbase.png" at settingsbase
    add "ui/settingslabels.png" at settingslabels
    add "ui/settingstitle.png" at saveloadtitle
    use navigation
    # Window/fullscreen
    imagebutton auto "ui/window_%s.png" xpos 78 ypos 133 focus_mask None action Preference("display", "window") at wintran
    imagebutton auto "ui/fullscreen_%s.png" xpos 188 ypos 133 focus_mask None action Preference("display", "fullscreen") at wintran
    # Font style and anti-alias toggle
    imagebutton auto "ui/abeezee_%s.png" xpos 320 ypos 135 focus_mask None action [StylePreference("font", "abeezee"), StylePreference("labeltextpos", "abeezee"), StylePreference("labelpos", "abeezee")] at font
    imagebutton auto "ui/other_%s.png" xpos 392 ypos 135 focus_mask None action [StylePreference("font", "opendyslexia"), StylePreference("labeltextpos", "opendyslexia"), StylePreference("labelpos", "opendyslexia")] at font
    imagebutton auto "ui/on_%s.png" xpos 406 ypos 161 focus_mask None action StylePreference("antialiasing", "on") at antialiason
    imagebutton auto "ui/off_%s.png" xpos 425 ypos 160 focus_mask None action StylePreference("antialiasing", "off") at antialiasoff
    # Transitions on/off
    imagebutton auto "ui/showall_%s.png" xpos 521 ypos 133 focus_mask None action Preference("transitions", "all") at wintran
    imagebutton auto "ui/shownone_%s.png" xpos 631 ypos 133 focus_mask None action Preference("transitions", "none") at wintran

    # Skip all/seen
    imagebutton auto "ui/allmessages_%s.png" xpos 52 ypos 221 focus_mask None action Preference("skip", "all") at skipsizechoices
    imagebutton auto "ui/seenmessages_%s.png" xpos 188 ypos 221 focus_mask None action Preference("skip", "seen") at skipsizechoices

    # Font size
    imagebutton auto "ui/14_%s.png" xpos 344 ypos 221 focus_mask None action StylePreference ("size", "14") at skipsizechoices
    imagebutton auto "ui/18_%s.png" xpos 380 ypos 221 focus_mask None action StylePreference ("size", "18") at skipsizechoices
    imagebutton auto "ui/22_%s.png" xpos 416 ypos 221 focus_mask None action StylePreference ("size", "22") at skipsizechoices

    # After choices
    imagebutton auto "ui/stopskipping_%s.png" xpos 500 ypos 221 focus_mask None action Preference("after choices", "stop") at skipsizechoices
    imagebutton auto "ui/keepskipping_%s.png" xpos 643 ypos 221 focus_mask None action Preference("after choices", "skip") at skipsizechoices

    # Sliders
    frame xpos 96 ypos 298:
        style_group "pref"
        has vbox
        bar value Preference("auto-forward time") at automusic

    frame xpos 456 ypos 298:
        style_group "pref"
        has vbox
        bar value Preference("music volume") at automusic

    frame xpos 96 ypos 355:
        style_group "pref"
        has vbox
        bar value Preference("text speed") at textsound

    frame xpos 456 ypos 355:
        style_group "pref"
        has vbox
        bar value Preference("sound volume") at textsound

# Animations for preferences.
init -2:
    transform settingsbase:
        on show:
            ypos 450
            easein 0.5 ypos 0
    transform settingslabels:
        ypos 20 alpha 0.0
        easein 0.5 ypos 0 alpha 1.0
        on show:
            ypos 20 alpha 0.0
            pause 0.5
            easein 0.5 ypos 0 alpha 1.0
    transform wintran:
        ypos 153 alpha 0.0
        pause 0.2
        easein 0.5 ypos 133 alpha 1.0
    transform font:
        ypos 155 alpha 0.0
        pause 0.2
        easein 0.5 ypos 135 alpha 1.0
    transform antialiason:
        ypos 181 alpha 0.0
        pause 0.2
        easein 0.5 ypos 161 alpha 1.0
    transform antialiasoff:
        ypos 180 alpha 0.0
        pause 0.2
        easein 0.5 ypos 160 alpha 1.0
    transform skipsizechoices:
        ypos 241 alpha 0.0
        pause 0.4
        easein 0.5 ypos 221 alpha 1.0
    transform automusic:
        alpha 0.0 ypos 20
        pause 0.6
        easein 0.5 ypos 0 alpha 1.0
    transform textsound:
        alpha 0.0 ypos 20
        pause 0.8
        easein 0.5 ypos 0alpha 1.0
I've tried adding

Code: Select all

on show:
to all the transforms, but while that works for the base images it doesn't work for the imagebuttons which appear instantly if the screen is shown and they use

Code: Select all

on show:
. I'd love some help!

Thanks!
I'm the writing lead for Somnova Studios and the Annaliese route writer for Missing Stars. You can play Act 1 now. I also co-wrote Arcadia and did programming for Cerulean.

User avatar
chocojax
Miko-Class Veteran
Posts: 702
Joined: Sun Oct 25, 2009 11:27 am
Completed: http://art.jphi.me/projects
Projects: Umbra, Familiarity, Maleficent Justice
Organization: spaceNote
Tumblr: chocojax
Github: jenniferphi
Location: California
Contact:

Re: Animations repeating on imagebutton press

#2 Post by chocojax » Fri Aug 14, 2015 12:55 am

While I don't know how to fix it, I noticed that the problem would happen (on my end) when I had the StylePreference() buttons on screen and would click on them. Wouldn't happen if the StylePref() button wasn't clicked before clicking on other buttons, and wouldn't happen if StylePref() buttons weren't on the screen to click (of course). I'm assuming it's because it's updating the text size/font, so it needs to refresh.

User avatar
Ultra_HR
Regular
Posts: 39
Joined: Tue Dec 02, 2014 4:50 pm
Completed: Surkea, Arcadia, Cerulean
Projects: Missing Stars
Organization: Somnova Studios
IRC Nick: Ultra_HR
Contact:

Re: Animations repeating on imagebutton press

#3 Post by Ultra_HR » Fri Aug 14, 2015 6:18 am

chocojax wrote:While I don't know how to fix it, I noticed that the problem would happen (on my end) when I had the StylePreference() buttons on screen and would click on them. Wouldn't happen if the StylePref() button wasn't clicked before clicking on other buttons, and wouldn't happen if StylePref() buttons weren't on the screen to click (of course). I'm assuming it's because it's updating the text size/font, so it needs to refresh.
Huh, I hadn't noticed that until now but yeah, it's the same for me. I hope there's a way to fix it!

Thing is, the style preferences shouldn't be affecting anything on that screen. I only used stylepreferences for text, and all the elements on that screen are images.
I'm the writing lead for Somnova Studios and the Annaliese route writer for Missing Stars. You can play Act 1 now. I also co-wrote Arcadia and did programming for Cerulean.

Post Reply

Who is online

Users browsing this forum: Google [Bot]