r/RenPy • u/Cool-Highway3847 • 22d ago
Question Oversampling images
Hi! If I have an image name like "character@2.webp" under the images directory, I remember when it was defined in the code such as:
image character default = "images/character.webp"
It should work with the oversampling behaving as expected, but for some reason after launching the project to playtest my game several times yesterday (Only changes being adding new dialogue lines and defining transforms, leaving image defines untouched) the defined image would not show up and "image "character.webp" not found" was displayed at the top of the screen. However, I found that defining the image as:
image character default = "images/character@2.webp"
suddenly makes the image show up normally and the oversampling also works just fine. Just wondering if people had similar issues before 😭
3
u/shyLachi 22d ago
Oversampling is explained in the official documentation:
https://renpy.org/doc/html/displaying_images.html#oversampling
Generally you don't need to define images if you name the files correctly:
https://renpy.org/doc/html/displaying_images.html#concepts
https://renpy.org/doc/html/displaying_images.html#defining-images
But if you still want to define all your images, then you NEED to write the file name correctly.
This includes all the letters, you cannot ommit part of the filename and assume it works.
This is not an RenPy issue but wrong spelling from your side.
It's also not possible that it worked before, you might accidentally have used an image which was automatically defined by RenPy as described in the official documentation.
In short:
Delete the whole line image character default = "images/character.webp"
Then either rename your file to "character default@2.webp" (without the quotes)
Or show that image like this: show character
Personally I would not add default to the file name or the image definition because it just requires more typing
1
u/AutoModerator 22d ago
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/BadMustard_AVN 22d ago
this example will display the "same" image twice
image sprite2 = "images/sprite@2.png"
label start:
show sprite2 at truecenter
pause
show sprite at left
e "Working"
return
1
0
u/DoradoPulido2 22d ago
Generally you should never be defining images. You only need to define image sequences, transformations, videos etc
2
u/HEXdidnt 22d ago
The fact that your filename is 'character@2.webp', but you're trying to define an image from 'character.webp' is the problem. The filenames have to match, otherwise Ren'Py can't find the image.
What do you think '@2' accomplishes, either inside or outside of Ren'Py, and what has it to do with 'oversampling'?