Firstly, the register_mouse_input
parameter should be True
, now the Actual fault is in text_field.py
, You can find it in the ursina/prefabs folder, the get_selected
function sould return selected_text
not selectedText
, the function's code should be:
def get_selected(self):
if not self.selection or self.selection[0] == self.selection[1]:
return None
sel = self._ordered_selection()
start_y = int(sel[0][1])
end_y = int(sel[1][1])
lines = self.text.split('\n')
selected_text = ''
# selected_text = lines[start_y][]
for y in range(start_y, end_y+1):
if y > start_y:
selected_text += '\n'
selected_text += lines[y][(int(sel[0][0]) if y == start_y else 0) : (int(sel[1][0]) if y == end_y else len(lines[y])) ]
return selected_text
I have submitted a pull request on GitHub here, so that they can fix it.