Jump to content

Width of tooltip text


MaddDogg

Recommended Posts

Hi!

Now it's time for a problem from my side, again ;)

I'm currently working on a system, in which the user should be able to see tooltips while hovering certain elements on the screen.

I would like to draw this tooltip with a dx rectangle and a dx text on top of it.

My problem at this point is that I can't predict the size (the width) of the text, since it's not monospaced.

What would be now the best approach to get a decent width for my rectangle?

I could just set a fixed width for every character, as if it were monospaced, and say "for 30 chars I will have a width of 30 * 5px * font scale", but this might be off by a lot, when many "thin" characters like 'i' or 'l' are used.

Any ideas?

Thanks for any help!

Madd

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...