I’m trying to blit text onto my surface using this line:
surface.blit(myFont.render(text, 1, text_color),(200,200))
But I get an error: TypeError: Required argument ‘dest’ (pos 2) not found
I can’t seem to figure out why this is happening…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re not giving a proper rect as the second argument to the surface.blit() function. It needs to be a rect. I suggest the following:
To do it all in one line of code, it might get a bit complicated:
If you want it to be at 200, 200 in the center, the easy, multiple-lined code would look like this:
In order to do it in one line, it will get rediculously long:
As you can see, it would be much easier to do it in the five lines of code rather than the one line like you were trying to do, and it would probably be faster too. Basically what you are having to do for one line is both render the text and get its rect for each parameter of the rect in order to avoid an error. This would take a really long time, especially if you were putting this into a loop. If you are doing it doing the loading, it might be alright, but I would still reccommend the multiple lines.