Having trouble showing images at left and right

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
thebrm
Newbie
Posts: 2
Joined: Fri Apr 12, 2019 8:28 pm
Contact:

Having trouble showing images at left and right

#1 Post by thebrm »

Pretty new to dealing with sprites with the games I am working on, usually we just had one CG image with text on top but a new project has the standard images over backgrounds. The issue is that the sprites are the same resolution as the scenes so when I do a

show mer neutral at right

it will always show centered.

I was able to get around this by manually putting in the following:
xanchor 1.0
xpos 1.4

but I will have to do it every time I show the image. Is there a way to redefine the right and left transforms so that they work directly with the sprites as I have them?

User avatar
Sunlit-Dreamer
Veteran
Posts: 400
Joined: Thu Sep 22, 2011 12:41 am
Completed: NaNo2015 Bedtime, NaNo2016 The Doll and the Spider, NaNo2017 What's Your Name?, NaNo2018 Painting Your Skin, NaNo2019 Home's Embrace, NaNo2020 Molly
Projects: NaNo2021 Cracked Moonstone
Deviantart: Sunlit-Dreamer
itch: Sunlit-Dreamer
Location: Lala land~
Contact:

Re: Having trouble showing images at left and right

#2 Post by Sunlit-Dreamer »

There is, you simply have to define them before the start label. Here's a couple examples from my own.

Code: Select all

transform my_left:
    linear 1.0 xalign 0.25
    
transform my_right:
    linear 1.0 xalign 0.75
ImageImageImageImage

thebrm
Newbie
Posts: 2
Joined: Fri Apr 12, 2019 8:28 pm
Contact:

Re: Having trouble showing images at left and right

#3 Post by thebrm »

Ok, thanks. So I tried that my issue right now is that when I do my own transform I get two different problems:

The first one is that when I define my transform as such:

transform right1:
linear 1.0 xanchor 1.0 xpos 1.4

and I later call it in the script:

show mer neutral at right1

the character doesn't show up.

But when I do this directly in the script:

show mer neutral:
linear 2.0 xanchor 1.0 xpos 1.4

it works perfectly, I saw some blocks had something like

onshow:

But when I do this:

transform right1:
onshow:
linear 1.0 xanchor 1.0 xpos 1.4

I get an error.

User avatar
Sunlit-Dreamer
Veteran
Posts: 400
Joined: Thu Sep 22, 2011 12:41 am
Completed: NaNo2015 Bedtime, NaNo2016 The Doll and the Spider, NaNo2017 What's Your Name?, NaNo2018 Painting Your Skin, NaNo2019 Home's Embrace, NaNo2020 Molly
Projects: NaNo2021 Cracked Moonstone
Deviantart: Sunlit-Dreamer
itch: Sunlit-Dreamer
Location: Lala land~
Contact:

Re: Having trouble showing images at left and right

#4 Post by Sunlit-Dreamer »

Ahh yes, I had a similar problem last month. It's a simple fix.

Code: Select all

show mer neutral with moveinbottom:
	xalign 1.0
(Please pretend there's only one indent.)

There's also moveinleft and moveinright. (And even moveintop if you have something like a bird or want someone to fall.) The location you pick is where the sprite will appear out of. You'll have to put in the position every time of course.

And to go along with the moveins, there are also moveouts.

Code: Select all

hide mer neutral with moveoutbottom
ImageImageImageImage

Post Reply

Who is online

Users browsing this forum: No registered users