def __init__(
        self,
        value,
        scale_surf,
        max_value,
        padding_x=10,
        name="scale",
        coordinates_name="topleft",
        coordinates_value=(0, 0),
        command=empty_function,
    ):
        """Assign variables and perform setups.

        Parameters
        ==========

        value (0.0 <= float <= 1.0)
            initial value of the scale.
        scale_surf (pygame.Surface instance)
            represents the scale.
        max_value (positive integer)
            maximum value the scale can assume.
        padding_x (integer)
            represents amount in pixels to pad the width of
            the scale widget rect area used to pick value.
        name (string)
            just an optional way of further identifying
            the scale; it is stored in the 'name' attribute
            of the instantiated scale.
        coordinates_name (string)
            attribute name of a pygame.Rect instance
            wherein to store the position information from
            the coordinates value argument.
        coordinates_value (2-tuple or list; has 2 integers)
            represents a position in 2d space, the values
            of the x and y axes, respectively.
        command (callable)
            command to be executed everytime the value
            changes; defaults to an empty function.
        """
        ### store arguments

        self.value = value
        self.name = name
        self.command = command
        self.max_value = max_value
        self.padding_x = padding_x

        ### set image and rect for widget

        self.image = scale_surf
        self.rect = self.image.get_rect()
        setattr(self.rect, coordinates_name, coordinates_value)

        ### set handle object

        self.handle = Object2D(image=HANDLE_SURF, rect=HANDLE_SURF.get_rect())

        ### define a selection area excluding the padding
        self.define_selection_area()

        ### position handle according to value
        self.place_handle()
Assign variables and perform setups.

        Parameters
        ==========

        value (0.0 <= float <= 1.0)
            initial value of the scale.
        scale_surf (pygame.Surface instance)
            represents the scale.
        max_value (positive integer)
            maximum value the scale can assume.
        padding_x (integer)
            represents amount in pixels to pad the width of
            the scale widget rect area used to pick value.
        name (string)
            just an optional way of further identifying
            the scale; it is stored in the 'name' attribute
            of the instantiated scale.
        coordinates_name (string)
            attribute name of a pygame.Rect instance
            wherein to store the position information from
            the coordinates value argument.
        coordinates_value (2-tuple or list; has 2 integers)
            represents a position in 2d space, the values
            of the x and y axes, respectively.
        command (callable)
            command to be executed everytime the value
            changes; defaults to an empty function.
        
nodezator/our3rdlibs/scale.py