Yet more Python problems...
Displaying 1-5 of 5 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
ashground

Taking a look at 'textbox.py', I decided I wanted to change the font. Right away, I noticed the quirk--it was apparently using 'system.fnt', but no such thing existed... I tried calling TextBox with TextBox(speech.fnt, "blah", etc, etc), using many different arrangements, but nothing worked. Then I realized that system.fnt didn't seem to be a file call, but a reference to a class variable... and this has something to do with the mysterious 'import system' call at the top of 'outside.py'...

I tried changing the font directly in the definition of TextBox, with 'font=Font("speech.fnt")', but everything seems to just generate errors!

So, what IS 'system.fnt', and how can you change the font that TextBox uses?



Posted on 2001-08-17 03:40:35

ShadowDrak

I'm not having problems changing the font.
all I did was
var=Font("speech.fnt")
TextBox(var,"blah")

the only thing you need is(of course) the proper import statements.

Was that helpful at all?

-ShadowDrak



Posted on 2001-08-17 09:00:03

Rayner

SYSTEM.FNT does NOT refer to a file named system.fnt. That specific TextBox function can only be given font objects [gamefont=Font("myfont.fnt") - gamefont being the object]. If you notice, at the top of outside.py, the file "system.py" was imported by the statement: "import system". This brings everything in the system.py file into your current file. Within system.py there is a font object declared [fnt=Font('main.fnt') - fnt being the object]. In the outside.py file you can access that object by entering "system.fnt" meaning the fnt object within the system file. This can be confusing at first but you'll soon understand. You can also access the player object that was made in system.py by entering "system.player" and so on. To make it even easier instead of "import system" you could do "from system import fnt" and be able to access that object by simply typing "fnt". The way tSB named the font object and imported system can be confusing to newbies who think it's a file :)



Posted on 2001-08-17 15:42:03

Rayner

Sorry, I forgot to answer your second question. In SYSTEM.PY you can simply delete the old fnt object declaraction and redeclare a font object named fnt. Or in OUTSIDE.PY you can make a new font object of your own and replace "system.fnt" with the name of the object.



Posted on 2001-08-17 15:52:37

andy

Terribly sorry about that. I thought it was kinda funny, but I guess it's a bit confusing.

Rayner's right. It's an object called "fnt" in the system module. You can change the font itself by tweaking the font=Font('...') line in system.py, or by loading your own font object elsewhere and passing it instead. :)



"Ignorance is its own reward" -- Proverb

Posted on 2001-08-18 13:17:49


Displaying 1-5 of 5 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.