Basically, I want a type of "icon" to appear near the bottom-left of the text area, when it's time for the user to proceed.
I can make a static icon appear there, like this:
Code: Select all
proceed = Image('misc/ui/proceed.png', xalign=0.95, yalign=0.96)
define std = Character(None,
ctc=proceed, ctc_position='fixed',
who_outlines=[(1, "#000080")])
define aoto = Character('Aoto', std)
script:
aoto "Hello"
However, I now want to give that icon a small "bouncing up and down" effect.
The most obvious way to do this seems to be to have the position of the "proceed" image actually be an anim.Move object, with the "bounce" and "repeat" parameters set to True.
However, in the initialization of the "proceed" image, I don't know how to make the Image's "position properties" be set to an "anim.Move" object.
I researched this some more, and found PyTom's advice to another poster over here:
http://lemmasoft.renai.us/forums/viewto ... ?f=8&t=890
That was actually advice for working around a bug in 2006, but from there, I see that you can create an image object as a "child" of a position object. Then if you show the "position" object, it automatically places the child image.
I tried extending that example, by using anim.Move instead of Position, but hit a problem.
This works for me:
Code: Select all
define my_move = Position(xalign=0.95, yalign=0.96)
define proceed = my_move(im.Image('misc/ui/proceed.png'))
Code: Select all
define my_move = Move(left, right, repeat=True, bounce=True)
define proceed = my_move(im.Image('misc/ui/proceed.png'))
Code: Select all
Full traceback:
File "/home/david/dev/renpy/renpy-6.12.2/renpy/execution.py", line 261, in run
node.execute()
File "/home/david/dev/renpy/renpy-6.12.2/renpy/ast.py", line 1456, in execute
value = renpy.python.py_eval_bytecode(self.code.bytecode)
File "/home/david/dev/renpy/renpy-6.12.2/renpy/python.py", line 998, in py_eval_bytecode
return eval(bytecode, globals, locals)
File "game/script.rpy", line 61, in <module>
File "/home/david/dev/renpy/renpy-6.12.2/renpy/curry.py", line 38, in __call__
**dict(self.kwargs.items() + kwargs.items()))
File "/home/david/dev/renpy/renpy-6.12.2/renpy/display/motion.py", line 1047, in Move
return Motion(Interpolate(startpos, endpos),
File "/home/david/dev/renpy/renpy-6.12.2/renpy/display/motion.py", line 942, in __init__
if len(start) != len(end):
TypeError: object of type 'ATLTransform' has no len()
While executing init code:
File "game/script.rpy", line 63, in script
define proceed = my_move(im.Image('misc/ui/proceed.png'))
File "game/script.rpy", line 61, in python
TypeError: object of type 'ATLTransform' has no len()
So, is there some way to use Ren'Py animations for the CTC image?
So far, it kind of looks like I need to make a Filmstrip or Animation object, but that's kind of annoying - having to edit images into a "bouncing" animation for the CTC, when (in theory) I should be able to use program logic for that. Plus I'm a programmer, and don't really have art/animation skills
(I guess I could also problematically generate the separate PNG images for the bounce animation, and then load those into the Filmstrip, but that seems a bit extreme. I want to check if there's a simpler way to do this)