Jump to content

dxGetTextHeight


MX_Master

Recommended Posts

Sometimes in script I want to know the height of DX text, which will be drawn later with dxDrawText. dxDrawText uses wordBreak with true as value and text can be drawn as multi-line text. This height needs to draw black box (rectangle) under the text. dxGetTextWidth and dxGetFontHeight works fine, but only for one-line texts.

dxDrawText uses DirectX's DrawText function with own word wrap mechanism and this is a problem.

If someone already scripted this function manually, please, give it here as code example. :|

Link to comment
((: thanks for nothing

i think it's better way to write wrap function by myself...

Ok i didnt understand your question but now i do. The problem is that it is determined in the dxDrawText function when and where to wrap the words. So as i said: you can use the function above to determine if wordwrapping is used and then after that do twice the font height of one line.

I know it is hard to understand but i think that is what you are asking for?:)

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...