コード例 #1
0
ファイル: main.py プロジェクト: rthorn/Text-RPG
 def load_command(command):
     for line in wrap(command, int(Save.maxWrap*self.user_maxWrap)).splitlines():
         label = Label(text=line, halign='left', size_hint=(1,None), height=45, color=self.user_input_color, font_name = self.user_font)
         label.bind(size=label.setter('text_size')) 
         resize_one(label)  
         grid.add_widget(label)
     text.text = ''
     if Save.currentFunction[0]!=None:
         f = Save.currentFunction[0]
         new_response(prin(f(command)))
     else:
         new_response(parse(game.pc, command))
     scroll.scroll_y = 0
コード例 #2
0
ファイル: main.py プロジェクト: rthorn/Text-RPG
 def on_command(instance):
     text.commandIndex = 0
     command = text.text
     if " " in command:
         if command[0:command.index(" ")]!="save" and command[0:command.index(" ")]!="load" and Save.saveInput:
             Save.inputs.append(command)
     else:
         if command!="save" and command!="load" and Save.saveInput:
             Save.inputs.append(command)
     if Save.saveInput:
         for line in wrap(command, int(Save.maxWrap*self.user_maxWrap)).splitlines():
             label = Label(text=line, halign='left', size_hint=(1,None), height=45, color=self.user_input_color, font_name = self.user_font)
             label.bind(size=label.setter('text_size'))   
             resize_one(label)
             grid.add_widget(label)
     text.text = ''
     if Save.currentFunction[0]!=None:
         f = Save.currentFunction[0]
         new_response(prin(f(command)))
     else:
         new_response(parse(game.pc, command))
     scroll.scroll_y = 0
     
     Clock.schedule_once(focus)