Strange positioning problem

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
Newbie
Posts: 23
Joined: Thu Jan 07, 2016 12:30 pm
Contact:

Strange positioning problem

#1 Post by Moonspeck » Sat Jan 13, 2018 2:53 pm

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!

User avatar
mitoky
Regular
Posts: 196
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, CrossDol
Tumblr: mitokysvnstudio
Deviantart: mitoky
Contact:

Re: Strange positioning problem

#2 Post by mitoky » 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)
Image

[Logo Commissions - OPEN] || Wish to support or tip me? Buy Me a Coffee!

User avatar
IrinaLazareva
Regular
Posts: 175
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy, Эра Тёмных Небес
Organization: IKG
Location: St.Petersburg, Russia
Contact:

Re: Strange positioning problem

#3 Post by IrinaLazareva » 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
R I S E

User avatar
Moonspeck
Newbie
Posts: 23
Joined: Thu Jan 07, 2016 12:30 pm
Contact:

Re: Strange positioning problem

#4 Post by Moonspeck » Sat Jan 13, 2018 4:03 pm

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: 1099
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
Location: Italy
Contact:

Re: Strange positioning problem

#5 Post by xavimat » Sat Jan 13, 2018 4:15 pm

Moonspeck wrote:
Sat Jan 13, 2018 4:03 pm
Do 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.
Cops&Robbers A two-player experiment
Fear&Love Why can’t we simply express our feelings? Why am I afraid to say ‘I love you’?
unknown [Sci-Fi - mystery - computer]
Honest Critique (Avatar made with Chibi Maker by ~gen8)

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

Re: Strange positioning problem

#6 Post by Imperf3kt » Sat Jan 13, 2018 6:11 pm

xavimat wrote:
Sat Jan 13, 2018 4:15 pm
Moonspeck wrote:
Sat Jan 13, 2018 4:03 pm
Do 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.
Image

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

User avatar
Moonspeck
Newbie
Posts: 23
Joined: Thu Jan 07, 2016 12:30 pm
Contact:

Re: Strange positioning problem

#7 Post by Moonspeck » Tue Jan 16, 2018 1:12 pm

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 pm
Do 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: Amie