mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-10 04:40:25 +01:00
Implement get_cursor_pos()
This commit is contained in:
parent
8c30bec861
commit
575c3875b6
2 changed files with 7 additions and 0 deletions
|
@ -52,6 +52,7 @@ void Terminal::_bind_methods()
|
|||
// Methods.
|
||||
|
||||
ClassDB::bind_method(D_METHOD("write", "data"), &Terminal::write);
|
||||
ClassDB::bind_method(D_METHOD("get_cursor_pos"), &Terminal::get_cursor_pos);
|
||||
}
|
||||
|
||||
Terminal::Terminal()
|
||||
|
@ -104,6 +105,10 @@ int Terminal::get_rows() const
|
|||
return rows;
|
||||
}
|
||||
|
||||
Vector2 Terminal::get_cursor_pos() const {
|
||||
return Vector2(tsm_screen_get_cursor_x(screen), tsm_screen_get_cursor_y(screen));
|
||||
}
|
||||
|
||||
void Terminal::set_max_scrollback(const int p_max_scrollback)
|
||||
{
|
||||
max_scrollback = std::max(0, p_max_scrollback);
|
||||
|
|
|
@ -48,6 +48,8 @@ namespace godot
|
|||
void set_rows(const int p_rows);
|
||||
int get_rows() const;
|
||||
|
||||
Vector2 get_cursor_pos() const;
|
||||
|
||||
void set_max_scrollback(const int p_max_scrollback);
|
||||
int get_max_scrollback() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue