(self)
TODO: This function need to be coded a better way. but it works :D

            Carousel indicator.
TODO: This function need to be coded a better way. but it works :D
TODO : This function need to be coded a better way . but it works : D
def show_indicator(self):
        """
            TODO: This function need to be coded a better way. but it works :D

            Carousel indicator.
        """
        align = 0
        spacing = 3

        # if there is more then 11 games, reduce the spacing of each dots
        if self.num_games > 10:
            spacing = 2

            # Move back the indicator by 1 pixel if the number of games is even.
            if self.num_games % 2:
              align = -1

        # Measure the width of the indicator and then center it on the screen
        indicator_length = (self.num_games * spacing) - (spacing - 1)

        pixels = []

        # Render the indicator
        for i in range(self.num_games):
            dot_position = ((spacing * i) - 1) + 1

            color = (70, 70, 70)
            if i == self.index:
                color = (255, 50, 50)

            pixels.append(
              MatrixPixels(
                ((align + dot_position), 0), 
                color
              )
            )

        self.matrix.draw_pixels_layout(
            self.layout.indicator_dots,
            pixels,
            (pixels[-1].position[0] - pixels[0].position[0], 1)
        )
def show_indicator ( self ) : align = 0 spacing = 3 # if there is more then 11 games, reduce the spacing of each dots if self . num_games > 10 : spacing = 2 # Move back the indicator by 1 pixel if the number of games is even. if self . num_games % 2 : align = - 1 # Measure the width of the indicator and then center it on the screen indicator_length = ( self . num_games * spacing ) - ( spacing - 1 ) pixels = [ ] # Render the indicator for i in range ( self . num_games ) : dot_position = ( ( spacing * i ) - 1 ) + 1 color = ( 70 , 70 , 70 ) if i == self . index : color = ( 255 , 50 , 50 ) pixels . append ( MatrixPixels ( ( ( align + dot_position ) , 0 ) , color ) ) self . matrix . draw_pixels_layout ( self . layout . indicator_dots , pixels , ( pixels [ - 1 ] . position [ 0 ] - pixels [ 0 ] . position [ 0 ] , 1 ) )