Imagebutton ATL Not Working With Screen Action

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
The_Sauce
Newbie
Posts: 6
Joined: Mon Dec 14, 2020 7:29 pm
Projects: Normalcy
Organization: The Sauce
itch: the-real-sauce
Discord: The_Sauce#1952
Contact:

Imagebutton ATL Not Working With Screen Action

#1 Post by The_Sauce »

Just asking a question into the void to see if its a glitch, my lack of advanced programming skill, or if I'm going crazy.

I have a transform setup to make the button expand when hovered and shrinks when idle:

EXAMPLE:

Code: Select all

transform expand:
    on hover:
        linear 0.12 zoom 2.0
    on idle:
        linear 0.05 zoom 1.0

screen button_1a:
 
    imagebutton at expand:
        idle "imageA"
        hover "imageB"
        xalign 0.5
        yalign 0.5
        action action [ SetVariable("variable", n) ]
But if it has a SetVariable action it doesn't do the transform, I've tested with Jump, Call, Show actions and works as intended, just the SetVariable action specifically.

I'm just wondering if I'm missing something or, if I can't do that specifically, just a thought though, if not I'll just work around it.

Thank You,
The Sauce

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Imagebutton ATL Not Working With Screen Action

#2 Post by _ticlock_ »

Hi, The_Sauce,

The transform should work with SetVariable. The transform should not work if you have action None. Also, if the variable is already equals n it can be considered insensitive and transform won't work.

Hope, it answers your question.

User avatar
The_Sauce
Newbie
Posts: 6
Joined: Mon Dec 14, 2020 7:29 pm
Projects: Normalcy
Organization: The Sauce
itch: the-real-sauce
Discord: The_Sauce#1952
Contact:

Re: Imagebutton ATL Not Working With Screen Action

#3 Post by The_Sauce »

Hey _ticlock_ and Thank you for the response, you are a big help,

I tested it and yes you are right about it being insensitive because the variable is the same as the action to change it.
If I may ask, how do you make a button sensitive (sorry I don't know the correct terminology) so it does the transform animation
when it is the same as the variable it is changing. If I'm able to, if not, you've helped me enough with your response and you are a life saver.

Thank You and Happy New Year,
The Sauce

░░░░░▓███▓
░░░░▓█████▓
░░░░▓█████▓
░░░░░▓███▓
░░░░ *;;;;;;;;;*
░░░░* ;;;;;;;;;*
░░░ * ;;;;;;;;;;;*
░░░* ;;;;;;;;;;;;*
░░░░▓█████▓
░░░░▓█████▓
░░░░▓█████▓
░░░▓███████▓
░░▓█████████▓
░▓███████████▓
▓█████████████▓
▓███░░░░░░░▀▀▀▓
▓███░░░░████████████
▓███░░░░█▒▒▒▒▒▒▒▒▒▒█
▓███░░░░░█▒▒▒▒▒▒▒▒█
▓███░░░░░░█▒▒▒▒▒▒█
▓███░░░░░░░█▒▒▒▒█
▓███░░░░░░░░████
▓███░░░░░░░░▌██▌
▓███░░░░░░░░▌██▌
▓███░░░░░░░░▌██▌
▓███░░░░░░░░▌██▌
░▓██░░░░░░░▓████▓
░▓████▓▓█████████▓

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Imagebutton ATL Not Working With Screen Action

#4 Post by _ticlock_ »

The_Sauce,
EDIT:
Check philat answer why transform didn't work and how to fix it.

For example, change transform:

Code: Select all

transform expand:
    on hover:
        linear 0.12 zoom 2.0
    on selected_hover:
        linear 0.12 zoom 2.0
    on idle:
        linear 0.05 zoom 1.0
    on selected_idle:
        linear 0.05 zoom 1.0
Or if it doesn't conflict with your plan, you can make it unselected:

Code: Select all

screen button_1a:
 
    imagebutton at expand:
        idle "imageA"
        hover "imageB"
        selected False
        xalign 0.5
        yalign 0.5
        action[ SetVariable("variable", n) ]
PS: Happy New Year!!!

User avatar
The_Sauce
Newbie
Posts: 6
Joined: Mon Dec 14, 2020 7:29 pm
Projects: Normalcy
Organization: The Sauce
itch: the-real-sauce
Discord: The_Sauce#1952
Contact:

Re: Imagebutton ATL Not Working With Screen Action

#5 Post by The_Sauce »

Hey _ticlock_ Thank you,

I followed the link but forgot to reply and yeah this has given me more options that I thought were possible,
fixed everything right up, thanks again for the help :D

════════════════════════════════════════
══════════════════░░░═══════════════════
══════════════░▓▓███████▓▒░═══▒██░══════
═══════════▒██▓▒▒▒▒▒▒▒▒▒▓▓█▒▒██████═════
═════════███████═══░░░░░░░░▓███░═███════
════════▒████████▓══░░░░░░═███▒▒══███═══
══════░██▒═════████══░░░░░░██══▒▓░═█░═══
═════░█▓░░░░░░══░███══░░░░░═══▒██▓▒═════
════░█▓░░░░░░░░░══███═░░░░░══██████▒════
════█▓░═░░░░░░░░░══███═░░░░═███═▒███▒═══
═══▓▓░░░░░░░░░░░░░══██═░░░═▒██════██▓▒══
══▒█▒░░░░░░░░░░░░░░═══░░░░═██═════███▓══
══█▓═░░░░░░░░░░░░░░░░░░░░░═██═════░██▓▓═
═▒█░░░░░░░══════░░░░░░░░░═░█▓═════░██░█═
═█▓░░░░░░═█████▒══░░░░░░░░▒█░═███═░██░█═
░█▒░░░░░░═███████▓══░░░░░═▒█▓█████═██░▓█
▒▓░░░░░░░░═══░▓████══░░░░░░███████░██░▒█
▓▒░░░░░░░░░═░═══░███▒═░░░══███████▓██░▒█
▓▒░░░░░░░░░░░░░░══███░░░░░═█████████▒░▒▓
█▒░░░░░░░░░░░░░░░══▒░░░░░░═░████████░▒▒▓
▓▒░░░░░░░░░░░░░░░░░░░░░░░░░═███████▒░▒░▓
█▒░░░░░░░░░░░░░░░░░░░░░░░░░══▓████▒░▒▒▒▒
█▒░▒░░░░░░░░░░░░░░░░░░░░░░░░░═░▒▒░░▒▒▒▒▓
█▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▓
█▒░▒░░░░░░░░██═░░░░░░░░░░░░░░░░▒░▒▒▒▒▒▒▓
█▓░▒▒░░░░░░═██░═░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒█
██░▒▒▒░░░░░═██▒═░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒█
▓█▒░▒▒░░░░░═▒██═░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▓█
░█▒░▒▒░▒░░░░═██▒═░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▓█
═██░▒▒▒▒▒░░░═░██░═░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒█▒
═▓█▒░▒▒▒▒▒░░░═▓██░═░░░░▒░▒▒▒▒▒▒▒▒▒▒▒░██═
══██▒▒▒▒▒▒▒░▒░═███▓═░░░░▒▒▒▒▒▒░░▒▒▒░▒█▓═
══▒█▓▒▒▒▒▒▒▒▒▒░═▓███▓░═░░░░░░░▓█▓▒▒▒██══
═══██▒▒▒▒▒▒▒▒▒▒░░▒█████▓▓▒▓▓█████░▒▓█░══
════██▒▒▒▒▒▒▒▒▒▒▒░░▒███████████▓░▒▓█▒═══
═════██▒▒▒▒▒▒▒▒▒▒▒▒░░░▓█████▓▒░░░▓█▓════
═════░██▓▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░▒░▒██▓═════
═══════███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▓██▓══════
════════▓███▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒▒███░═══════
═════════░████▓▒▒▒▒▒▒░▒▒▒▒▓███▓═════════
═══════════░▓██████▓▓███████▒═══════════
══════════════░▓█████████▒░═════════════
════════════════════════════════════════

Post Reply

Who is online

Users browsing this forum: No registered users