Esempio n. 1
0
 def _init_text_field(self):
     self.text_field = buttons.TextField()
     self.text_field.set_font(self.font_name)
     self.layout.attach(self.text_field, 0, 0, self.col_count, 1)
     self.text_field.set_background_color(self.white_color)
     self.user_word = [
         letter if index not in self.gap_indices else '_'
         for index, letter in enumerate(self.word)
     ]
     self.text_field.set_text(''.join(self.user_word))
Esempio n. 2
0
 def _init_word_buttons(self):
     words = []
     while len(words) < self.word_count - 1:
         idx = random.randint(0, len(self.container.words_list) - 1)
         word = self.container.words_list[idx]
         if word not in words and word != self.container.word:
             words.append(word)
     words.insert(random.randint(0, self.word_count - 2),
                  self.container.word)
     self.word_buttons = []
     for i, b in enumerate(words):
         one_button = buttons.TextField()
         one_button.set_text(b)
         one_button.set_background_color(self.off_color)
         one_button.set_font(self.word_font)
         self.word_buttons.append(one_button)
         self.layout.attach(one_button, 0, i + 1, 2, 1)
         one_button.set_x_expand(True)
         one_button.set_y_expand(True)
Esempio n. 3
0
 def _init_info(self):
     self.info = buttons.TextField()
     self.add_actor(self.info)
Esempio n. 4
0
 def _init_result_field(self):
     self.result_field = buttons.TextField()
     self.layout.attach(self.result_field, 0, 0, 4, 1)
     self.result_field.set_x_expand(True)
Esempio n. 5
0
 def _init_text_field(self):
     self.text_field = buttons.TextField()
     self.text_field.set_font(self.font_name)
     self.layout.attach(self.text_field, 0, 0, self.letter_grid_col_count,
                        1)
     self.text_field.set_background_color(self.white_color)
Esempio n. 6
0
 def _init_word_field(self):
     self.word_field = buttons.TextField()
     self.layout.attach(self.word_field, 0, 1, 2, 4)
     self.word_field.set_x_expand(True)
     self.word_field.set_y_expand(True)