Public Member Functions | |
| def | __init__ |
| def | build |
| def | add |
| def | remove |
| def | empty |
| def | draw |
| def | render |
| def | handle_event |
| def | move |
| def | set_position |
Public Attributes | |
| style | |
| pos | |
| need_build | |
| background | |
Simple container for other elements
| def interface.gui.gui_elements.Container.__init__ | ( | self, | |
| elements, | |||
| style | |||
| ) |
Elements is a list of GUIElement sub-classes instances and their
position relatively to the top left corner of the container. Each
element will be blit accordingly to its Rect attribute (position
is relative to the container top left corner)
Style should have the following attributes:
size : int * int (if 0,0 the area will fit)
background_color : int * int * int * int (R,G,B and alpha)
background_image : pygame.Surface (to use
Note that unlike the Button class, the
container class requires a
background_color attribute even if
this attribute is specified)
background_pattern : str (should be "unique" or "repeat", only
necessary when background_image is
used)
| def interface.gui.gui_elements.Container.add | ( | self, | |
| sprites | |||
| ) |
add GUIElement sub class instances to the container
| def interface.gui.gui_elements.Container.build | ( | self | ) |
build the background of the container
| def interface.gui.gui_elements.Container.draw | ( | self, | |
| surface | |||
| ) |
draw all elements (except background) on surface
| def interface.gui.gui_elements.Container.empty | ( | self | ) |
remove everything from the container
| def interface.gui.gui_elements.Container.remove | ( | self, | |
| sprites | |||
| ) |
remove GUIElement sub class instances to the container
| def interface.gui.gui_elements.Container.render | ( | self | ) |
draw all the elements over the background and return it
1.7.6.1