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.
I'm normally using renpy.image as I'm dynamically reading the image directory for what images are stored there and prescale them as needed.
So my question here is...is there any way to do the above with renpy.image or something similar?
Last edited by Ryue on Thu Aug 08, 2013 1:12 am, edited 1 time in total.
renpy.image(name, d)
Defines an image. This function is the python equivalent of the image statement.
name
The name of the image to display, a string.
d
The displayable to associate with that image name.
This function may only be run from inside an init block. It is an error to run this function once the game has started.
Exactly renpy.image I'm using to create single images. But the problem in this case is I want to create this "animated" image, and there I'm not sure what commands to use
(a single image is easy: renpy.image("mypic1","pic/water1.png").
For a few I'm also making scales there (example): renpy.image("mypic2",im.Scale(ImageReference("mypic1"),162,877))
but an animation with water 1 0.5 secs pause, water 2, 0.5 secs pause water 3, 0.5 secs pause and repeat from the beginning is where I don't know how to do that with renpy.image (or something similar).
Afaik, transform is a displayable which takes other displayables as its arguments then return a new displayable.
So I think you can use renpy.image(name, transform("file.png")), etc
BTW, I'm just using anim.Filmstrip()
xavimat wrote:Sorry to bother you, but, why do you need renpy.image()? Can't do the same with the "image" statement?
(I know I'm not answering but asking...)
It's no problem.
I'm using renpy.image as I'm doing the whole image declaration automatically.
Thus I'm:
1.) Reading all files in the image directory
2.) I create 1 image per file therein (and 5 create more specifically scaled images for each file)
I found no good way to do that with the image statment thats why I'm using renpy.image for almost all things
nyaatrap wrote:Afaik, transform is a displayable which takes other displayables as its arguments then return a new displayable.
So I think you can use renpy.image(name, transform("file.png")), etc
BTW, I'm just using anim.Filmstrip()
Tnx.
Transform I looked up but didn't see how I could use multiple images there to create an animation.
anim.Filmstrip() looks just like what I was searching for (surprised though that it uses 1 image with multiple frames in it, but still quite useable that way).
Ryue, hi, have you found a solution?
I tackled the same issue as implementing a code on Python, similar to the one you wrote.
So far I had to write everything myself. Apparently, I duplicate existing functions, but so far I have not found the necessary documentation.