954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Pygame.font help

Hi all,

Could someone help with the position of text on screen in pygame. Basic structure would look something like this below.
now I like the user to input the text position starting at top left and moving 1 space at a time until end of that line then onto next line and so on until it reaches bottom right hand side. any idea on how to this would be great and not Def statement ... Thanks

# Moving Text across screen
import pygame
a=0

class MovingText:
    def __init__(self,mFont,Text,top,left,speed = 3,color = (255,255,255)):
        self.Text = mFont.render(Text,0,color)
        self.pos = [a,left]
        self.speed = speed

    def draw(self,canvas):
        self.pos[0] += self.speed
        if self.pos[0] > 800 - self.Text.get_width():
            self.pos[0] = 0
        canvas.blit(self.Text,self.pos)

#
FAITH2011
Light Poster
29 posts since Dec 2010
Reputation Points: 10
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: