Пример #1
0
    def Render(self, DISPLAY):
        # -- Render Background -- #
        BGColor = UI.ThemesManager_GetProperty("Button_Active_BackgroundColor")
        LineColor = UI.ThemesManager_GetProperty(
            "Button_Active_IndicatorColor")

        if not self.Active:
            BGColor = UI.ThemesManager_GetProperty(
                "Button_Inactive_BackgroundColor")
            LineColor = UI.ThemesManager_GetProperty(
                "Button_Active_IndicatorColor")

        Shape.Shape_Rectangle(DISPLAY, BGColor, self.Rectangle)
        Shape.Shape_Rectangle(DISPLAY, LineColor, self.Rectangle, 1)

        # -- Render Change Title -- #
        TitleX = self.Rectangle[
            0] + self.Rectangle[2] / 2 - self.Content.GetFont_width(
                "/Ubuntu_Bold.ttf", 12, self.TitleName) / 2

        self.Content.FontRender(DISPLAY, "/Ubuntu_Bold.ttf", 12,
                                self.TitleName, (230, 230, 230), TitleX,
                                self.Rectangle[1])

        # -- Render EditableNumberView -- #
        self.Changer.Render(DISPLAY)
Пример #2
0
    def Render(self, DISPLAY):
        if not self.LastRect == self.Rectangle:
            self.Surface = pygame.Surface(
                (self.Rectangle[2], self.Rectangle[3]))

        # -- Render Background -- #
        self.Surface.fill((190, 190, 190))
        Shape.Shape_Rectangle(self.Surface, (100, 100, 100),
                              (0, 0, self.Rectangle[2], self.Rectangle[3]), 5)

        for i in range(12):
            NoteLabel = self.GetNote_ByIndex(i)

            # -- Variables -- #
            Width = 30
            Height = 25
            X = i * (Width + 2)
            Y = self.Rectangle[3] - Height
            BackgroundColor = (100, 105, 155)
            TextColor = (0, 5, 100)
            IsHighNote = False

            if "#" in NoteLabel:
                Width = 30
                X = i * (Width + 2)
                Width = 35
                X -= 2
                Y = 0
                BackgroundColor = (10, 15, 25)
                TextColor = (200, 205, 255)
                IsHighNote = True

            TextX = X + (Width / 2 - UI.ContentManager.GetFont_width(
                "/PressStart2P.ttf", 12, NoteLabel) / 2)

            if self.LastNote == i:
                BackgroundColor = (200, 205, 255)
                TextColor = (0, 0, 0)

            if not IsHighNote:
                Shape.Shape_Rectangle(self.Surface, BackgroundColor,
                                      (X, Y, Width, Height), 0, 0, 5, 5)
            else:
                Shape.Shape_Rectangle(self.Surface, BackgroundColor,
                                      (X, Y, Width, Height), 0, 0, 0, 0, 5, 5)

            UI.ContentManager.FontRender(self.Surface, "/PressStart2P.ttf", 12,
                                         NoteLabel, TextColor, TextX, Y + 5)

        DISPLAY.blit(self.Surface, (self.Rectangle[0], self.Rectangle[1]))
Пример #3
0
    def DrawProgressBar(self, DISPLAY):
        self.LoadingBarPos = (DISPLAY.get_width() / 2 - 250 / 2,
                              DISPLAY.get_height() / 2 + 10 / 2, 250, 10)
        self.LoadingBarProgress = (self.LoadingBarPos[0],
                                   self.LoadingBarPos[1],
                                   max(
                                       10,
                                       Utils.Get_Percentage(
                                           self.Progress,
                                           self.LoadingBarPos[2],
                                           self.ProgressMax)), 10)

        Shape.Shape_Rectangle(DISPLAY, (20, 20, 58), self.LoadingBarPos, 0,
                              self.LoadingBarPos[3])
        Shape.Shape_Rectangle(DISPLAY, (94, 114, 219), self.LoadingBarProgress,
                              0, self.LoadingBarPos[3])
Пример #4
0
    def Render(self, DISPLAY):
        # -- Render Background -- #
        Shape.Shape_Rectangle(self.Surface, self.BgColor,
                              (0, 0, self.Rectangle[2], self.Rectangle[3]))
        # -- Render Indicator -- #
        Shape.Shape_Rectangle(self.Surface, self.IndicatorColor,
                              (0, 0, self.Rectangle[2], self.Rectangle[3]), 1)

        # -- Render the Button Text -- #
        self.Content.FontRender(self.Surface, "/Ubuntu_Bold.ttf",
                                self.FontSize - 2, self.Text, (240, 240, 240),
                                self.Centred_X, self.Centred_Y)

        DISPLAY.blit(self.Surface, (self.Rectangle[0], self.Rectangle[1]))

        if self.ButtonState == 2:
            self.ButtonState = 0
Пример #5
0
    def Draw(self, Surface):
        self.ObjectSurface.fill((0, 0, 0, 0))

        Shape.Shape_Rectangle(self.ObjectSurface, (0, 0, 0, 150),
                              (0, 0, self.Width, self.Height), 0, 5)

        index = -1
        for item in self.SeletorItems_Index:
            index += 1
            ItemRect = pygame.Rect(self.HScroll + 105 * index, 5, 100,
                                   self.Height - 10)
            ItemPicBox = pygame.Rect(ItemRect[0] + 2, ItemRect[1] + 4,
                                     ItemRect[2] - 4, ItemRect[3] - 8)

            if self.SelectedItemIndex == index:
                Shape.Shape_Rectangle(self.ObjectSurface, (255, 255, 255, 150),
                                      ItemRect, 0, 2)

            if self.SeletorItems_Icon[index] == None:
                self.Content.ImageRender(self.ObjectSurface,
                                         "/folder_question.png",
                                         ItemPicBox[0],
                                         ItemPicBox[1],
                                         ItemPicBox[2],
                                         ItemPicBox[3],
                                         SmoothScaling=True)
            else:
                self.Content.ImageRender(self.ObjectSurface,
                                         self.SeletorItems_Icon[index],
                                         ItemPicBox[0],
                                         ItemPicBox[1],
                                         ItemPicBox[2],
                                         ItemPicBox[3],
                                         SmoothScaling=True,
                                         ImageNotLoaded=True)

        Surface.blit(self.ObjectSurface, (self.X, self.Y))
Пример #6
0
    def Render(self, DISPLAY):
        # Blit the rect.
        Shape.Shape_Rectangle(DISPLAY, (15, 15, 15), self.Rectangle)

        if self.Text == self.DefaultText:
            UI.ContentManager.FontRender(
                DISPLAY, UI.ThemesManager_GetProperty("InputBox_FontFile"),
                self.FontSize, self.Text, (140, 140, 140), self.Rectangle[0],
                self.Rectangle[1])
        else:
            if not self.Text == "":
                UI.ContentManager.FontRender(
                    DISPLAY, UI.ThemesManager_GetProperty("InputBox_FontFile"),
                    self.FontSize, self.Text, (240, 240, 240),
                    self.Rectangle[0], self.Rectangle[1])

        if not self.Active:
            Shape.Shape_Rectangle(DISPLAY, (255, 51, 102),
                                  (self.Rectangle[0], self.Rectangle[1] - 1,
                                   self.Rectangle[2], 1))
        else:
            Shape.Shape_Rectangle(DISPLAY, (46, 196, 182),
                                  (self.Rectangle[0], self.Rectangle[1] - 1,
                                   self.Rectangle[2], 1))