MaddDogg Posted July 13, 2010 Share Posted July 13, 2010 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
50p Posted July 13, 2010 Share Posted July 13, 2010 https://wiki.multitheftauto.com/wiki/DxGetTextWidth https://wiki.multitheftauto.com/wiki/DxGetFontHeight Link to comment
MaddDogg Posted July 13, 2010 Author Share Posted July 13, 2010 Wtf.. why didn't I see this before? Thanks and sorry for the inconvenience. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now