Mercurial > boomslang
comparison pyntnclick/scenewidgets.py @ 649:e59b119bb0f9 pyntnclick
Evict the last BoomLabel.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 12 Feb 2012 12:27:02 +0200 |
parents | 85153f422522 |
children | 096a568d98aa |
comparison
equal
deleted
inserted
replaced
648:b2c2b6f56291 | 649:e59b119bb0f9 |
---|---|
5 from pygame.color import Color | 5 from pygame.color import Color |
6 from pygame.colordict import THECOLORS | 6 from pygame.colordict import THECOLORS |
7 from pygame.surface import Surface | 7 from pygame.surface import Surface |
8 | 8 |
9 from pyntnclick.state import Thing | 9 from pyntnclick.state import Thing |
10 from pyntnclick.widgets import BoomLabel | 10 from pyntnclick.widgets.text import LabelWidget |
11 | 11 |
12 # XXX: Needs a way to get at resource: | 12 # XXX: Needs a way to get at resource: |
13 from pyntnclick.resources import Resources | 13 from pyntnclick.resources import Resources |
14 get_image = Resources("Resources").get_image | 14 get_image = Resources("Resources").get_image |
15 | 15 |
42 """Display box with text to interact with -- mostly for debugging.""" | 42 """Display box with text to interact with -- mostly for debugging.""" |
43 | 43 |
44 def __init__(self, x, y, text, bg_color=None): | 44 def __init__(self, x, y, text, bg_color=None): |
45 if bg_color is None: | 45 if bg_color is None: |
46 bg_color = (127, 127, 127) | 46 bg_color = (127, 127, 127) |
47 label = BoomLabel(text) | 47 label = LabelWidget((0, 0), text) |
48 label.set_margin(5) | 48 # label.set_margin(5) |
49 label.border_width = 1 | 49 # label.border_width = 1 |
50 label.border_color = (0, 0, 0) | 50 # label.border_color = (0, 0, 0) |
51 label.bg_color = bg_color | 51 # label.bg_color = bg_color |
52 label.fg_color = (0, 0, 0) | 52 # label.fg_color = (0, 0, 0) |
53 image = Surface(label.size) | 53 image = Surface(label.size) |
54 rect = Rect((x, y), label.size) | 54 rect = Rect((x, y), label.size) |
55 label.draw_all(image) | 55 label.draw_all(image) |
56 super(InteractText, self).__init__(image, rect, rect) | 56 super(InteractText, self).__init__(image, rect, rect) |
57 | 57 |