animation in main menu

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
TamakiShibo
Regular
Posts: 27
Joined: Sat Jul 07, 2018 1:24 pm
Contact:

animation in main menu

#1 Post by TamakiShibo »

can i do animated main menu? like gif picture or something like that

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: animation in main menu

#2 Post by Per K Grok »

TamakiShibo wrote: Sun Jul 29, 2018 7:32 am can i do animated main menu? like gif picture or something like that
You can add an animation to the main menu, but you should forget about animated GIF:s. That is not the answer.

You should define an animation

Code: Select all

image anim:
    "img1.png"
    0.2
    "img2.png"
    0.2
    "img3.png"
    0.2
    repeat
You can then show the animation in the main menu using screen language

add "anim"

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: animation in main menu

#3 Post by Imperf3kt »

Its also possible to add videos as a background - as long as you don't plan to release to Android.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

TamakiShibo
Regular
Posts: 27
Joined: Sat Jul 07, 2018 1:24 pm
Contact:

Re: animation in main menu

#4 Post by TamakiShibo »

Per K Grok wrote: Sun Jul 29, 2018 10:44 am
TamakiShibo wrote: Sun Jul 29, 2018 7:32 am can i do animated main menu? like gif picture or something like that
You can add an animation to the main menu, but you should forget about animated GIF:s. That is not the answer.

You should define an animation

Code: Select all

image anim:
    "img1.png"
    0.2
    "img2.png"
    0.2
    "img3.png"
    0.2
    repeat
You can then show the animation in the main menu using screen language

add "anim"
here's what i wrote:

Code: Select all

style_prefix "game_menu"

    image anim:
        "1.png"
        0.5
        "2.png"
        0.5
        repeat


    add "anim"
but...

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/screens.rpy", line 423: expected a keyword argument or child statement.
    "1.png"
    ^

Ren'Py Version: Ren'Py 7.0.1.260
Sat Aug 18 19:52:59 2018
what i did wrong?

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: animation in main menu

#5 Post by Per K Grok »

TamakiShibo wrote: Sat Aug 18, 2018 10:53 am ------

here's what i wrote:

Code: Select all

style_prefix "game_menu"

    image anim:
        "1.png"
        0.5
        "2.png"
        0.5
        repeat


    add "anim"
but...

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/screens.rpy", line 423: expected a keyword argument or child statement.
    "1.png"
    ^

Ren'Py Version: Ren'Py 7.0.1.260
Sat Aug 18 19:52:59 2018
what i did wrong?

Move

Code: Select all

    image anim:
        "1.png"
        0.5
        "2.png"
        0.5
        repeat
to script.rpy before label start.
Only keep
add "anim"
in screens.rpy

I think that should fix it.

TamakiShibo
Regular
Posts: 27
Joined: Sat Jul 07, 2018 1:24 pm
Contact:

Re: animation in main menu

#6 Post by TamakiShibo »

Per K Grok wrote: Sat Aug 18, 2018 11:32 am
TamakiShibo wrote: Sat Aug 18, 2018 10:53 am ------

here's what i wrote:

Code: Select all

style_prefix "game_menu"

    image anim:
        "1.png"
        0.5
        "2.png"
        0.5
        repeat


    add "anim"
but...

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/screens.rpy", line 423: expected a keyword argument or child statement.
    "1.png"
    ^

Ren'Py Version: Ren'Py 7.0.1.260
Sat Aug 18 19:52:59 2018
what i did wrong?

Move

Code: Select all

    image anim:
        "1.png"
        0.5
        "2.png"
        0.5
        repeat
to script.rpy before label start.
Only keep
add "anim"
in screens.rpy

I think that should fix it.
it works, thank you!

Post Reply

Who is online

Users browsing this forum: Dark79