def draw(self, surface: Surface): value = self.value text = self.format_value(value) buf = self.font.render(text, True, self.fg_color) frame = surface.get_rect() blit_in_rect(surface, buf, frame, self.align, self.margin)
def draw_TAG_bullet(self, surf, bg, fg, shape, text, item_text, lvl): r = self.get_bullet_rect(surf, lvl) meth = getattr(self, 'draw_%s'%shape, None) if meth and config.nbtTreeSettings.useBulletStyles.get(): meth(surf, bg, r) self.draw_item_text(surf, r, item_text) else: self.draw_deadend_bullet(surf, self.bullet_color_inactive, fg, shape, text, item_text, lvl) if text and config.nbtTreeSettings.useBulletStyles.get() and config.nbtTreeSettings.useBulletText.get(): buf = self.font.render(text, True, fg or self.fg_color) blit_in_rect(surf, buf, r, 'c') if config.nbtTreeSettings.useBulletImages.get(): self.draw_item_text(surf, r, item_text)
def draw_image(surf, bg, r): blit_in_rect(surf, bg, r, 'c')
def draw_item(self, theSurface: Surface, n: int, theRect: Rect): buf = self.font.render(self.labels[n], True, self.fg_color) blit_in_rect(theSurface, buf, theRect, self.align, self.margin)
def draw_item(self, surface: Surface, imageIndex: int, rect: Rect): image = self.images[imageIndex] blit_in_rect(surface, image, rect, self.align, self.margin)