diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-05-11 19:05:55 +0200 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-05-11 19:05:55 +0200 |
commit | b42c4cce0f378ca51cd30aa542299bad8c575512 (patch) | |
tree | ae9a32ec327a2697d1e0a7b1d8d237ba1dffe055 | |
parent | 7b471068cf8e4d166d8b0569b489f595213c3b52 (diff) | |
parent | 997476777a83022d4ea2858e3b8127ef44639d86 (diff) |
Merge pull request #4627 from Paulb23/caret_blink_binds
Exposed caret blink to gdscript and properties
-rw-r--r-- | doc/base/classes.xml | 28 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 7 |
2 files changed, 34 insertions, 1 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 643658fbb9..55b74dd3b4 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -37075,6 +37075,34 @@ This method controls whether the position between two cached points is interpola Return the line the editing cursor is at. </description> </method> + <method name="cursor_set_blink_enabled"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + Set the text editor caret to blink. + </description> + </method> + <method name="cursor_get_blink_enabled" qualifiers="const"> + <return type="float"> + </return> + <description> + Gets whether the text editor caret is blinking. + </description> + </method> + <method name="cursor_set_blink_speed"> + <argument index="0" name="blink_speed" type="float"> + </argument> + <description> + Set the text editor caret blink speed. Cannot be less then or equal to 0. + </description> + </method> + <method name="cursor_get_blink_speed" qualifiers="const"> + <return type="float"> + </return> + <description> + Gets the text editor caret blink speed. + </description> + </method> <method name="set_readonly"> <argument index="0" name="enable" type="bool"> </argument> diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 1a465baf49..8df0c6d254 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4178,7 +4178,10 @@ void TextEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("cursor_get_column"),&TextEdit::cursor_get_column); ObjectTypeDB::bind_method(_MD("cursor_get_line"),&TextEdit::cursor_get_line); - + ObjectTypeDB::bind_method(_MD("cursor_set_blink_enabled", "enable"),&TextEdit::cursor_set_blink_enabled); + ObjectTypeDB::bind_method(_MD("cursor_get_blink_enabled"),&TextEdit::cursor_get_blink_enabled); + ObjectTypeDB::bind_method(_MD("cursor_set_blink_speed", "blink_speed"),&TextEdit::cursor_set_blink_speed); + ObjectTypeDB::bind_method(_MD("cursor_get_blink_speed"),&TextEdit::cursor_get_blink_speed); ObjectTypeDB::bind_method(_MD("set_readonly","enable"),&TextEdit::set_readonly); ObjectTypeDB::bind_method(_MD("set_wrap","enable"),&TextEdit::set_wrap); @@ -4213,6 +4216,8 @@ void TextEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_custom_bg_color","color"),&TextEdit::set_custom_bg_color); ObjectTypeDB::bind_method(_MD("clear_colors"),&TextEdit::clear_colors); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled"));; + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") ); ADD_SIGNAL(MethodInfo("cursor_changed")); ADD_SIGNAL(MethodInfo("text_changed")); |