Skip to content

Commit

Permalink
Merge pull request #76 from Rubonnek/easy-array2d-print
Browse files Browse the repository at this point in the history
Override Array2D._to_string()
  • Loading branch information
willnationsdev authored Jul 23, 2020
2 parents 66646da + 59bf4b7 commit 24e1710
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addons/godot-next/references/array_2d.gd
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func transpose() -> Reference:
return load(get_script().resource_path).new(transposed_matrix, false)


func to_str() -> String:
func _to_string() -> String:
var ret: String
var width: int = len(data)
var height: int = len(data[0])
Expand All @@ -316,7 +316,10 @@ func to_str() -> String:
if w == width - 1 and h != height -1:
ret += "\n"
else:
ret += ", "
if w == width - 1:
ret += "\n"
else:
ret += ", "
return ret


Expand Down

0 comments on commit 24e1710

Please sign in to comment.