Stingy with Images...

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
Xino
Regular
Posts: 78
Joined: Tue Jun 23, 2009 12:26 pm
Projects: W.I.P. Love Demon
Contact:

Stingy with Images...

#1 Post by Xino »

OK! So I want to do A LOT of pictures for my game. But I don't want to make so many the game will take forever to download. So here is my question, can I use one image in a comic like format but display separate panels only? I want to use one image file to show 3 different scenes.

EXAMPLE!
Image

We start with panel 1, give a little dialog and then fade to panel 2. I'd also like to display panel 3 without removing 2 from the screen. Is this possible?
Want something drawn? Just ask~! I love to draw! Free of charge!

I <3 Ctrl+Z

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: Stingy with Images...

#2 Post by PyTom »

The easiest way to do this would be to declare multiple images, and show them one at a time, at appropriate positions. You can set the position by declaring an image using Image, and giving it an xpos parameter.

Code: Select all

image panel1 = Image("panel1.jpg", xpos=0)
image panel2 = Image("panel2.jpg", xpos=250)
image panel3 = Image("panel3.jpg", xpos=500)

You can then show each images when appropriate. Just be sure to put a "scene black" behind them.

Code: Select all

label start:
    scene black
    show panel1

    "I am threatening you!"

    show panel2

    "Now we glare at each other."

    show panel3

    "And we get ready to fight!"
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
killdream
Veteran
Posts: 325
Joined: Wed Nov 05, 2008 1:05 pm
Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
Deviantart: robotlolita
Github: robotlolita
Location: World's End (aka Brazil)
Contact:

Re: Stingy with Images...

#3 Post by killdream »

Not that joining it all in a single image would help much. It is a issue when you're doing web development, as each archive has 2 requests, so you'd want the number of files to minimum. In a stand-alone game, you'll distribute just a single zip (or installer), in the end, pixels in a image will be as heavy as pixels in separated images.

Try looking at JPEGs quality property (when exporting, a value of 80% should be satisfactory in most of cases, altough it'll have some artifacts, or alot of them, depending on the image). Reducing the image size and the number of colors help too.

Anyways, there was a survey here where most peoples voted to don't mind really the download size, as long as the game appealed for them. Just do what you want to do, and if you think it's a bit too much, you can cut some scenes or so.

Post Reply

Who is online

Users browsing this forum: No registered users