Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #this is a method to get the number of visible rows and the largest character length (Godot / GDScript)
- var totalLines = 0
- var maxLineCharset = 0
- func calcTotaisInText(st):
- var aSt = st.split("\n")
- totalLines = aSt.size()
- var i = 0
- while i < totalLines:
- print(aSt[i])
- if aSt[i].length() > maxLineCharset:
- maxLineCharset = aSt[i].length()
- i+=1
- func get_total_lines():
- return totalLines
- func get_total_max_charset():
- return maxLineCharset
- func _ready():
- #insert the call to the function
- calcTotaisInText(get_node("richText").get_text())
Add Comment
Please, Sign In to add comment