Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Sat May 18, 2013 5:28 pm

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Mar 25, 2012 2:09 am 
Regular

Joined: Tue Mar 22, 2011 2:36 pm
Posts: 72
Here is my code:
Code:
init:
   $ left_text_normal = Character(None,
       window_background = Frame("gfx/textbox01.png", 0, 0),
       window_xfill=False,
       window_xminimum=540,
       window_yminimum=225,
       window_xalign=0.15,
       window_yalign=0.8,
       window_left_padding = 75,
       window_right_padding = 75,
       window_top_padding = 65,
       window_bottom_padding = 65,
       what_color="#000000",
       what_size=16,
       what_xpos = 0.5,
       what_xmaximum =400)
   $ right_text_normal = Character(None,
       window_background = Frame(im.Flip("gfx/textbox01.png", horizontal=True), 0, 0),
       window_xfill=False,
       window_xminimum=540,
       window_yminimum=225,
       window_xalign=0.85,
       window_yalign=0.8,
       window_left_padding = 75,
       window_right_padding = 75,
       window_top_padding = 65,
       window_bottom_padding = 65,
       what_color="#000000",
       what_size=16,
       what_xpos = 0.5,
       what_xmaximum =400)
label start:
    left_text_normal "Text test. Text test. Text test. Text test. Text test. Text test. Text test. Text test. Text test. Text test. Text test. Text test. Text test. "
    right_text_normal "Text test. Text test."
    return

Both text can't place in the center of the textbox.
Attachment:
text1.jpg
text1.jpg [ 46.37 KiB | Viewed 159 times ]

Attachment:
text2.jpg
text2.jpg [ 43.58 KiB | Viewed 159 times ]

There should be something wrong with what_xpos = 0.5,
I tried what_xalign = 0.5 but the text show same as what_xalign = 0.0

_________________
Image
.Traditional Chinese Site.
~Illustrator+Graphic/Web Designer~


Top
 Profile Send private message  
 
PostPosted: Sun Mar 25, 2012 4:18 pm 
Newbie

Joined: Sun Mar 18, 2012 5:41 pm
Posts: 6
I don't know why, but for some reason 'pos' in this case does not want to take in absolute values. So you have to define the integer value of the position you want it to fit in.

So you want half the window size, which for your case is x 270 and y 112. Remember, it is only taking integer values for the pixel alignment, so you can't have a number like 112.5.
You could write it out with xpos = 270, xanchor = 0.5, but xcenter = 270 does the same thing with one line.

I've commented out the padding, because it seems a bit odd... It doesn't seem to be padding the right places. Such as, window_xpadding = #, gives the same # value padding on both left and right side. However, for some reason the right padding does not seem to apply itself. Could be something with the defining window size. Also, could be the same reason why 'pos' isn't working properly for defining an absolute position inside the window. My guess is it might be something with how window max and min size has to also account for padding and margin.

Anyhow, you could just use what_xmaximum to define a pseudo padding. Although, technically it is just limiting the width of the text, but it'll still serve the same functionality if your end goal was to have the text to be dead center of the text bubble.

So something like this;
Code:
init:
    $ left_text_normal = Character(None,
    window_background = Frame("gfx/textbox01.png", 0, 0),
    window_xfill=False,
    window_xmaximum=540,
    window_xminimum=540,
    window_yminimum=225,
    window_ymaximum=225,
    window_xalign=0.15,
    window_yalign=0.8,
    #window_left_padding = 75,
    #window_right_padding = 75,
    #window_top_padding = 65,
    #window_bottom_padding = 65,
    what_color="#000000",
    what_size=16,
    what_xcenter = 270,
    what_ycenter = 112,
    what_xmaximum = 400
    )
    $ right_text_normal = Character(None,
    window_background = Frame(im.Flip("gfx/textbox01.png", horizontal=True), 0, 0),
    window_xfill=False,
    window_xminimum=540,
    window_xmaximum = 540,
    window_yminimum=225,
    window_ymaximum=225,
    window_xalign=0.85,
    window_yalign=0.8,
    #window_left_padding = 75,
    #window_right_padding = 75,
    #window_top_padding = 65,
    #window_bottom_padding = 65,
    what_color="#000000",
    what_size=16,
    what_xcenter = 270,
    what_ycenter = 112,
    what_xmaximum = 400
    )

label start:
    left_text_normal "Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text. Test text."
    right_text_normal "Test text."
    return


Attachments:
renpy 2012-03-25 16-38-33-10.png [8.6 KiB]
Not downloaded yet
renpy 2012-03-25 16-38-32-31.png [11.17 KiB]
Not downloaded yet
Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: MondayMagic


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group