Centered doesn't center? o_o

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
Viniciuskk
Regular
Posts: 136
Joined: Thu Dec 06, 2012 10:16 pm
Projects: Spring Breeze
Organization: Homeroom Interactive
Location: Brazil
Contact:

Centered doesn't center? o_o

#1 Post by Viniciuskk » Mon Apr 03, 2017 12:15 am

Heya so... I just bought a new computer and installed Ren'py on it. Upon opening my projects, I noticed all of the text that was previously centered with the simple "centered" command is now sitting on the bottom left side of the screen:

https://puu.sh/v7xX3/32741b7da7.png

However, If I open the same project file on the old computer, it looks normal o_O (probably because Ren'py isn't updated on it?) I even tried the following, which I found on another thread here, but it didn't work either:

Code: Select all

    $ centered = Character(None,
                            what_size=20,
                            what_outlines=[(3, "#000000", 0, 0)],
                            what_layout="subtitle",
                            what_xalign=0.5,
                            what_text_align=0.5,
                            window_background=None,
                            window_yminimum=0,
                            window_xfill=False,
                            window_xalign=0.5,
                            window_yalign=0.5)
    
I also tried changing the xalign or yalign values, but nothing happens! It still sits on the bottom left side. Any ideas?

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Centered doesn't center? o_o

#2 Post by indoneko » Mon Apr 03, 2017 1:25 am

How did you code it? Can you attach your script here?
I guess that you changed/modified the "centered" transform into something else in the new project, or accidentally included a script file that contains something that override the default "centered" transform.
My avatar is courtesy of Mellanthe

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

Re: Centered doesn't center? o_o

#3 Post by Imperf3kt » Mon Apr 03, 2017 4:00 am

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

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Centered doesn't center? o_o

#4 Post by trooper6 » Mon Apr 03, 2017 7:36 am

I think the xfill should be true and not false. Try that out at least.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Viniciuskk
Regular
Posts: 136
Joined: Thu Dec 06, 2012 10:16 pm
Projects: Spring Breeze
Organization: Homeroom Interactive
Location: Brazil
Contact:

Re: Centered doesn't center? o_o

#5 Post by Viniciuskk » Mon Apr 03, 2017 8:53 am

trooper6 wrote:I think the xfill should be true and not false. Try that out at least.
Nothing changed
Imperf3kt wrote:Have you tried truecenter yet?
https://puu.sh/v7RHF/dcfa863656.jpg
indoneko wrote:How did you code it? Can you attach your script here?
I guess that you changed/modified the "centered" transform into something else in the new project, or accidentally included a script file that contains something that override the default "centered" transform.
centered "At the end of the year, Ayumi moves back to Tokyo to live with her family."
I don't even know where the default centered is x_x I swear I didn't open any ren'py files besides the script ones :/

User avatar
fullmontis
Regular
Posts: 129
Joined: Sun May 05, 2013 8:03 am
Deviantart: fullmontis
itch: fullmontis
Location: Italy
Contact:

Re: Centered doesn't center? o_o

#6 Post by fullmontis » Mon Apr 03, 2017 9:07 am

Maybe this? Works for me over here.

Code: Select all

    $ centered = Character(None,
                            what_size=20,
                            what_outlines=[(3, "#000000", 0, 0)],
                            what_xalign=0.5,
                            what_text_align=0.5,
                            window_background=None,
                            window_xfill=True,
                            window_yfill=True,
                            window_xalign=0.5,
                            window_yalign=0.5)

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Centered doesn't center? o_o

#7 Post by indoneko » Mon Apr 03, 2017 9:35 am

instead of using
$ centered =

try use

define centered =


And just in case you haven't done it, put all of your character declaration at the very beginning of your script, before the label start:
My avatar is courtesy of Mellanthe

User avatar
Viniciuskk
Regular
Posts: 136
Joined: Thu Dec 06, 2012 10:16 pm
Projects: Spring Breeze
Organization: Homeroom Interactive
Location: Brazil
Contact:

Re: Centered doesn't center? o_o

#8 Post by Viniciuskk » Mon Apr 03, 2017 11:14 am

fullmontis wrote:Maybe this? Works for me over here.

Code: Select all

    $ centered = Character(None,
                            what_size=20,
                            what_outlines=[(3, "#000000", 0, 0)],
                            what_xalign=0.5,
                            what_text_align=0.5,
                            window_background=None,
                            window_xfill=True,
                            window_yfill=True,
                            window_xalign=0.5,
                            window_yalign=0.5)
The text is now on top of the window o_o
https://puu.sh/v7Yer/31622b944f.png
indoneko wrote:instead of using
$ centered =

try use

define centered =


And just in case you haven't done it, put all of your character declaration at the very beginning of your script, before the label start:
I did. Nothing changed.

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Centered doesn't center? o_o

#9 Post by indoneko » Mon Apr 03, 2017 11:58 am

Try this step by step troubleshooting :
1. Start a new project -let's call it project B- using the new Renpy in your new PC. Make sure you're using the same resolution as your troublesome project. Try adding several lines of dialogue using centered. Did it show at the right position?
- If it failed, then something is wrong with your renpy.
- If it worked, go to step 2.

2. Delete the screens.rpy, gui.rpy and options.rpy from project B.
Go to your troublesome old project in the same PC (we'll call it project A), and copy screens.rpy, gui.rpy and options.rpy to project B. Then launch project B and try showing dialogue with centered again.
- If it failed, then either something is wrong with one of those configuration files, or you need to go to step 3.
- If it works, go to step 3.

3. Go to project A directory, and open script.rpy
Copy everything before the label start, and paste it into the script.rpy in project B.
Then test showing dialogue with centered again.
- If it failed, then something is wrong with one of your declaration. For example, maybe a certain info screen is conflicting with your say screen or contains something that is no longer supported in new Renpy.
- If it works, then the error is somewhere in the rest of your script.rpy (or in case you have multiple files for your main script, then it's in one of them). You might want to copy it block by block while testing it to check which one actually causing the problem.

It'll be easier for us to see what the problem is if you could attach your script(s) here.
Just trim it first so that you can actually replicate the error with the minimum lines of code.
My avatar is courtesy of Mellanthe

User avatar
Viniciuskk
Regular
Posts: 136
Joined: Thu Dec 06, 2012 10:16 pm
Projects: Spring Breeze
Organization: Homeroom Interactive
Location: Brazil
Contact:

Re: Centered doesn't center? o_o

#10 Post by Viniciuskk » Mon Apr 03, 2017 1:46 pm

I'm going to cry. I copied EVERY .rpy file and tweaked it so it could run in project B --- centered did its job just fine.

Then I proceeded to copy EVERYTHING into project B, essentially making it a copy of A. Centered made the text appear on the bottom.

God.... *cries in agony*

What files do you want?

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Centered doesn't center? o_o

#11 Post by indoneko » Mon Apr 03, 2017 6:43 pm

How big is your project? (just the script+asset in the game directory, without the build)
If you can upload the full project somewhere, I can play-test and clean it up for you.
Or at least attach script.rpy (and other rpy files, if you have more than one file for the script) from your game directory here to let others check the errors for you.
My avatar is courtesy of Mellanthe

User avatar
Viniciuskk
Regular
Posts: 136
Joined: Thu Dec 06, 2012 10:16 pm
Projects: Spring Breeze
Organization: Homeroom Interactive
Location: Brazil
Contact:

Re: Centered doesn't center? o_o

#12 Post by Viniciuskk » Mon Apr 03, 2017 11:41 pm

I sent it to you via message.

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Centered doesn't center? o_o

#13 Post by indoneko » Wed Apr 05, 2017 6:14 am

Found the bug. Check your PM.
My avatar is courtesy of Mellanthe

Post Reply

Who is online

Users browsing this forum: No registered users