imagebutton using ATL problems

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
nananame
Regular
Posts: 72
Joined: Fri Oct 13, 2017 1:40 pm
Contact:

imagebutton using ATL problems

#1 Post by nananame » Tue Sep 29, 2020 9:58 am

Continuing to play with making an image button use an ATL defined image, I ran into a problem.

When the button gains focus, the animation will speedup/jump/do something.

I don't know why. Here's how it looks - you can see the little man waving (that is an imagebutton). When I hover over it, the button gains focus and the animation skips.

[youtube]https://www.youtube.com/watch?v=xEz5Vj8IuHc[/youtube]

This is a simple test script Nothing fancy in it:

Code: Select all

image atlbutton:
    "images/1.png"
    0.3
    "images/2.png"
    0.3
    "images/3.png"
    0.3
    "images/2.png"
    0.3
    repeat

screen buttontest():
    imagebutton:
        idle "atlbutton"
        pos (100,100)
        action NullAction()
Question is - how can this be avoided?

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: imagebutton using ATL problems

#2 Post by Alex » Tue Sep 29, 2020 3:50 pm

Not tested if it'll solve the issue, but try to put animation inside a button.

Code: Select all

screen buttontest():
    button:
        pos (100,100)
        add "atlbutton"
        action NullAction()

nananame
Regular
Posts: 72
Joined: Fri Oct 13, 2017 1:40 pm
Contact:

Re: imagebutton using ATL problems

#3 Post by nananame » Wed Sep 30, 2020 2:07 am

Alex wrote:
Tue Sep 29, 2020 3:50 pm
Not tested if it'll solve the issue, but try to put animation inside a button.

Code: Select all

screen buttontest():
    button:
        pos (100,100)
        add "atlbutton"
        action NullAction()
@Alex I love you! Not sure how you came up with that (the reasoning behind it I mean) but it works!
Switching to button instead of imagebutton (and thus using add instead of idle) worked! I had to set the focus_mask to the displayable and it all works now!

Makes me wonder, why do we even use imagebuttons then? :?:

Post Reply

Who is online

Users browsing this forum: Google [Bot], TioNick