(Solved)Defined as image side image in the define character

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
agl
Regular
Posts: 54
Joined: Tue Jul 19, 2016 5:09 am
Contact:

(Solved)Defined as image side image in the define character

#1 Post by agl » Wed Sep 14, 2016 11:23 pm

Hello. I need to define character with side image. Side image is composite. The problem is that image displayed at upper-left corner instead of down-left. yalign not working for some reason.

Code: Select all

init:
    image hero = im.Composite( (200, 200),
    (0, 0), "images/sprites/character/body.png",
    (0, 0), "images/sprites/character/e-norm.png",
    (0, 0), "images/sprites/character/b-norm.png",
    (0, 0), "images/sprites/character/l-norm.png" )

    define pov = Character ("hero_name", color="#548B54", window_left_padding=210, who_drop_shadow=[(1, 1)],   show_side_image = "hero", yalign=1.0)


If i define image file, not composite, all displayed correctly.

Code: Select all

init:
   define pov = Character ("hero_name", color="#548B54", window_left_padding=210, who_drop_shadow=[(1, 1)], show_side_image = Image("hero.png", yalign=1.0))
If i define not composite, simple image

Code: Select all

    image hero = "hero.png"
    define pov = Character ("hero_name", color="#548B54", window_left_padding=210, who_drop_shadow=[(1, 1)],   show_side_image = "hero", yalign=1.0)
it is also not displayed correctly.
Last edited by agl on Thu Sep 15, 2016 3:28 am, edited 5 times in total.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1348
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: im.composite side image at the character define

#2 Post by namastaii » Wed Sep 14, 2016 11:58 pm

Try taking away the yalign and change the numbers (0, 0) on the composite itself to where you want it on the screen. The second 0 is the y-axis so the higher the number that is, the lower it will go on the screen.

agl
Regular
Posts: 54
Joined: Tue Jul 19, 2016 5:09 am
Contact:

Re: im.composite side image at the character define

#3 Post by agl » Thu Sep 15, 2016 12:26 am

Change this number is cut the image. Of couse i can compose image as

Code: Select all

    image hero = im.Composite( (200, 600),
    (0, 400), "images/sprites/character/body.png",
    (0, 400), "images/sprites/character/e-norm.png",
    (0, 400), "images/sprites/character/b-norm.png",
    (0, 400), "images/sprites/character/l-norm.png" )
But it looks very ugly and can be problem with images above.

Also latest experments shows that xalign and yalign in the caharacter define works not at image, but at whole text at say window. But, as i say earier, if i define image file all displayed correctly.

agl
Regular
Posts: 54
Joined: Tue Jul 19, 2016 5:09 am
Contact:

Re: im.composite side image at the character define

#4 Post by agl » Thu Sep 15, 2016 12:40 am

if i try
show hero at Position( xalign=0.5, yalign=0.5)
it also showing correctly. I suspect that the problem with define string.

agl
Regular
Posts: 54
Joined: Tue Jul 19, 2016 5:09 am
Contact:

Re: im.composite side image at the character define

#5 Post by agl » Thu Sep 15, 2016 12:54 am

If i define not composite, simple image

Code: Select all

    image hero = "hero.png"
    define pov = Character ("hero_name", color="#548B54", window_left_padding=210, who_drop_shadow=[(1, 1)],   show_side_image = "hero", yalign=1.0)
it is also not displayed correctly.

agl
Regular
Posts: 54
Joined: Tue Jul 19, 2016 5:09 am
Contact:

Re: Defined as "image" side image in the define character

#6 Post by agl » Thu Sep 15, 2016 3:27 am

Solved.

Code: Select all

init:
    image hero = im.Composite( (200, 200),
    (0, 0), "images/sprites/character/body.png",
    (0, 0), "images/sprites/character/e-norm.png",
    (0, 0), "images/sprites/character/b-norm.png",
    (0, 0), "images/sprites/character/l-norm.png",
    yalign = 1.0 )

Post Reply

Who is online

Users browsing this forum: Google [Bot]