Display Image 500px to the right or left

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
neometalero
Regular
Posts: 75
Joined: Sun Oct 23, 2016 3:51 am
Deviantart: neometalero
Contact:

Display Image 500px to the right or left

#1 Post by neometalero » Sun Jun 17, 2018 10:50 pm

I need to display an image 500px to the right or left, depending on the scene.
I tried to use this code

Code: Select all

show efectUpRelacionMitad:
         xalign 500 yalign 0.0
but I dont see any changes
Any idea?
Working on Attack Helicopter Dating Simulator

Image

User avatar
Imperf3kt
Eileen-Class Veteran
Posts: 1760
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Display Image 500px to the right or left

#2 Post by Imperf3kt » Sun Jun 17, 2018 11:21 pm

Try adding an xanchor (half your game's width)
Image

Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
PyTom
Ren'Py Creator
Posts: 15202
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: Display Image 500px to the right or left

#3 Post by PyTom » Sun Jun 17, 2018 11:22 pm

Actually, use xpos rather than xalign. The xalign property only makes sense with fractional offsets, rather than whole numbers of pixels.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Andredron, mitoky