Artist gives me differently sized Character sprites. How to use them together? HELP

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
ramondev
Newbie
Posts: 2
Joined: Fri Aug 11, 2017 6:49 pm
Contact:

Artist gives me differently sized Character sprites. How to use them together? HELP

#1 Post by ramondev »

Good day everyone. I'm here with a straightforward question.

My artist is giving me different sprite sizes (PNG FILES) for each character. So let's say a character is 1000x1000 whilst the other one is 850x1000. This, when I use the following code, gives me undesirable results:

Code: Select all

 #Cold Eyes, Cold Mouth 1 
    image Taka coco1 = LiveComposite(
        (291,618),
        (0,0),"char/taka/body.png",
        (0,0),"char/taka/Cold/cold_0000s_0000_eyebrows.png",
        (0,0),"Taka Eyes Cold",
        (0,0),WhileSpeaking("t","Taka Mouth Cold","char/taka/Cold/cold_0000s_0004_mouth.png"),
        (0,0),ConditionSwitch(
            "t_blush == True","char/taka/blush.png",
            "t_blush == False","blank.png"))

Code: Select all

image Taka Eyes Cold:
        "char/taka/Cold/cold_0000s_0001_eyes.png"
        choice:
            2.0
        choice:
            3.1
        choice:
            4.2
        choice:
            3.3
        "char/taka/eyesclosed.png"
        .13
        repeat

Code: Select all

image Taka Mouth Cold:
        "char/taka/Cold/cold_0000s_0002_mouth.png"
        .2
        "char/taka/Cold/cold_0000s_0003_mouth.png"
        .2
        "char/taka/Cold/cold_0000s_0004_mouth.png"
        .2
        repeat
Of course, one of those goes for each character/emotion.

So, since I am receiving differently sized sprites from the artist, some of the sprites float, some sprites are not in the right position at all.

How to fix this? I can't find any resources on the matter.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Artist gives me differently sized Character sprites. How to use them together? HELP

#2 Post by Remix »

The absolutely easiest way is to just download gimp.org or (ms.paint.can.do.png.nowadays.maybe.org.or.something) and throw the images in there on a new canvas at the size you want... or ask your artist to size them all the same...

Failing that:
Programmatically, for Ren'py to recognize an image size (even without rescaling it) it mostly has to have put the image onto a pygame surface (which takes time)...

img_surf = im.cache.get(im.image("some_image.png"))
img_width, img_height = img_surf.get_size()

... every time you run it (without the re-scaling the image to fit your requirements bit that would come afterwards) your readers/players are waiting 0.0n seconds...

Basically trying to say, fix the images before launching the game... do not ask the game to 'take-the-time' to fix the images on the fly
Frameworks & Scriptlets:

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Artist gives me differently sized Character sprites. How to use them together? HELP

#3 Post by Remix »

Apology if that sounded harsh... it truly is good advice though
Frameworks & Scriptlets:

ramondev
Newbie
Posts: 2
Joined: Fri Aug 11, 2017 6:49 pm
Contact:

Re: Artist gives me differently sized Character sprites. How to use them together? HELP

#4 Post by ramondev »

Remix wrote: Fri Aug 11, 2017 7:32 pm Apology if that sounded harsh... it truly is good advice though
Not harsh at all. Can you expand on your answer? I see you have a bit of code snippet but I am not sure how to apply the code.

Trust me, I want my artist to export CONSISTENT sizes. I am the programmer in this project, so I have no power over production.


I really appreciate it. You have no clue how frustrating this is.

Post Reply

Who is online

Users browsing this forum: decocloud