Problem with ATL of Main Menu Imagebutton [SOLVED]

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
mitoky
Veteran
Posts: 287
Joined: Sat Feb 07, 2015 9:12 pm
Projects: CrossDol, The Purring Demon's Love, circus eterie
Organization: astellic
Tumblr: mitoky
Contact:

Problem with ATL of Main Menu Imagebutton [SOLVED]

#1 Post by mitoky » Tue Oct 03, 2017 3:10 pm

EDIT: Opening again due to new problem (look at the last message)
EDIT 2: Solved!

Hello!
I am new to coding so the solution might be simple but i simply can't seem to find it, hence i hope someone can help me.

For the main menu i have imagebuttons which i want to slide to the right slightly when hovered and back when unhovered. So far i only tested it with the start button and it works.

My problem is that teh button jumps to it's place very quickly when launching the project or entering the main menu after the game end. So my question is how to make the button already be at the right place?

The coding i used:

Code: Select all

transform slide:
    on hover:
        linear 0.3 xpos 205 ypos 471
    on idle:
        linear 0.3 xpos 105 ypos 471
        
imagebutton auto "gui/custom/mmbuttons/start_%s.png" xpos 105 ypos 471 focus_mask True at slide action Start()
       
        
Last edited by mitoky on Thu Dec 14, 2017 10:24 am, edited 3 times in total.
Image

[Logo Commissions - OPEN] || Wish to support or tip me? Buy Me a Coffee!

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Problem with ATL of Main Menu Imagebutton

#2 Post by Divona » Wed Oct 04, 2017 12:42 am

mitoky wrote:
Tue Oct 03, 2017 3:10 pm
My problem is that teh button jumps to it's place very quickly when launching the project or entering the main menu after the game end. So my question is how to make the button already be at the right place?
Could try:

Code: Select all

transform slide:
    on show:
        xpos 105 ypos 471
    on idle:
        linear 0.3 xpos 105
    on hover:
        linear 0.3 xpos 205
        
imagebutton auto "gui/custom/mmbuttons/start_%s.png" focus_mask True at slide action Start()
Completed:
Image

User avatar
mitoky
Veteran
Posts: 287
Joined: Sat Feb 07, 2015 9:12 pm
Projects: CrossDol, The Purring Demon's Love, circus eterie
Organization: astellic
Tumblr: mitoky
Contact:

Re: Problem with ATL of Main Menu Imagebutton

#3 Post by mitoky » Wed Oct 04, 2017 12:53 am

Divona wrote:
Wed Oct 04, 2017 12:42 am
mitoky wrote:
Tue Oct 03, 2017 3:10 pm
My problem is that teh button jumps to it's place very quickly when launching the project or entering the main menu after the game end. So my question is how to make the button already be at the right place?
Could try:

Code: Select all

transform slide:
    on show:
        xpos 105 ypos 471
    on idle:
        linear 0.3 xpos 105
    on hover:
        linear 0.3 xpos 205
        
imagebutton auto "gui/custom/mmbuttons/start_%s.png" focus_mask True at slide action Start()
Doesn't works ;-;
I tried using show before but i have the feeling (and tried it out to confirm too) that it does nothing.
Image

[Logo Commissions - OPEN] || Wish to support or tip me? Buy Me a Coffee!

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Problem with ATL of Main Menu Imagebutton

#4 Post by Divona » Wed Oct 04, 2017 1:31 am

Do you mind dropping the project or just the start menu part here? It would be easier for me to figure out in this case. Just not enough info to guess the issue. I tried it on a new project with no problem.
Completed:
Image

User avatar
mitoky
Veteran
Posts: 287
Joined: Sat Feb 07, 2015 9:12 pm
Projects: CrossDol, The Purring Demon's Love, circus eterie
Organization: astellic
Tumblr: mitoky
Contact:

Re: Problem with ATL of Main Menu Imagebutton

#5 Post by mitoky » Wed Oct 04, 2017 1:49 am

Divona p[quote wrote:ost_id=466221 time=1507095115 user_id=35345]
Do you mind dropping the project or just the start menu part here? It would be easier for me to figure out in this case. Just not enough info to guess the issue. I tried it on a new project with no problem.
Exactly as i have it in my project:

Code: Select all

transform slide:
    on show:
        xpos 105 ypos 471
    on idle:
        linear 0.3 xpos 105
    on hover:
        linear 0.3 xpos 205
    

screen main_menu():

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

    style_prefix "main_menu"

    add gui.main_menu_background
    
    ##Main Menu Buttons

    imagebutton auto "gui/custom/mmbuttons/start_%s.png" focus_mask True at slide action Start()
    imagebutton auto "gui/custom/mmbuttons/album_%s.png" xpos 105 ypos 618 focus_mask True action ShowMenu("common_p1")
    imagebutton auto "gui/custom/mmbuttons/settings_%s.png" xpos 105 ypos 765 focus_mask True action ShowMenu("preferences")
    imagebutton auto "gui/custom/mmbuttons/load_%s.png" xpos 594 ypos 539 focus_mask True action ShowMenu("load")
    ##action none as no screen for extras yet
    imagebutton auto "gui/custom/mmbuttons/extras_%s.png" xpos 594 ypos 686 focus_mask True action None
    imagebutton auto "gui/custom/mmbuttons/exit_%s.png" xpos 594 ypos 833 focus_mask True action Quit(confirm=False)
Image

[Logo Commissions - OPEN] || Wish to support or tip me? Buy Me a Coffee!

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Problem with ATL of Main Menu Imagebutton

#6 Post by Divona » Wed Oct 04, 2017 3:00 am

Code: Select all

transform slide:
    xpos 105 ypos 471
    on idle:
        linear 0.3 xpos 105
    on hover:
        linear 0.3 xpos 205
Completed:
Image

User avatar
mitoky
Veteran
Posts: 287
Joined: Sat Feb 07, 2015 9:12 pm
Projects: CrossDol, The Purring Demon's Love, circus eterie
Organization: astellic
Tumblr: mitoky
Contact:

Re: Problem with ATL of Main Menu Imagebutton

#7 Post by mitoky » Wed Oct 04, 2017 3:14 am

Divona wrote:
Wed Oct 04, 2017 3:00 am

Code: Select all

transform slide:
    xpos 105 ypos 471
    on idle:
        linear 0.3 xpos 105
    on hover:
        linear 0.3 xpos 205
It works! Thank you so much! You are a life saver (:
Image

[Logo Commissions - OPEN] || Wish to support or tip me? Buy Me a Coffee!

User avatar
mitoky
Veteran
Posts: 287
Joined: Sat Feb 07, 2015 9:12 pm
Projects: CrossDol, The Purring Demon's Love, circus eterie
Organization: astellic
Tumblr: mitoky
Contact:

Re: Problem with ATL of Main Menu Imagebutton

#8 Post by mitoky » Wed Dec 13, 2017 9:17 pm

Hello! So using the methods above, i ahve amnaged to make my screens animated, however i encountered 2 small problems.

In my gallery for example, i have the screen slightly build up through ATL.
Also, my gallery is more than one screen. A Common Page and then one per each charcater.
The first page you see it the common gallery, hence i set it up that the screen sets up when showing that screen (button's sliding in as in above and out again when unhovered).

I noticed that if i click a diffrent character page the atl transformation for the button gets cut off/ the setup animation. I was wondering if its possible to advoid that, and if yes how?

EDIT: I just had the idea to simply make the animation a diffrent screen and simply gall the gallery screens. I am testing it out rn.
Image

[Logo Commissions - OPEN] || Wish to support or tip me? Buy Me a Coffee!

User avatar
mitoky
Veteran
Posts: 287
Joined: Sat Feb 07, 2015 9:12 pm
Projects: CrossDol, The Purring Demon's Love, circus eterie
Organization: astellic
Tumblr: mitoky
Contact:

Re: Problem with ATL of Main Menu Imagebutton

#9 Post by mitoky » Thu Dec 14, 2017 10:23 am

Solved my problem. I simply made the buttons on a seperate screen and voila, it works.
Image

[Logo Commissions - OPEN] || Wish to support or tip me? Buy Me a Coffee!

Post Reply

Who is online

Users browsing this forum: No registered users