I am making a Math-thingy that requires numbers to be drawn to the screen right aligned.
I’m using this function to draw text:
def drawText(text, font, text_col, x, y):
img = font.render(text, True, text_col)
screen.blit(img, (x, y))
How do I draw the text right aligned instead of left aligned?
I tried to use Python’s .rjust()
function for this, but I’m not using a monospaced font.
Is there anyway to possibly either use .rjust()
to right align it or possibly something else?
New contributor
Earthmars643 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.