So, here's my situation - I'm trying to create a graphical countdown timer.
I have a sequence of PNG images of an LED timer unit, with each image representing one second of the countdown. I've found that I can turn these into an animated graphic by defining them in script.rpy as an image, thusly:
image greentimer60:
size(300,300)
"timers/60sec-green/green60-01.png"
pause 1
"timers/60sec-green/green60-02.png"
pause 1
"timers/60sec-green/green60-03.png"
pause 1
"timers/60sec-green/green60-04.png"
...and so on
The problem is that I would like this timer to remain onscreen across multiple scene changes.
If I just use:
show greentimer60
...then the timer graphic will disappear as soon as the first scene transition happens.
So, I thought maybe I could make it into a screen, since screens can persist across multiple scenes, but at the moment I can't figure out a way to do that. It doesn't appear that I can simply call the existing graphic into a screen:
screen demotimer():
fixed:
add greentimer60
...because this results in a "greentimer60 not defined" error. And copying the defining image code from script.rpy to screens.rpy didn't seem to work either.
Is there a way to actually do this?
animated graphic timer using screens?
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.
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.
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: animated graphic timer using screens?
Try:
Code: Select all
add "greentimer60"
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
-
- Regular
- Posts: 36
- Joined: Fri Oct 04, 2019 3:02 pm
- Deviantart: bloobeary
- Soundcloud: user-212448702
- Contact:
Re: animated graphic timer using screens?
Yep. That worked, thanks!
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], snotwurm