Example #1
0
 def copy(self):
     self.curClip = len(self.clips)
     box = AxisAlignedBoundingBox(*self.selection[2:4])
     tiles = dict([((x-box.min.x, y-box.min.y),
                    self.tiles.get((x,y),"water"))
                   for (x,y) in box.enumerate()])
     item = ClipboardItem(tiles, box.size, self.map)
     self.clips.append(item)
     self.selectionId = self.edit.selectionId
     self.window.dialogMessage("Copied selection.")
Example #2
0
 def do_fillAll(self, minmax, button):
     tiles = self.game.ocean.tiles
     newTile = self.palette.tileName
     if newTile == "water" or button == 3:
         ab = AxisAlignedBoundingBox(*minmax)
         for (col,row) in ab.enumerate():
             if (col,row) in tiles:
                 del tiles[(col,row)]
     elif button == 1:
         ab = AxisAlignedBoundingBox(*minmax)
         for (col,row) in ab.enumerate():
             tiles[(col,row)] = newTile
     self.ocean.dirty = True
     self.map.dirty = True