import pygame


class fontolicious(object):
	def __init__(self,w,h,image):
		self.image = image
		self.rect = image.get_rect()
		self.area = pygame.Rect((0,0),(5,5))
		self.image.set_colorkey(self.image.get_at((0,5)))
		#self.w, self.h = w, h

	def put(self,screen,x,y,chs):
		if (type(chs) != str):
			return
		for ch in chs:
			screen.blit(self.image,self.area.move(x,y),self.area.move(6*(ord(ch)-33),0))
			x = x+6

fnt = fontolicious(5,5,pygame.image.load("fontolicious.png"))

if __name__ == "__main__":
	pygame.init()
	pygame.display.set_caption("Fontolicious")
	pygame.mouse.set_visible(1)
	pygame.event.set_blocked(None)
	pygame.event.set_allowed(pygame.QUIT)
	clock = pygame.time.Clock()
	screen = pygame.display.set_mode((128, 128))
	offscr = screen.get_rect()
	end = False
	paused = True
#-------------------------------------------------
	while not pygame.event.peek(pygame.QUIT):
		pygame.event.clear()
		clock.tick(20)
		pygame.display.flip()
		screen.fill((0,0,128))
		fnt.put(screen,32,61,'Fontolicious')
