Animated choices?

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
quinnsea
Regular
Posts: 59
Joined: Wed Apr 26, 2017 5:04 pm
Completed: Birch Sapling
Projects: Aspen, Baleen
Organization: Koimarina Games
IRC Nick: quinnsea
Tumblr: bonnievoyage
Soundcloud: nishiikigoi
itch: koimarina
Location: Missouri
Contact:

Animated choices?

#1 Post by quinnsea »

Hi! I think I almost have the code I need to ensure whenever someone hovers over a choice it plays a looping animation. I just... can't figure out what this last thing needs to be.

Code: Select all

init python:
    gui.button_hover_properties("choice_i.action") =
    "gui/button/animchoice 1.png" 
    pause 0.1
    "gui/button/animchoice 2.png"
    pause 0.1
    "gui/button/animchoice 3.png"
    pause 0.1
    "gui/button/animchoice 4.png"
    pause 0.1
    "gui/button/animchoice 5.png"
    pause 0.1
    "gui/button/animchoice 6.png"
    pause 0.1
    "gui/button/animchoice 7.png"
    pause 0.1
    "gui/button/animchoice 8.png"
    pause 0.1
    "gui/button/animchoice 9.png"
    pause 0.1
    "gui/button/animchoice 10.png"
    pause 0.1
    "gui/button/animchoice 11.png"
    pause 0.1
    "gui/button/animchoice 12.png"
    pause 0.1
    "gui/button/animchoice 13.png"
    pause 0.1
    "gui/button/animchoice 14.png"
    pause 0.1
    "gui/button/animchoice 15.png"
    pause 0.1
    "gui/button/animchoice 16.png"
    pause 0.1
    "gui/button/animchoice 17.png"
    pause 0.1
    "gui/button/animchoice 18.png"
    pause 0.1
    "gui/button/animchoice 19.png"
    pause 0.1
    "gui/button/animchoice 20.png"
    pause 0.1
    "gui/button/animchoice 21.png"
    pause 0.1
    "gui/button/animchoice 22.png"
    pause 0.1
    "gui/button/animchoice 23.png"
    pause 0.1
    "gui/button/animchoice 24.png"
    pause 0.1
    "gui/button/animchoice 25.png"
    pause 0.1
    "gui/button/animchoice 26.png"
    pause 0.1
    repeat
I've been giving different names to gui.button_hover_properties("choice_i.action") for a while, but nothing seems to stick. What's the right name for the variable? Thanks in advance, all help is appreciated!
ImageImage

quinn / 26 / qa analyst, game design hobbyist
icon by church

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Animated choices?

#2 Post by PyTom »

Code: Select all

image button hover background:
    "gui/button/animchoice 1.png" 
    pause 0.1
    "gui/button/animchoice 2.png"
    pause 0.1
    "gui/button/animchoice 3.png"
    pause 0.1
    "gui/button/animchoice 4.png"
    pause 0.1
    "gui/button/animchoice 5.png"
    pause 0.1
    "gui/button/animchoice 6.png"
    pause 0.1
    "gui/button/animchoice 7.png"
    pause 0.1
    "gui/button/animchoice 8.png"
    pause 0.1
    "gui/button/animchoice 9.png"
    pause 0.1
    "gui/button/animchoice 10.png"
    pause 0.1
    "gui/button/animchoice 11.png"
    pause 0.1
    "gui/button/animchoice 12.png"
    pause 0.1
    "gui/button/animchoice 13.png"
    pause 0.1
    "gui/button/animchoice 14.png"
    pause 0.1
    "gui/button/animchoice 15.png"
    pause 0.1
    "gui/button/animchoice 16.png"
    pause 0.1
    "gui/button/animchoice 17.png"
    pause 0.1
    "gui/button/animchoice 18.png"
    pause 0.1
    "gui/button/animchoice 19.png"
    pause 0.1
    "gui/button/animchoice 20.png"
    pause 0.1
    "gui/button/animchoice 21.png"
    pause 0.1
    "gui/button/animchoice 22.png"
    pause 0.1
    "gui/button/animchoice 23.png"
    pause 0.1
    "gui/button/animchoice 24.png"
    pause 0.1
    "gui/button/animchoice 25.png"
    pause 0.1
    "gui/button/animchoice 26.png"
    pause 0.1

define gui.button_hover_background = "button hover background"
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
quinnsea
Regular
Posts: 59
Joined: Wed Apr 26, 2017 5:04 pm
Completed: Birch Sapling
Projects: Aspen, Baleen
Organization: Koimarina Games
IRC Nick: quinnsea
Tumblr: bonnievoyage
Soundcloud: nishiikigoi
itch: koimarina
Location: Missouri
Contact:

Re: Animated choices?

#3 Post by quinnsea »

That didn't work either, it's still just using the default image. :(
ImageImage

quinn / 26 / qa analyst, game design hobbyist
icon by church

Post Reply

Who is online

Users browsing this forum: FAST WebCrawler [Crawler], Google [Bot]