diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-05-20 22:37:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-20 22:37:01 +0200 |
commit | defd9602764c13d1b7753cf879bdbcdf56335b33 (patch) | |
tree | c387b6a7602d1a9737938cf9c3047a56f08d0244 /doc | |
parent | fdea3d48b041cff23013e7a424e57c814ddd4dbd (diff) | |
parent | f7eb426e2ebafc5598b0e43baf37d9a50cea1648 (diff) |
Merge pull request #27886 from LeonardMeagher2/obj_to_string
Allow overriding how scripted objects are converted to strings
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Object.xml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 9c2a65ce5b..0350162792 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -57,6 +57,22 @@ Sets a property. Returns [code]true[/code] if the [code]property[/code] exists. </description> </method> + <method name="_to_string" qualifiers="virtual"> + <return type="String"> + </return> + <description> + Returns a [String] representing the object. Default is [code]"[ClassName:RID]"[/code]. + Override this method to customize the [String] representation of the object when it's being converted to a string, for example: [code]print(obj)[/code]. + </description> + </method> + <method name="to_string"> + <return type="String"> + </return> + <description> + Returns a [String] representing the object. Default is [code]"[ClassName:RID]"[/code]. + Override the method [method _to_string] to customize the [String] representation. + </description> + </method> <method name="add_user_signal"> <return type="void"> </return> |