PROS Controller Issues

So I have been working with the Screen on the V5 controller and I have a question for some weird behavior. I am using the controller_print function and the line parameter is set to zero. When this function is used by itself the test is printed at the bottom of the screen. (Which I believe is line 2) When I put line 0 into the function it prints to the bottom of the screen but then if I print to the first line it then bumps everything up into the proper position. Also, I have not been able to resolve the clear screen and clear line commands either as I mentioned in this post: Unable to clear the Controller Screen. @hotel @edjubuh any input for why the controller is acting this way? Thanks for any help in advance!

1069B - Argonauts

I can’t really say anything other than “that’s just how it works.”

It sounds like you’d be able to manipulate it into doing what you want by printing blank strings to the lines you’re not using though.

1 Like

Here is a little trick for filling non full-width text with spaces. This fixes the problem of having long text linger behind new shorter text.

std::string str = "test";
if(str.size() < maxWidth) { // I use 15 as max width
  str.insert(str.end(), maxWidth - str.size(), ' ');
} else {
  str.erase(str.begin() + maxWidth, str.end());
}

Now str contains the original string with trailing spaces, and is guaranteed to be a certain width.

4 Likes