Text bounds

General

frogi16

6 years ago

I was polishing my game when I came across a problem. I need to center dynamically changing text on the display. getTextBounds function probably would be helpful, but reference doesn't say much (https://gamebuino.com/academy/reference/graphics-gettextbounds) and I don't really get how to use it only by reading source code of library. And second issue is wheter it takes setFontSize into account?


I would be grateful if someone could give me simple example how does it work.

Thanks!