def createBackground(self): if self.bgRect is not None: self.bgRect.delete() self.bgRect = None if self.border is not None: self.border.delete() self.border = None self.bgRect = createRect(self.x, self.y, self.width, self.height, self.bgColor, self.parentFrame.batch, mgGroup) self.border = createRect(self.x, self.y + self.height, self.width, 2, (0, 0, 0, 255), self.parentFrame.batch, highlightGroup)
def setToolCursor(self, newCursor): ''' ''' if (self.toolCursor is None and self.toolCursor == newCursor): return self.deleteToolCursor() self.toolCursor = newCursor if self.toolCursor is not None: x, y, x2, y2 = self.expandMapCoords(self.toolCursor.rect) width = x2 - x height = y2 - y self.toolCursor.vl = createRect(x, y, width, height, self.toolCursor.fillColor, self.parentFrame.batch, self.toolCursorGroup) self.toolCursor.borderVL = createHollowRect( x, y, width, height, self.toolCursor.borderColor, self.parentFrame.batch, self.toolCursorGroup)
def createBg(self): self.border = createRect(self.x, self.y, 2, self.height, (0, 0, 0, 255), self.parentFrame.batch, highlightGroup)
def createRect(self, x, y, width, height, color, batch=None, group=None): if batch is None: batch = self.parentFrame.batch return createRect(self.x + x, self.y + y, width, height, color, batch, group)