I give, I need help making the font size work.

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
nhguy03276
Regular
Posts: 41
Joined: Thu Jan 29, 2015 12:48 pm
Contact:

I give, I need help making the font size work.

#1 Post by nhguy03276 » Sun Apr 12, 2015 8:01 pm

Had to re-write a bunch of hackjob code into a different form of hackjob code... and after several hours I now have 90% of it working. I just for the life of me, can't make the font size smaller in the following code. Everything I try ends up with a syntax error, but I'm sure it's a simple comma in the wrong spot kind of thing. If anyone can help, I'd be most thankful. It's for a status bar that sits at the top of the screen.

Code: Select all

screen status_bar:     
       frame: 
           hbox :
                
              if STM < 6:
               $ day_mood = "Bad"
               $ day_mood_image = "props/m_bad.png"
              elif STM < 12:
               $ day_mood = "Meh"
               $ day_mood_image = "props/m_meh.png"
              elif STM < 18:
               $ day_mood = "Ok"
               $ day_mood_image = "props/m_ok.png"
              elif STM < 24:
               $ day_mood = "Good"
               $ day_mood_image = "props/m_good.png"
              else:
               $ day_mood = "Great"
               $ day_mood_image = "props/m_great.png"  
              text(" Mood:[STM] [day_mood] ") 
              image day_mood_image
              
              text  ("   Copper pieces :[cp]" )
              if p_hunger < 6:
                  $ stat_hunger = "Very Hungry"
              elif p_hunger < 11:
                  $ stat_hunger = "Hungry"
              elif p_hunger < 16:
                  $ stat_hunger = "Snacky"
              elif p_hunger < 24:
                  $ stat_hunger = "Satisfied"
              else:
                  $ stat_hunger = "Full"
              text ( "   Hunger: [p_hunger] [stat_hunger]")
              text ( "  Time: [p_time]:00")
              text ("   Date: [date][year]")
              




User avatar
deliciumartis
Regular
Posts: 30
Joined: Mon Feb 09, 2015 11:32 am
Location: shadowland
Contact:

Re: I give, I need help making the font size work.

#2 Post by deliciumartis » Sun Apr 12, 2015 8:18 pm

Did you try:{size=12}Your text{/size}
"What bothers me is, nothin' does."
--The dixie flatline

nhguy03276
Regular
Posts: 41
Joined: Thu Jan 29, 2015 12:48 pm
Contact:

Re: I give, I need help making the font size work.

#3 Post by nhguy03276 » Sun Apr 12, 2015 8:46 pm

deliciumartis wrote:Did you try:{size=12}Your text{/size}

Well... variations there of... I don't think I got that exact combo. but it's working now, Thank you.

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: I give, I need help making the font size work.

#4 Post by philat » Tue Apr 14, 2015 1:04 pm

That's a rather inefficient way of doing what you want, since you'd have to write out the text tag for each string separately.

Code: Select all

screen status_bar:
    frame:
        style_group "status_bar"
        # the rest of your screen

init:
    style status_bar_text is text:
        size 12

nhguy03276
Regular
Posts: 41
Joined: Thu Jan 29, 2015 12:48 pm
Contact:

Re: I give, I need help making the font size work.

#5 Post by nhguy03276 » Wed Apr 15, 2015 4:19 pm

philat wrote:That's a rather inefficient way of doing what you want, since you'd have to write out the text tag for each string separately.

Code: Select all

screen status_bar:
    frame:
        style_group "status_bar"
        # the rest of your screen

init:
    style status_bar_text is text:
        size 12

This is good, except assumes all text within the bar is going to be the same size.

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: I give, I need help making the font size work.

#6 Post by philat » Wed Apr 15, 2015 4:56 pm

True. If you need to particularly change just one part of the string to a different style, text tags are useful. I assumed, since OP only asked for a smaller font, that that wasn't the case. FWIW, you can also apply styles to particular lines on the screen, which may still come out as more efficient than using text tags in general.

Code: Select all

text "blah blah" size 12
text "blah blah blah" style "my_text"

Post Reply

Who is online

Users browsing this forum: _ticlock_