Draw the minimap.
559574
def draw_mini_map(self, surf):
    """"""
    if (self._render_rgb and self._obs.observation.HasField("render_data") and
        self._obs.observation.render_data.HasField("minimap")):
      # Draw the rendered version.
      surf.blit_np_array(features.Feature.unpack_rgb_image(
          self._obs.observation.render_data.minimap))
    else:  # Render it manually from feature layer data.
      hmap_feature = features.MINIMAP_FEATURES.height_map
      hmap = hmap_feature.unpack(self._obs.observation)
      if not hmap.any():
        hmap = hmap + 100  # pylint: disable=g-no-augmented-assignment
      hmap_color = hmap_feature.color(hmap)

      creep_feature = features.MINIMAP_FEATURES.creep
      creep = creep_feature.unpack(self._obs.observation)
      creep_mask = creep > 0
      creep_color = creep_feature.color(creep)

      if self._obs.observation.player_common.player_id in (0, 16):  # observer
        # If we're the observer, show the absolute since otherwise all player
        # units are friendly, making it pretty boring.
        player_feature = features.MINIMAP_FEATURES.player_id
      else:
        player_feature = features.MINIMAP_FEATURES.player_relative
      player_data = player_feature.unpack(self._obs.observation)
      player_mask = player_data > 0
      player_color = player_feature.color(player_data)

      visibility = features.MINIMAP_FEATURES.visibility_map.unpack(
          self._obs.observation)
      visibility_fade = np.array([[0.5] * 3, [0.75]*3, [1]*3])

      # Compose and color the different layers.
      out = hmap_color * 0.6
      out[creep_mask, :] = (0.4 * out[creep_mask, :] +
                            0.6 * creep_color[creep_mask, :])
      out[player_mask, :] = player_color[player_mask, :]
      out *= visibility_fade[visibility]

      # Render the bit of the composited layers that actually correspond to the
      # map. This isn't all of it on non-square maps.
      shape = self._map_size.scale_max_size(
          self._feature_minimap_px).floor()
      surf.blit_np_array(out[:shape.y, :shape.x, :])

      surf.draw_rect(colors.white * 0.8, self._camera, 1)  # Camera
      pygame.draw.rect(surf.surf, colors.red, surf.surf.get_rect(), 1)
1047727
def on_draw(self):
        """"""
        # Skip the drawing if the program hasn't been built yet.
        # The program is built by the interact.
        if self.program:
            # Draw the program.
            self.program.draw(self.gl_primitive_type)
        else:  # pragma: no cover
            logger.debug("Skipping drawing visual `%s` because the program "
                         "has not been built yet.", self)
238507
def draw(self):
        """"""
        if sys.stdout.isatty():  # pragma: no cover
            from asciimatics.screen import Screen

            Screen.wrapper(self._do_draw)
        else:
            for line in self.canvas:
                print("".join(line))
669979
def draw_screen(self, surf):
    """"""
    # surf.fill(colors.black)
    if (self._render_rgb and self._obs.observation.HasField("render_data") and
        self._obs.observation.render_data.HasField("map")):
      self.draw_rendered_map(surf)
    else:
      self.draw_base_map(surf)
      self.draw_units(surf)
    self.draw_selection(surf)
    self.draw_build_target(surf)
    self.draw_overlay(surf)
    self.draw_commands(surf)
    self.draw_panel(surf)
229903
def draw(self, milliseconds):
        """"""
        cam = Ragnarok.get_world().Camera
        camPos = cam.get_world_pos()
        self.__sort_draw()
        self.clear_backbuffer()
        for obj in self.__draw_objects:
            #Check to see if the object is visible to the camera before doing anything to it.
            if obj.is_static or obj.is_visible_to_camera(cam):
                #Offset all of our objects by the camera offset.
                old_pos = obj.coords
                xVal = obj.coords.X - camPos.X
                yVal = obj.coords.Y - camPos.Y
                obj.coords = Vector2(xVal, yVal)
                obj.draw(milliseconds, self.backbuffer)
                obj.coords = old_pos
155471
def draw_grid(self):
        """"""
        self.screen.fill((0xbb, 0xad, 0xa0), self.origin + (self.game_width, self.game_height))
        for y, row in enumerate(self.grid):
            for x, cell in enumerate(row):
                self.screen.blit(self.tiles[cell], self.get_tile_location(x, y))
66969
def draw(self):
        """"""
        for fig in set(chain(*map(
                lambda arr: arr.psy.plotter.figs2draw, self.with_plotter))):
            self.logger.debug("Drawing figure %s", fig.number)
            fig.canvas.draw()
        for arr in self:
            if arr.psy.plotter is not None:
                arr.psy.plotter._figs2draw.clear()
        self.logger.debug("Done drawing.")
816220
public void onDraw() {
		map.getVectorContext().setController(parent, getId(), controller, Event.MOUSEEVENTS);
		map.getVectorContext().setCursor(parent, getId(), Cursor.POINTER.getValue());
	}
886313
def draw(self):
        """"""
        if not self.visible:
            return

        # Blit the current checkbox's image.

        if self.isEnabled:
            if self.mouseIsDown and self.lastMouseDownOverButton and self.mouseOverButton:
                if self.value:
                    self.window.blit(self.surfaceOnDown, self.loc)
                else:
                    self.window.blit(self.surfaceOffDown, self.loc)
            else:
                if self.value:
                    self.window.blit(self.surfaceOn, self.loc)
                else:
                    self.window.blit(self.surfaceOff, self.loc)


        else:
            if self.value:
                self.window.blit(self.surfaceOnDisabled, self.loc)
            else:
                self.window.blit(self.surfaceOffDisabled, self.loc)
1035861
def draw(self, img, pixmapper, bounds):
        ''''''

        if self.hidden:
            return

        if self.trail is not None:
            self.trail.draw(img, pixmapper, bounds)

        icon = self.img()
        (px,py) = pixmapper(self.latlon)

        # find top left
        px -= icon.width/2
        py -= icon.height/2
        w = icon.width
        h = icon.height

        (px, py, sx, sy, w, h) = self.clip(px, py, w, h, img)

        cv.SetImageROI(icon, (sx, sy, w, h))
        cv.SetImageROI(img, (px, py, w, h))
        cv.Add(icon, img, img)
        cv.ResetImageROI(img)
        cv.ResetImageROI(icon)

        # remember where we placed it for clicked()
        self.posx = px+w/2
        self.posy = py+h/2
176591
def drawing_update(self):
        ''''''
        from MAVProxy.modules.mavproxy_map import mp_slipmap
        if self.draw_callback is None:
            return
        self.draw_line.append(self.click_position)
        if len(self.draw_line) > 1:
            self.mpstate.map.add_object(mp_slipmap.SlipPolygon('drawing', self.draw_line,
                                                          layer='Drawing', linewidth=2, colour=(128,128,255)))
1346106
def draw(self, img, pixmapper, bounds):
        ''''''
        if self.hidden:
            return
        (x,y,w,h) = bounds
        spacing = 1000
        while True:
            start = mp_util.latlon_round((x,y), spacing)
            dist = mp_util.gps_distance(x,y,x+w,y+h)
            count = int(dist / spacing)
            if count < 2:
                spacing /= 10
            elif count > 50:
                spacing *= 10
            else:
                break

        for i in range(count*2+2):
            pos1 = mp_util.gps_newpos(start[0], start[1], 90, i*spacing)
            pos3 = mp_util.gps_newpos(pos1[0], pos1[1], 0, 3*count*spacing)
            self.draw_line(img, pixmapper, pos1, pos3, self.colour, self.linewidth)

            pos1 = mp_util.gps_newpos(start[0], start[1], 0, i*spacing)
            pos3 = mp_util.gps_newpos(pos1[0], pos1[1], 90, 3*count*spacing)
            self.draw_line(img, pixmapper, pos1, pos3, self.colour, self.linewidth)
591239
def cmd_minimap(action, action_space, ability_id, queued, minimap):
  """"""
  action_cmd = spatial(action, action_space).unit_command
  action_cmd.ability_id = ability_id
  action_cmd.queue_command = queued
  minimap.assign_to(action_cmd.target_minimap_coord)
99065
def draw(self, surf):
        '''
        
        '''
        if self.shown:
            for w in self.widgets:
                surf.blit(w.image, self.convert_rect(w.rect))
            for c in self.containers:
                c.draw(surf)
869243
function() {
        if (this.drawing) {
        this.ctx.beginPath();
        this.ctx.moveTo(this.lastPos.x, this.lastPos.y);
        this.ctx.lineTo(this.currentPos.x, this.currentPos.y);
        this.ctx.stroke();
        this.lastPos = this.currentPos;
      }
    }
542711
def draw(self):
        """"""
        self.screen.clear()

        x, y = 1, 1  # start point
        max_y, max_x = self.screen.getmaxyx()
        max_rows = max_y - y  # the max rows we can draw

        lines, current_line = self.get_lines()

        # calculate how many lines we should scroll, relative to the top
        scroll_top = getattr(self, 'scroll_top', 0)
        if current_line <= scroll_top:
            scroll_top = 0
        elif current_line - scroll_top > max_rows:
            scroll_top = current_line - max_rows
        self.scroll_top = scroll_top

        lines_to_draw = lines[scroll_top:scroll_top+max_rows]

        for line in lines_to_draw:
            if type(line) is tuple:
                self.screen.addnstr(y, x, line[0], max_x-2, line[1])
            else:
                self.screen.addnstr(y, x, line, max_x-2)
            y += 1

        self.screen.refresh()
44525
def draw(self):
        ""
        glBindVertexArray( self.m_glVertArray )
        glActiveTexture( GL_TEXTURE0 )
        glBindTexture( GL_TEXTURE_2D, self.m_glTexture )
        glDrawElements( GL_TRIANGLES, self.m_unVertexCount, GL_UNSIGNED_SHORT, 0 )
        glBindVertexArray( 0 )