parameters: (self, parent)
docstring: Variables:
              image_no_var
              tilemap_no_var
              focus_x_var
              focus_y_var
              viewport_x_var
              viewport_y_var
              help_message_var
docstring_summary: Variables:
              image_no_var
              tilemap_no_var
              focus_x_var
              focus_y_var
              viewport_x_var
              viewport_y_var
              help_message_var
docstring_tokens: Variables : image_no_var tilemap_no_var focus_x_var focus_y_var viewport_x_var viewport_y_var help_message_var
function: def __init__(self, parent):
          """
          Variables:
              image_no_var
              tilemap_no_var
              focus_x_var
              focus_y_var
              viewport_x_var
              viewport_y_var
              help_message_var
          """
  
          if hasattr(parent, "tilemap_no_var"):
              y = 80
              height = 66
              slider_amount = 8
              self._is_tilemap_mode = True
              self.copy_var("tilemap_no_var", parent)
          else:
              y = 16
              height = 130
              slider_amount = 16
              self._is_tilemap_mode = False
          super().__init__(parent, 157, y, 66, height)
          self._press_x = 0
          self._press_y = 0
          self._drag_offset_x = 0
          self._drag_offset_y = 0
          self.copy_var("image_no_var", parent)
          self.copy_var("help_message_var", parent)
  
          # Initialize focus_x_var
          self.new_var("focus_x_var", 0)
          self.add_var_event_listener("focus_x_var", "set", self.__on_focus_x_set)
          self.add_var_event_listener("focus_x_var", "change", self.__on_focus_x_change)
  
          # Initialize focus_y_var
          self.new_var("focus_y_var", 0)
          self.add_var_event_listener("focus_y_var", "set", self.__on_focus_y_set)
          self.add_var_event_listener("focus_y_var", "change", self.__on_focus_y_change)
  
          # Initialize focus_w_var
          self.new_var("focus_w_var", 1 if self._is_tilemap_mode else 2)
  
          # Initialize focus_h_var
          self.new_var("focus_h_var", 1 if self._is_tilemap_mode else 2)
  
          # Initialize horizontal scroll bar
          self._h_scroll_bar = ScrollBar(
              self,
              0,
              height - 1,
              width=66,
              scroll_amount=32,
              slider_amount=8,
              value=0,
          )
          self.copy_var("viewport_x_var", self._h_scroll_bar, "value_var")
  
          # Initialize vertical scroll bar
          self._v_scroll_bar = ScrollBar(
              self,
              65,
              0,
              height=height,
              scroll_amount=32,
              slider_amount=slider_amount,
              value=0,
          )
          self.copy_var("viewport_y_var", self._v_scroll_bar, "value_var")
  
          # Set event listeners
          self.add_event_listener("mouse_down", self.__on_mouse_down)
          self.add_event_listener("mouse_drag", self.__on_mouse_drag)
          self.add_event_listener("mouse_hover", self.__on_mouse_hover)
          self.add_event_listener("draw", self.__on_draw)
function_tokens: def __init__ ( self , parent ) : if hasattr ( parent , "tilemap_no_var" ) : y = 80 height = 66 slider_amount = 8 self . _is_tilemap_mode = True self . copy_var ( "tilemap_no_var" , parent ) else : y = 16 height = 130 slider_amount = 16 self . _is_tilemap_mode = False super ( ) . __init__ ( parent , 157 , y , 66 , height ) self . _press_x = 0 self . _press_y = 0 self . _drag_offset_x = 0 self . _drag_offset_y = 0 self . copy_var ( "image_no_var" , parent ) self . copy_var ( "help_message_var" , parent ) # Initialize focus_x_var self . new_var ( "focus_x_var" , 0 ) self . add_var_event_listener ( "focus_x_var" , "set" , self . __on_focus_x_set ) self . add_var_event_listener ( "focus_x_var" , "change" , self . __on_focus_x_change ) # Initialize focus_y_var self . new_var ( "focus_y_var" , 0 ) self . add_var_event_listener ( "focus_y_var" , "set" , self . __on_focus_y_set ) self . add_var_event_listener ( "focus_y_var" , "change" , self . __on_focus_y_change ) # Initialize focus_w_var self . new_var ( "focus_w_var" , 1 if self . _is_tilemap_mode else 2 ) # Initialize focus_h_var self . new_var ( "focus_h_var" , 1 if self . _is_tilemap_mode else 2 ) # Initialize horizontal scroll bar self . _h_scroll_bar = ScrollBar ( self , 0 , height - 1 , width = 66 , scroll_amount = 32 , slider_amount = 8 , value = 0 , ) self . copy_var ( "viewport_x_var" , self . _h_scroll_bar , "value_var" ) # Initialize vertical scroll bar self . _v_scroll_bar = ScrollBar ( self , 65 , 0 , height = height , scroll_amount = 32 , slider_amount = slider_amount , value = 0 , ) self . copy_var ( "viewport_y_var" , self . _v_scroll_bar , "value_var" ) # Set event listeners self . add_event_listener ( "mouse_down" , self . __on_mouse_down ) self . add_event_listener ( "mouse_drag" , self . __on_mouse_drag ) self . add_event_listener ( "mouse_hover" , self . __on_mouse_hover ) self . add_event_listener ( "draw" , self . __on_draw )