Beispiel #1
0
 def add_basic_help(self, text, wait_time=None, jail=None):
     helper = Element(text)
     helper.set_style("help")
     helper.finish()
     helper.scale_to_title()
     if wait_time is None:
         wait_time = self._help_wait_time
     helper.set_help_of(self, self._help_wait_time)
     if jail:
         helper.set_jailed(jail)
 def add_basic_help(self, text, wait_time=None, jail=None):
     helper = Element(text)
     helper.set_style("help")
     helper.finish()
     helper.scale_to_title()
     if wait_time is None:
         wait_time=self._help_wait_time
     helper.set_help_of(self, self._help_wait_time)
     if jail:
         helper.set_jailed(jail)
Beispiel #3
0
def make_text(text, font_size=style.FONT_SIZE, font_color=style.FONT_COLOR):
    params = {"font_color":font_color, "font_size":font_size}
    button = Element(text, normal_params=params)
    if not "\n" in text:
        button.set_style("text")
    button.finish()
    if "\n" in text:
        button.scale_to_title()
        button.set_main_color((0,0,0,0))
    return button
def make_text(text, font_size=None, font_color=None):
    if font_size is None: font_size = style.FONT_SIZE
    if font_color is None: font_color = style.FONT_COLOR
    params = {"font_color": font_color, "font_size": font_size}
    button = Element(text, normal_params=params, finish=False)
    if not "\n" in text:
        button.set_style("text")
    button.finish()
    if "\n" in text:
        button.scale_to_title()
        button.set_main_color((0, 0, 0, 0))
    return button
Beispiel #5
0
 def scale_to_title(self, margins=None, state=None):
     """scale to content"""
     margins = style.MARGINS if margins is None else margins
     Element.scale_to_title(self, margins, state)
     self.set_hovered_states(self._states_hover)
 def scale_to_title(self, margins=None, state=None):
     """scale to content"""
     margins = style.MARGINS if margins is None else margins
     Element.scale_to_title(self, margins, state)
     self.set_hovered_states(self._states_hover)