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 Wed Jun 19, 2013 11:16 am

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  [ 6 posts ] 
Author Message
PostPosted: Tue Aug 14, 2012 3:45 pm 
Eileen-Class Veteran
User avatar

Joined: Fri Mar 09, 2012 6:58 pm
Posts: 1173
Location: United States
Projects: Coming Out On Top
Trying to get a grasp on this, but it seems like the documentation is High Level, the cookbook tutorials are Medium Level, and I'm very Low Level in my comprehension.

At its simplest, you'd define a style like this? (in options.rpy)

Code:

init -2 python:
    style.newstyle=Style(style.default)
    style.newstyle.font="fonts/arial.ttf"
    style.newstyle.size=10


1) how do you apply "newstyle" for a big block of text in your game?

2) how do you apply it to all the text in a screen?

style

_________________
Coming Out On Top - An Adult B/B Game
Wordpress Tumblr Twitter FB


Top
 Profile Send private message  
 
PostPosted: Tue Aug 14, 2012 5:20 pm 
Eileen-Class Veteran
User avatar

Joined: Fri Mar 09, 2012 6:58 pm
Posts: 1173
Location: United States
Projects: Coming Out On Top
Ok, I can see that to change one line of text, you can use:

Code:
text "This is Newstyle." style "newstyle"


Just can't figure out how to do this for:

1) a big block of text (several paragraphs of text, one right after another)
2) an entire screen (i.e., help or credits)

_________________
Coming Out On Top - An Adult B/B Game
Wordpress Tumblr Twitter FB


Top
 Profile Send private message  
 
PostPosted: Tue Aug 14, 2012 6:18 pm 
Newbie
User avatar

Joined: Sun Oct 30, 2011 10:14 am
Posts: 18
Location: Austria
Projects: No title (freebie testgame)
Usually, I use this:
Code:
frame: (or vbox/hbox/whatever)
    style_group "newstyle"

    text "some text"
    text "some text"

This should work for everything in the frame.

In the following case, you can set another style just for the hbox.
Code:
frame: (or vbox/hbox/whatever)
    style_group "newstyle"

    text "some text"
    text "some text"

    hbox:
        style_group "otherstyle"

        text "other text"
        text "other text"

    text "some text"
    text "some text"

If you delete the line with style_group in the hbox, hbox will use "newstyle".

_________________
Image
work in progress.
script: 100% (~15k words), character art: 85%, cg art: 25%, bg: 83%, gui(design): 80%, gui(programming): 90%, music/sound: 10%


Top
 Profile Send private message  
 
PostPosted: Wed Aug 15, 2012 5:06 am 
Eileen-Class Veteran
User avatar

Joined: Fri Mar 09, 2012 6:58 pm
Posts: 1173
Location: United States
Projects: Coming Out On Top
Hmmm....for some reason that's not working in my script.

The text style remains the default font. "New style" only works is I do this:

Code:
text "This is Newstyle." style "newstyle"


It just ignores me if I use the code you used as an example.

Thanks for your help though...

_________________
Coming Out On Top - An Adult B/B Game
Wordpress Tumblr Twitter FB


Top
 Profile Send private message  
 
PostPosted: Wed Aug 15, 2012 6:34 am 
Crawling Chaos
User avatar

Joined: Mon Feb 13, 2012 5:37 am
Posts: 1148
Location: Kimashi Tower, Japan
Completed: SMAR,AAA
Projects: DMC
You can use style properties directly on the frames, buttons, texts, e.t.c. in the screens (you can find at screen.rpy) and you don't need to think about styles in this case.
Then the next question is why some styles are defined in python blocks outside of screens (you can find at both screen.rpy and option.rpy). Because it allows to change several objects at once.
For example:
Code:
text "xxx":
  font "zzz.ttf"
It changes the text font.
But if you want to change several text lines, you may put a style_group on a higher block. like:
Code:
style_gruop "new_font"
text "xxx"
text "yyy"
Code:
python:
 style.new_font_text.font="zzz.ttf"

The difficulty of styles is knowing where is "_ "used or ".". The documentation doesn't list all style hierarchies, so you need to look up them with shift+d in a ren'py game.

_________________


Top
 Profile Send private message  
 
PostPosted: Wed Aug 15, 2012 2:16 pm 
Eileen-Class Veteran
User avatar

Joined: Fri Mar 09, 2012 6:58 pm
Posts: 1173
Location: United States
Projects: Coming Out On Top
OMG...Nyaatrap...using

Code:
style.new_font_text.font="zzz.ttf"

instead of

Code:
style.newstyle.font="fonts/arial.ttf"


solved the problem.

You're my hero.

_________________
Coming Out On Top - An Adult B/B Game
Wordpress Tumblr Twitter FB


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: MissLanna


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