Strange positioning problem SOLVED

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
Moonspeck
Regular
Posts: 35
Joined: Thu Jan 07, 2016 12:30 pm
Projects: Sentimental Trickster, new BL fantasy dating sim
Organization: Lovenuts
itch: lazuli
Contact:

Strange positioning problem SOLVED

#1 Post by Moonspeck »

Hello,

I often move the camera around in my CGs to make them more dynamic, but when I try to transition from my defined "bottom_center" to either "top_center", "top_right" or "top_left", it doesn't move the camera with ease, it just jumps from one part of the picture to the other. On the other hand, transitions from "top_center", "top_right" or "top_left" to "bottom_center" work fine. Also, when I defined "almost_top_center" and used it instead "top_center", it worked too.

My transformations:

Code: Select all

transform top_right:
    xalign 1.0 yalign 0
transform top_center:
    xalign 0.5 yalign 0
transform top_left:
    xalign 0 yalign 0
transform bottom_center:
    xalign 0.5 yalign 1.0

transform almost_top_center:
    xalign 0.5 yalign 0.05

My game code:

Code: Select all

    scene cg shinya car closer at top_right
    with blink
    "TEXT 01"
    show cg shinya car closer:
        ease 0.5 top_center #WORKS FINE#
    "TEXT 02"
    show cg shinya car closer:
        ease 0.3 bottom_center #WORKS FINE#
    "TEXT 03"
    show cg shinya car closer:
        ease 0.3 top_center #DOESN'T WORK, JUST SKIPS TO THIS PART#
        
#HOWEVER, THIS WORKS:#
    show cg shinya car closer:
        ease 0.3 almost_top_center
I'm very confused. I asked my friend (who's a programmer) and he said it might be something connected to absolute and relative values, but we couldn't find how they work in Ren'Py. I'd really appreciate any help with this problem, thank you!
Last edited by Moonspeck on Wed Jan 17, 2018 3:07 pm, edited 1 time in total.

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Strange positioning problem

#2 Post by mitoky »

I dont know how to fix the problem, but does that problem also occur when you define the positions without transform? Like this:

Code: Select all

default bottom_center = Position(xalign=0.5, yalign=1.0)

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Strange positioning problem

#3 Post by IrinaLazareva »

try to change this:

Code: Select all

transform top_right:
    xalign 1.0 yalign 0
transform top_center:
    xalign 0.5 yalign 0
transform top_left:
    xalign 0 yalign 0
to

Code: Select all

transform top_right:
    xalign 1.0 yalign 0.0
transform top_center:
    xalign 0.5 yalign 0.0
transform top_left:
    xalign 0.0 yalign 0.0
also is allowed:

Code: Select all

    xalign .0 yalign .0

User avatar
Moonspeck
Regular
Posts: 35
Joined: Thu Jan 07, 2016 12:30 pm
Projects: Sentimental Trickster, new BL fantasy dating sim
Organization: Lovenuts
itch: lazuli
Contact:

Re: Strange positioning problem

#4 Post by Moonspeck »

IrinaLazareva wrote: Sat Jan 13, 2018 3:49 pm try to change this:

Code: Select all

transform top_right:
    xalign 1.0 yalign 0
transform top_center:
    xalign 0.5 yalign 0
transform top_left:
    xalign 0 yalign 0
to

Code: Select all

transform top_right:
    xalign 1.0 yalign 0.0
transform top_center:
    xalign 0.5 yalign 0.0
transform top_left:
    xalign 0.0 yalign 0.0
also is allowed:

Code: Select all

    xalign .0 yalign .0
It worked, thank you very much! :) Do you by any chance know why that happens? It'll keep bugging me^^''
mitoky wrote: Sat Jan 13, 2018 3:22 pm I dont know how to fix the problem, but does that problem also occur when you define the positions without transform? Like this:

Code: Select all

default bottom_center = Position(xalign=0.5, yalign=1.0)
Thank you, I'll keep this second method in mind!

User avatar
xavimat
Eileen-Class Veteran
Posts: 1460
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: Strange positioning problem

#5 Post by xavimat »

Moonspeck wrote: Sat Jan 13, 2018 4:03 pmDo you by any chance know why that happens? It'll keep bugging me^^''
- In position properties, integer numbers mean absolute positions: number of pixels from the top left corner.
- float numbers are relative positions respect the width or height of the screen.
xpos 30 -> 30 pixels from the left.
xpos 0.3 -> 30% of the screen from the left.
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)

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

Re: Strange positioning problem

#6 Post by Imperf3kt »

xavimat wrote: Sat Jan 13, 2018 4:15 pm
Moonspeck wrote: Sat Jan 13, 2018 4:03 pmDo you by any chance know why that happens? It'll keep bugging me^^''
- In position properties, integer numbers mean absolute positions: number of pixels from the top left corner.
- float numbers are relative positions respect the width or height of the screen.
xpos 30 -> 30 pixels from the left.
xpos 0.3 -> 30% of the screen from the left.
To further elaborate on this, your issue was caused by trying to use both.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Moonspeck
Regular
Posts: 35
Joined: Thu Jan 07, 2016 12:30 pm
Projects: Sentimental Trickster, new BL fantasy dating sim
Organization: Lovenuts
itch: lazuli
Contact:

Re: Strange positioning problem

#7 Post by Moonspeck »

Imperf3kt wrote: Sat Jan 13, 2018 6:11 pm
xavimat wrote: Sat Jan 13, 2018 4:15 pm
Moonspeck wrote: Sat Jan 13, 2018 4:03 pmDo you by any chance know why that happens? It'll keep bugging me^^''
- In position properties, integer numbers mean absolute positions: number of pixels from the top left corner.
- float numbers are relative positions respect the width or height of the screen.
xpos 30 -> 30 pixels from the left.
xpos 0.3 -> 30% of the screen from the left.
To further elaborate on this, your issue was caused by trying to use both.
Okay, I think I get it, thank you both for explaining it to me :)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]