[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Questions regarding text on a pygame screen



> I have written a little game and I only have one problem with it. 
> The instructions are quite long and I wondered is it possible to set up a
> text field so that if, it is too long for the screen it starts a line ? 

Well, you could easily batch the text, either manually or
automatically.  Take the text size into the dimensions of your text
display to determine how many characters can fit in the display.  This
is the maximum size of your batch.
   
> Another question how can I get where the left hand side part of  an object
> is ?  If am right the x co-ordinate is the centre of the screen ? 
> By the way I am using pygame and using a modified version of the livewires
> package to make life easier - http://www.livewires.org.uk/python/

Is it a Sprite object?  If so, you should have declared a rect
attribute for it during initialization.  Rects have attributes such as
topleft, centerx, etc, or in your case, left.  If you need only it's
left hand x-coordinate, then it would be self.rect.left or
_objectname.rect.left.

-- 
Andrew Ulysses Baker
"failrate"