#CK

import Helpers

# | Title()
# |------------------------------------------------------------------
# | Class for a title that can be displayed on a surface object. It
# | builds upon the pygame text object by incorporating it's own
# | methods for drawing, changing the text, and changing size
# |-------------------------------------------------------
class Title():
    def __init__(self, xPos, yPos, text, size, colour=(255, 255, 255)):

        # | Create text object
        self.text = text
        self.size = size
        self.colour = colour
        self.text = Helpers.createText(text, size, colour)

        # | Get the rect of the text and position the title
        self.rect = self.text.get_rect()
        self.rect.centerx = xPos
        self.rect.centery = yPos

    # | draw()
    # |-------------------------------------
    # | Blits the text to a passed surface
    # |-------------------------------
    def draw(self, surface):
        surface.blit(self.text, (self.rect.x, self.rect.y))

    # | changeText()
    # |---------------------------------
    # | Changes the text of the title
    # |---------------------------
    def changeText(self, newText, newSize=-1):
        # | If no size was passed, keep it the same
        if newSize < 0:
            newSize = self.size

        text = Helpers.createText(newText, newSize, self.colour)

        self.text = text

761a58423e9f108051816aa54fbc00cccbe2f4c2
<mask token>


class Title:

    def __init__(self, xPos, yPos, text, size, colour=(255, 255, 255)):
        self.text = text
        self.size = size
        self.colour = colour
        self.text = Helpers.createText(text, size, colour)
        self.rect = self.text.get_rect()
        self.rect.centerx = xPos
        self.rect.centery = yPos
    <mask token>
    <mask token>

<mask token>


class Title:

    def __init__(self, xPos, yPos, text, size, colour=(255, 255, 255)):
        self.text = text
        self.size = size
        self.colour = colour
        self.text = Helpers.createText(text, size, colour)
        self.rect = self.text.get_rect()
        self.rect.centerx = xPos
        self.rect.centery = yPos
    <mask token>

    def changeText(self, newText, newSize=-1):
        if newSize < 0:
            newSize = self.size
        text = Helpers.createText(newText, newSize, self.colour)
        self.text = text

<mask token>


class Title:

    def __init__(self, xPos, yPos, text, size, colour=(255, 255, 255)):
        self.text = text
        self.size = size
        self.colour = colour
        self.text = Helpers.createText(text, size, colour)
        self.rect = self.text.get_rect()
        self.rect.centerx = xPos
        self.rect.centery = yPos

    def draw(self, surface):
        surface.blit(self.text, (self.rect.x, self.rect.y))

    def changeText(self, newText, newSize=-1):
        if newSize < 0:
            newSize = self.size
        text = Helpers.createText(newText, newSize, self.colour)
        self.text = text

import Helpers


class Title:

    def __init__(self, xPos, yPos, text, size, colour=(255, 255, 255)):
        self.text = text
        self.size = size
        self.colour = colour
        self.text = Helpers.createText(text, size, colour)
        self.rect = self.text.get_rect()
        self.rect.centerx = xPos
        self.rect.centery = yPos

    def draw(self, surface):
        surface.blit(self.text, (self.rect.x, self.rect.y))

    def changeText(self, newText, newSize=-1):
        if newSize < 0:
            newSize = self.size
        text = Helpers.createText(newText, newSize, self.colour)
        self.text = text

#CK

import Helpers

# | Title()
# |------------------------------------------------------------------
# | Class for a title that can be displayed on a surface object. It
# | builds upon the pygame text object by incorporating it's own
# | methods for drawing, changing the text, and changing size
# |-------------------------------------------------------
class Title():
    def __init__(self, xPos, yPos, text, size, colour=(255, 255, 255)):

        # | Create text object
        self.text = text
        self.size = size
        self.colour = colour
        self.text = Helpers.createText(text, size, colour)

        # | Get the rect of the text and position the title
        self.rect = self.text.get_rect()
        self.rect.centerx = xPos
        self.rect.centery = yPos

    # | draw()
    # |-------------------------------------
    # | Blits the text to a passed surface
    # |-------------------------------
    def draw(self, surface):
        surface.blit(self.text, (self.rect.x, self.rect.y))

    # | changeText()
    # |---------------------------------
    # | Changes the text of the title
    # |---------------------------
    def changeText(self, newText, newSize=-1):
        # | If no size was passed, keep it the same
        if newSize < 0:
            newSize = self.size

        text = Helpers.createText(newText, newSize, self.colour)

        self.text = text
