LayeredImage 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
User avatar
runs
Regular
Posts: 41
Joined: Mon Nov 28, 2011 12:31 pm
Location: Spain
Contact:

LayeredImage Help

#1 Post by runs »

Hi guys,

I have a character with a head with a lot of facial expressions and a body (dresses). I've used Layered Image to make the whole character image.

I have some few questions:

- I do not use a base, only head + body. I thinks is not necessary.
- The 'pos' is refered to what? the base layer? the screen? I do not understand how to positionate the two parts.
- How the layers are stacked in one show sentence? In their call order?


In my case, would it be better to use 'Composite' instead of?


Thanks.

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: LayeredImage Help

#2 Post by mitoky »

It depens how exactly your files are. So basially only a head + the body? (also more than one head etc?)

Usually you dont need to position anything if you save the layers "as they are" overlapping and in same image size. Cropping isnt necsassary for small parts, so simply leave it as it is.

Usually images are called by imagename + attributes, so the same goes here. Example:

Code: Select all

layeredimage eileen:
    group head:
        attribute head_1 default:
        "images/xxx.png"
 
        attribute head_2:
        "images/xxx.png"
        
    group body:
        attribute body_1 default:
            "images/xxx.png"
 
        attribute body_2:
            "images/xxx.png"
            
    group face:
        attribute expression_1 default:
            "images/xxx.png"
            
        attribute expression_2:
            "images/xxx.png"     
Things of the same kind go into the same group and the group name itself doenst matters for calling the image.

Either way, back to calling things. If we go with this example the way we would call the image would be:
eileen head body expression

eileen is the image name.
for head we can insert: head_1 or head_2
for body we can insert: body_1 or body_2
for expression we can insert: expression_1 or expression_2

So if you want eileen's second head, second body and first expressions we do:

Code: Select all

show eileen head_2 body_2 expression_1
Additionally you might have noticed that some attributes have "default." Thats to ensure that no layer gets forgotten when calling an image (since it would be missing). So when something isnt stated (like no head) it will use the default one. So if we want to call eileen's first head, body and expression, we can simply too just say "show eileen" too based on our example.

Also, from what i am aware, the order ofthe attributes doenst matters. Its only important that the image name is first. So after "eileen" everything else can be in a random order.
I hope i could explain it well, if not feel free to ask!

User avatar
runs
Regular
Posts: 41
Joined: Mon Nov 28, 2011 12:31 pm
Location: Spain
Contact:

Re: LayeredImage Help

#3 Post by runs »

Thanks!

But know I have a problem. When paste body and head (even when overlap) Renpy shows a one-pixel line, cutting the composition. :(
I tested and it is cause of apply a scale to images.

User avatar
runs
Regular
Posts: 41
Joined: Mon Nov 28, 2011 12:31 pm
Location: Spain
Contact:

Re: LayeredImage Help

#4 Post by runs »

Well, I 've solved it applying another sightly factorscale.

Post Reply

Who is online

Users browsing this forum: Google [Bot]