Showing and Positioning Side 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
TwylaMarie
Newbie
Posts: 1
Joined: Mon May 07, 2018 4:18 pm
Contact:

Showing and Positioning Side Images

#1 Post by TwylaMarie » Mon May 07, 2018 5:57 pm

Hi there. I'm very new to Ren'Py, and I'm trying to figure out how to position side images. I've gotten the image to actually show up by using this code:
Screen Shot 2018-05-07 at 4.54.59 PM.png
The image overlaps the text, so I adjusted the padding. It fixes the overlap, but it does so by moving the text instead of the image. For all I know, that's what it's supposed to do, but I'd rather move the image itself further to the left.

Here's what it looks like with the number set to 170:
Screen Shot 2018-05-07 at 4.51.38 PM.png
And here it is set to 400:
Screen Shot 2018-05-07 at 4.50.51 PM.png
(I'm sorry about the ugly stick figures. I wanted to figure out how Ren'Py actually works before putting effort into actual sprites).

Any advice would be greatly appreciated.

User avatar
Qlara
Regular
Posts: 80
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

Re: Showing and Positioning Side Images

#2 Post by Qlara » Mon May 07, 2018 9:16 pm

'padding' is free space within an element, in this case 'window', so if you increase 'window_left_padding', all elements inside the window move to the right.
To align your sprite with the left border you could delete your 'window_left_padding' and use

Code: Select all

image side Testsprite = "side_testspritething4"
    xalign 0.0 
    #and more position— or zoom parameters here
You can position your text with 'what_xpos = 100' (or whatever value) inside the brackets of your t definition and the character name position with 'who_ypos = ...'

User avatar
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: Showing and Positioning Side Images

#3 Post by xavimat » Tue May 08, 2018 11:19 am

I'm not sure Qlara's code will work. SideImage is already positioned at xalign 0.0, and the colon is missing.
Your image is not to the left, I guess, because it contains transparent space at the left of it. If so, crop it.
If not, you can move it to the left with xoffset:

Code: Select all

image side Testsprite:
    "side_testspritething4"
    xoffset -100
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Post Reply

Who is online

Users browsing this forum: _ticlock_