Package arcmap :: Module editortools
[hide private]
[frames] | no frames]

Module editortools

source code

Code for the GUI tools that allow the user to edit the map. This is used by the mapgrid module.

Classes [hide private]
  EditorTool
Base class for tools used in the map editor.
  TileTool
  TileDeleteTool
  TileSelectTool
  TileDrawTool
  ShapeTool
Base class for tools that draw physics shapes
  PhysicsSelectTool
  CircleDrawTool
  PolygonDrawTool
  LightDrawTool
Functions [hide private]
 
coordsToTileEdges(ix, iy, ts)
Return the ix and iy snapped to the nearest division between tiles This is used for physics drawing
source code
 
coordsToTiles(x, y, ts)
Translates mouse coordinates to tile coordinates
source code
 
rectangleSelect(x1, y1, x2, y2, ts)
Returns the coordinates of a rectangle whose edges are snapped to the divisions between tiles.
source code
Variables [hide private]
  TILE_DRAW_ID = 0
  TILE_DELETE_ID = 1
  PHYSICS_SELECT_ID = 2
  CIRCLE_DRAW_ID = 3
  POLYGON_DRAW_ID = 4
  LIGHT_DRAW_ID = 5
  __package__ = 'arcmap'
Function Details [hide private]

coordsToTileEdges(ix, iy, ts)

source code 

Return the ix and iy snapped to the nearest division between tiles This is used for physics drawing

Parameters:
  • ix (int) - x-coordinate of mouse
  • iy (int) - y-coordinate of mouse
  • ts (int) - the size (in pixels) of a tile

coordsToTiles(x, y, ts)

source code 

Translates mouse coordinates to tile coordinates

Parameters:
  • x (int) - x-coordinate of the mouse
  • y (int) - y-cooridnate of the mouse
  • ts (int) - size of a tile in pixels

rectangleSelect(x1, y1, x2, y2, ts)

source code 

Returns the coordinates of a rectangle whose edges are snapped to the divisions between tiles. The returned value is in pixel units in the form (x, y, w, h)

Parameters:
  • x1 (int) - left x-coordinate in tiles
  • y1 (int) - top y-coordinate in tiles
  • x2 (int) - right x-coordinate in tiles
  • y2 (int) - bottom y-coordinate in tiles
  • ts (int) - size of tile in pixels