Example #1
0
 def chunks(pos, endpos):
     last_cpos = None
     for x, y, z in bresenham(pos, endpos):
         cpos = int(x) >> 4, int(z) >> 4
         if cpos != last_cpos:
             yield cpos
             last_cpos = cpos
Example #2
0
 def chunks(pos, endpos):
     last_cpos = None
     for x, y, z in bresenham(pos, endpos):
         cpos = int(x) >> 4, int(z) >> 4
         if cpos != last_cpos:
             yield cpos
             last_cpos = cpos
Example #3
0
 def mouseDrag(self, event):
     p2 = self.hoverPosition(event)
     if p2:
         if len(self.dragPoints):
             p1 = self.dragPoints.pop(-1)
             points = list(bresenham.bresenham(p1, p2))
             self.dragPoints.extend(points)
         else:
             self.dragPoints.append(p2)
Example #4
0
 def mouseDrag(self, event):
     p2 = self.hoverPosition(event)
     if p2:
         if len(self.dragPoints):
             p1 = self.dragPoints.pop(-1)
             points = list(bresenham.bresenham(p1, p2))
             self.dragPoints.extend(points)
         else:
             self.dragPoints.append(p2)
Example #5
0
 def _renderBlocks(self, symbol_list):
     for cell1, cell2 in zip(symbol_list[:-1], symbol_list[1:]):
         if not isinstance(cell1, Cell):
             continue
         for p in bresenham.bresenham(cell1.origin, cell2.origin):
             yield p + (self.blockTypeButton.block, )  #xxx line
Example #6
0
 def renderBlocks(self):
     for x, y, z in bresenham.bresenham(self.p1, self.p2):
         yield x, y, z, self.blocktype
Example #7
0
 def renderBlocks(self):
     for x, y, z in bresenham(self.p1, self.p2):
         yield x, y, z, self.blocktype
Example #8
0
 def _renderBlocks(self, symbol_list):
     for cell1, cell2 in zip(symbol_list[:-1], symbol_list[1:]):
         if not isinstance(cell1, Cell):
             continue
         for p in bresenham.bresenham(cell1.origin, cell2.origin):
             yield p + (self.blockTypeButton.block, )  #xxx line