<s> """<STR_LIT>""" <EOL> import pygame <EOL> import pygame . locals <EOL> from mpf . media_controller . core . display import DisplayElement <EOL> class Shape ( DisplayElement ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , slide , machine , shape , x = None , y = None , h_pos = None , <EOL> v_pos = None , layer = <NUM_LIT:0> , ** kwargs ) : <EOL> super ( Shape , self ) . __init__ ( slide , x , y , h_pos , v_pos , layer ) <EOL> self . slide = slide <EOL> self . shape = shape . lower ( ) <EOL> if '<STR_LIT:name>' in kwargs : <EOL> self . name = kwargs [ '<STR_LIT:name>' ] <EOL> else : <EOL> self . name = '<STR_LIT>' <EOL> self . adjust_colors ( ** kwargs ) <EOL> if '<STR_LIT>' not in kwargs : <EOL> kwargs [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> if shape == '<STR_LIT>' : <EOL> self . box ( width = kwargs [ '<STR_LIT:width>' ] , <EOL> height = kwargs [ '<STR_LIT>' ] , <EOL> thickness = kwargs [ '<STR_LIT>' ] ) <EOL> elif shape == '<STR_LIT>' : <EOL> self . line ( end_x = kwargs [ '<STR_LIT:width>' ] , <EOL> end_y = kwargs [ '<STR_LIT>' ] , <EOL> thickness = kwargs [ '<STR_LIT>' ] ) <EOL> else : <EOL> raise Exception ( "<STR_LIT>" + shape ) <EOL> self . element_surface . set_colorkey ( ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> self . layer = layer <EOL> self . set_position ( x , y , h_pos , v_pos ) <EOL> def box ( self , width , height , thickness ) : <EOL> self . create_element_surface ( width , height ) <EOL> pygame . draw . rect ( self . element_surface , self . adjusted_color , <EOL> ( <NUM_LIT:0> , <NUM_LIT:0> , width , height ) , thickness ) <EOL> def line ( self , start_x , start_y , end_x , end_y , thickness ) : <EOL> self . create_element_surface ( abs ( start_x - end_x ) , <EOL> abs ( start_y - end_y ) ) <EOL> pygame . draw . line ( self . element_surface , self . adjusted_color , <EOL> ( start_x , start_y ) , ( end_x , end_y ) , thickness ) <EOL> display_element_class = Shape <EOL> create_asset_manager = False </s>
