The X-axis also shifts the Y-axis.

Mr. TurTur

Newbie
Jun 12, 2020
98
86
The X-axis also shifts the Y-axis.

Hey there :), I have a problem with my layered images.
I cannot place the images correctly. When I try to move them on the X-axis, they automatically also slide down. If I don't specify xpos or xalign, they are displayed correctly.
The amount by which they slide down does not depend on the x-value I enter, but on the size of the image itself.

So it always stays on the same y-axis.


Screenshot 2025-02-13 200711.png Screenshot 2025-02-13 200627.png

I can correct the position with a ypos and it does not affect the x-axis.

It doesnt happen if i use
at left
but having to add it every time would be annoying


This is how I have defined the layered images

Code:
layeredimage helen:
    at Transform(zoom=0.35)
   
    group base:
        attribute a default:
            "helen_a_rumpf"

    group pants:
        attribute basepants default:
            "helen_a_basepants"
        attribute nudepants:
        #... etc

and this is the instruction to display them

Code:
show helen bored brapants nudeshirt nudepose:
        xpos -400

    h "Oh hello, so you already woke up."
Thank you it advance :)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
11,423
17,387
The X-axis also shifts the Y-axis.
Hmm...

Note 1: tested with 7.5.3 and 8.3.0
Note 2: I tested with a layered image and a basic image, I'll just present the code with the second for clarity.
Note 3: Ren'Py is not fullscreen, I hate fullscreen, so the measure have to be a bit compensated.


With this:
Python:
image testImage = "whatever image you want/have"
label start:

    show testImage:
        xpos -100
    "next"
    show testImage
    "next"
    show testImage:
        xpos 100
    "next"
    show testImage:
        ypos 300
    "END"
The image first image will be -100x0, the second image will be at the same position, the third image at 100x0, and the fourth one is at 100x300.
This is the expected behavior.
Each image is positioned according to its given position, with y being initially at 0 since there's no value provided. Then the image is moved each time another value is gave, either for xpos or ypos, keeping the previous value when it's not provided.

While this:
Python:
image testImage = "whatever image you want/have"
label start:

    show testImage
    "next"
    show testImage:
        xpos -100
    "next"
    show testImage:
        xpos 100
    "next"
    show testImage:
        ypos 300
    "END"
Is a bit more weird, because it clearly change the referential.
The first image being displayed at ~0.45x1.0, and not 0.5x1.0 like one should expect. Then the image are moved according to this with the second image disappearing while having a width of 140pixels, the third image being at 25x1.0 instead of the 100x1.0 expected, and the last one being at 100x-270.

What mean that for Ren'Py, x0 is became around -70, and y0 around -250. Despite what it looks, there's a bit of rationality in this behavior:
The first image is not centered on the x-axis because the formula seem to be screenWidth/2 - imageWidth, instead of screenWidth/2 - imageWidth/2. x0 is then shifted by imageWidth/2 pixels to the left.
As for y0, but it seem to be shifted by the height of the sprite (557 pixels). This being probably due to the 1.0 thing.

Strictly speaking this change of referential is a bug. As I said, the formula for centering on the x axis is wrong, and y should screenHeight - imageHeight, instead of what looks like to be just screenHeight.

But at no time did I encountered the issue you have. Nor did this issue can be explained shift in the y axis that you encounter.
 

osanaiko

Engaged Member
Modder
Jul 4, 2017
2,788
5,196
That is weird. Seems like something to report on the Lemmasoft forum and see if you can get some feedback from one of the core team like Renpytom or Enelai
 

peterppp

Erect Member
Donor
Mar 5, 2020
910
1,735
Code:
show helen bored brapants nudeshirt nudepose:
        xpos -400

    h "Oh hello, so you already woke up."
what if you try "show helen bored brapants nudeshirt nudepose" with less attributes? i'm thinking one of the attributes adds something like a transparent image somewhere which messes with the reference. i would start with as few attributes as possible to see if the problem occurs. if it doesn't, add attributes to see when it does
 
  • Like
Reactions: anne O'nymous