Gui.get_width incorrect?

I have a chat system almost entirely functional–besides multiplayer functionality. My concept is singleplayer and leads the player using an antique-styled chat interface.

I’ve run into a problem. I have to call the size of the command line in order to tell how many characters it can hold before it truncates the start of the line so that you can continue writing. Well, when I store the size in a variable and recall it, it’s much bigger for some reason. I don’t believe I ran any tests on changing the size, although I will read what I have and see if there is something editing the size. In the meanwhile, because I believe that I did not do so, I’d like to put this out there to see if someone can solve my puzzle.

Ummm. What???

gui.get_width() returns the width of the entire gui scene. From your first screenshot it looks as if you’re really looking for gui.get_size(self.cL).x

1 Like

Thanks! But I don’t understand what you said about gui.get_width(). Are you saying that if I pick any node out of ChatEngine.gui it’s going to return the total size of all the nodes inside it added together?

No, I believe that gui.get_width() (not that it doesn’t take any arguments) returns the width of the entire scene (ie taking into account all nodes).

I was to be honest a bit surprised when I saw gui.get_width(). I thought I knew the APIs inside out by now, but for some reason gui.get_width() has flown below my radar…