Ejemplo n.º 1
0
def line_feed_wait_print(string="", style="standard"):
    """
    绘制文本换行并等待玩家按下回车或鼠标左键
    Keyword arguments:
    string -- 要绘制的文本 (default '')
    style -- 绘制文本的默认样式 (default 'standard')
    """
    text_wait = cache_contorl.text_wait
    if text_wait:
        time.sleep(text_wait)
    normal_print(string, style)
    cache_contorl.wframe_mouse.w_frame_up = 0
    flow_handle.askfor_wait()
Ejemplo n.º 2
0
 def draw(self):
     """ 绘制文本 """
     if self.__len__() > self.width:
         now_text = ""
         if self.width > 0:
             for i in self.text:
                 if text_handle.get_text_index(now_text) + text_handle.get_text_index(i) < self.width:
                     now_text += i
                 break
             now_text = now_text[:-2] + "~"
         io_init.era_print(now_text, self.style)
     else:
         io_init.era_print(self.text, self.style)
     if not cache.wframe_mouse.w_frame_skip_wait_mouse:
         flow_handle.askfor_wait()
Ejemplo n.º 3
0
 def draw(self):
     """ 绘制文本 """
     text_list = self.text.split(r"\n")
     for text in text_list:
         now_width = text_handle.get_text_index(text)
         if now_width > self.width:
             now_text = ""
             if now_width > 0:
                 for i in text:
                     if text_handle.get_text_index(now_text) + text_handle.get_text_index(i) < now_width:
                         now_text += i
                     break
                 now_text = now_text[:-2] + "~"
             io_init.era_print(now_text, self.style)
         else:
             io_init.era_print(text, self.style)
         if not cache.wframe_mouse.w_frame_skip_wait_mouse:
             flow_handle.askfor_wait()
         else:
             time.sleep(0.001)
         io_init.era_print("\n")