[SOLVED] Rotating image on title screen

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
pokaku
Newbie
Posts: 9
Joined: Tue Jan 19, 2016 7:45 pm
Projects: Circlet
Tumblr: valesart
Contact:

[SOLVED] Rotating image on title screen

#1 Post by pokaku » Tue Jan 19, 2016 8:14 pm

I am very confused on how to use ATL with screens. I've looked around at tutorials but I don't really understand them. I want to have my title screen logo animated. I specifically want to have a image continuously rotate clockwise and another rotate counter clockwise. How do I go about doing this?

I want the far.png to go clockwise and near.png to go counter clockwise.

This is what I have so far. I just don't know what to do next.

Code: Select all

screen main_menu():

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

    # The background of the main menu.
    window:
        style "mm_root"
        add "far.png"
        add "near.png"
Last edited by pokaku on Wed Jan 20, 2016 2:11 pm, edited 2 times in total.

User avatar
Hijiri
Eileen-Class Veteran
Posts: 1519
Joined: Sun Mar 25, 2012 6:35 pm
Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
Projects: Death Rule: Killing System
Organization: MESI Games
IRC Nick: Hizi
Tumblr: mesigames
Skype: kurotezuka
itch: hijiri
Location: Los Angeles
Contact:

Re: Rotating image on title screen

#2 Post by Hijiri » Wed Jan 20, 2016 12:49 am

Code: Select all

   image far:
        subpixel True
        rotate 0
        linear 10.0 rotate 360
        repeat

Code: Select all

   image near:
        subpixel True
        rotate 0
        linear 10.0 rotate -360
        repeat
Linear tells Renpy how long it should take for the image to rotate from 0 to 360. Once you coded the images, go here:

Code: Select all

screen main_menu:
    tag menu
    add "far"
    add "near"
    window:
        style "mm_root"
Image Image
"Perfection goal that always changes. Can pursue, cannot obtain."

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Rotating image on title screen

#3 Post by PyTom » Wed Jan 20, 2016 1:31 am

You would define two transforms, and then do:

Code: Select all

add "far.png" at cw
add "near.png" at ccw
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
pokaku
Newbie
Posts: 9
Joined: Tue Jan 19, 2016 7:45 pm
Projects: Circlet
Tumblr: valesart
Contact:

Re: Rotating image on title screen

#4 Post by pokaku » Wed Jan 20, 2016 10:41 am

I have the images turning but they're moving all over the screen. I just want to them turn in one place.

Here's what I did:

Code: Select all

transform forward_spin:
        subpixel True
        rotate 0
        linear 60.0 rotate 360
        repeat
        
    transform back_spin:
        subpixel True
        rotate 0
        linear 60.0 rotate -360
        repeat


How would I make them stay in one place and rotate?

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

Re: Rotating image on title screen

#5 Post by Alex » Wed Jan 20, 2016 12:57 pm

What's the size of "far.png" and "near.png", are they fullscreen?

User avatar
pokaku
Newbie
Posts: 9
Joined: Tue Jan 19, 2016 7:45 pm
Projects: Circlet
Tumblr: valesart
Contact:

Re: Rotating image on title screen

#6 Post by pokaku » Wed Jan 20, 2016 1:07 pm

Thank you very much for the help everyone, I have it exactly how I wanted it.


I fixed the size of the images and now they turn perfectly. My only problem is that I can't get them around the image I want them to rotate around. I get to a certain point and I can't move it over any further.
Attachments
4569e00462593b391225386b64815cf5.png

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot