def from_surface(
        cls, surface, coordinates_name="topleft", coordinates_value=(0, 0), **kwargs
    ):
        """Store surface and its rect, positioning it.

        Parameters
        ==========

        surface (pygame.Surface)
            surface to store and from where to obtain rect.
        coordinates_name (string)
            string representing attribute name of rect
            wherein to store the position information from
            the 'coordinates_value' parameter.
        coordinates_value (tuple/list of ints)
            position information in the form of a tuple or
            list containing 2 integers representing
            positions in the x and y axes, respectively.
        """
        ### instantiate basic object
        obj = cls(**kwargs)

        ### store surface in 'image' attribute
        obj.image = surface

        ### store and position rect

        obj.rect = surface.get_rect()

        setattr(obj.rect, coordinates_name, coordinates_value)

        return obj
Store surface and its rect, positioning it.

        Parameters
        ==========

        surface (pygame.Surface)
            surface to store and from where to obtain rect.
        coordinates_name (string)
            string representing attribute name of rect
            wherein to store the position information from
            the 'coordinates_value' parameter.
        coordinates_value (tuple/list of ints)
            position information in the form of a tuple or
            list containing 2 integers representing
            positions in the x and y axes, respectively.
        
nodezator/classes2d/single.py