ATL rotating problem (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
Smaymay
Regular
Posts: 70
Joined: Fri Jul 01, 2016 11:35 am
Completed: Vicboys demo
Tumblr: esmmeh
Deviantart: Smaymay
Location: The Netherlands
Contact:

ATL rotating problem (solved)

#1 Post by Smaymay » Sat Jul 09, 2016 12:14 pm

Hi! I'm currently working on my titlescreen and used the Imagebutton GUI Framework from Uncle Mugen and Leon. I made a tooltip image that appears on both sides next to an imagebutton when you hover over it. I wanted the image to rotate as well, so I used ATL to achieve this. The rotating works fine! :D But there is something off with the positioning of the tooltips. At first glance, nothing appeared to be wrong. But when I took a screenshot and compared it to my GUI PSD file I noticed the tooltips weren't placed at the right position. The position of the tooltips should be at the position of the transparent gear wheels (xpos 740, ypos 640) but where placed at the position of the opaque gear wheels. The difference is about 10 pixels.
Image
I pasted the code below. Does anyone know what I did wrong? Thanks in advance! :)

Code: Select all

    imagebutton:
            auto "images/GUI/titlescreen/newgame_%s.png" 
            xpos 809 ypos 589 
            focus_mask None 
            action Start() 
            hovered [ Play ("Soundeffect_1", "audio/soundeffects/menu_hover.wav"), 
            Show("gui_tooltip", tt_source="images/GUI/titlescreen/tooltip_gear_hover.png", tt_xpos=740, tt_ypos=604),
            Show("gui_tooltip2", tt_source="images/GUI/titlescreen/tooltip_gear_hover.png", tt_xpos=1240, tt_ypos=604)] 
            unhovered [Hide("gui_tooltip"), Hide("gui_tooltip2")]       

Code: Select all

#begin rotate_eff
init-2:
    transform rotate_eff:
        rotate_pad True
        rotate 0
        linear 3.0 rotate 360
        repeat
#end rotate_eff

Code: Select all

screen gui_tooltip:
    add tt_source xpos tt_xpos ypos tt_ypos at rotate_eff 
 
screen gui_tooltip2:
    add tt_source xpos tt_xpos ypos tt_ypos at rotate_eff 
Last edited by Smaymay on Sun Jul 10, 2016 5:34 am, edited 1 time in total.

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: ATL rotating problem

#2 Post by Kia » Sun Jul 10, 2016 2:47 am

try xanchor .5 and yanchor .5 you also need to set the anchor in your photoshop to center then get the position

User avatar
Smaymay
Regular
Posts: 70
Joined: Fri Jul 01, 2016 11:35 am
Completed: Vicboys demo
Tumblr: esmmeh
Deviantart: Smaymay
Location: The Netherlands
Contact:

Re: ATL rotating problem

#3 Post by Smaymay » Sun Jul 10, 2016 5:34 am

It worked! Thank you so much :D

Post Reply

Who is online

Users browsing this forum: enaielei