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 Thu May 23, 2013 7:51 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  [ 4 posts ] 
Author Message
PostPosted: Tue May 01, 2012 8:44 pm 
Regular

Joined: Wed Nov 23, 2011 5:30 pm
Posts: 82
I have this code:
Code:
init:
    python:
        style.create('statgreen', 'style.label_text')
        style.statgreen.color="#c8ffc8"
        style.statgreen.outlines=[(1,"#e8ffe8")]
        style.create('statred', 'style.label_text')
        style.statred.color="#ffc8c8"
        style.statred.outlines=[(1,"#ffe8e8")]

and somewhere else this one:
Code:
screen show_strength:
    modal False
    $ plop_value = "+%d"%add_strength
    label plop_value xpos 280 ypos 116 at zahlenplopp style statgreen

When the screen is called, I get an error message that says that the name "statgreen" is not defined. I'm at a loss here, because well, I think I did define it, so I must have forgotten something or misunderstood how to define new styles.


Last edited by Milkymalk on Wed May 02, 2012 1:23 pm, edited 3 times in total.

Top
 Profile Send private message  
 
PostPosted: Tue May 01, 2012 8:49 pm 
Veteran
User avatar

Joined: Tue Aug 12, 2008 12:02 pm
Posts: 356
Location: The treacherous Brazilian Rainforest
Projects: Valentine Square (writer) Spiral Destiny (programmer)
I think it should be:
Code:
    label plop_value xpos 280 ypos 116 at zahlenplopp style "statgreen"

_________________
Keep your script in your Dropbox folder.
It allows you to share files with your team, keeps backups of previous versions, and is ridiculously easy to use.


Top
 Profile Send private message  
 
PostPosted: Tue May 01, 2012 9:47 pm 
Regular

Joined: Wed Nov 23, 2011 5:30 pm
Posts: 82
Thank you, I should have thought of that myself... I'm not used to writing identifiers inside quotes.

That gets rid of the error message, however I don't see any changes, as if I hadn't used any style change at all :(


Top
 Profile Send private message  
 
PostPosted: Wed May 02, 2012 12:18 pm 
Regular

Joined: Wed Nov 23, 2011 5:30 pm
Posts: 82
I had the idea that maybe the problem why the style is not showing is that I gave the label the style and not the text of the label. Now I know that style.label_text is some kind of sub-style of style.text and not part of the style.label object, so I have no idea how to assign a custom created style.label_text to a label, except by changing style.label_text generally, but I don't want that.

EDIT: Solved by using text instead of label.


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

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot]


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