Moving Animation After Doing Truecenter

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
Nero
Veteran
Posts: 248
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

Moving Animation After Doing Truecenter

#1 Post by Nero »

Ok so thing here is that I wanted my animation to zoom out from the center of image by default it goes from upper left corner to do it I placed truecenter line at my code but problem now is that xpos,ypos, xalign or yaling wont work anymore so how do I keep truecenter animation with ability to move my image around the screen as I want?


Here is the code:

Code: Select all

init python:

    def SKILL_ANIMATION(t, st, at):

        # Repeat every 3 seconds.
        st = st % 3.0

        # The move takes 1.5 seconds.
        done = min(st / 1.5, 1.0)

        t.rotate = 360 * done
        t.alpha = 1.0 + done
        t.zoom = 1.0  + done

        return 0

screen test_screen():
    add "SIMPLEIMAGE.png" at Transform(function=SKILL_ANIMATION), truecenter  

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Moving Animation After Doing Truecenter

#2 Post by Donmai »

Yes, truecenter, as the name suggests, centers everything on screen. Forget it, that's not what you want in this case.
The top left corner is the default anchor position. You should change the anchor to the center of the figure. If you were using ATL I would be able to help you, but python functions read like ancient Sumerian to me.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Nero
Veteran
Posts: 248
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

Re: Moving Animation After Doing Truecenter

#3 Post by Nero »

I somehow managed to do it by making a new screen a lot of tinkering but it works now:

Code: Select all

screen transformations_animations_screen_enemy():
    zorder 111
    hbox:
        spacing -365
        xpos 720
        xalign 0.500 yalign 0.052
        for i, each_enemy_member in enumerate(enemy_members_list):
                vbox:
                    ypos 1
                    spacing -13
                    xminimum 600
                    box_wrap True
                    ymaximum 175
                    order_reverse True

                    if each_enemy_member.CHECK_ACTIVITY_Skill_Dodge_Buff_Self_Space == True:
                        add "HoverScreens/hoverimageEFFECTS/DODGEBUFFSPACE_EFFECT.png" at Transform(function=SKILL_ANIMATION), truecenter

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]