drk Posted March 17, 2012 Posted March 17, 2012 I need get position x of a label ( pos x where the text end ). idk if it's possible. can someone help?
Kenix Posted March 17, 2012 Posted March 17, 2012 You need label text length? Or you mean label x position?
drk Posted March 17, 2012 Author Posted March 17, 2012 Not label x position, but the end of the label text position. tonumber? Why tonumber? lol
Kenix Posted March 17, 2012 Posted March 17, 2012 (edited) function fLabelGetPositionWithTextLength( uLabel, bRelative, sFont, nScale ) if isElement( uLabel ) then local nX, nY = guiGetPosition( uLabel, bRelative ) return nX + dxGetTextWidth( guiGetText( uLabel ), nScale or 1.0, sFont ), nY end return false end It? function fLabelGetPositionWithTextLength( uLabel, bRelative ) if isElement( uLabel ) then local nX, nY = guiGetPosition( uLabel, bRelative ) return nX + guiLabelGetTextExtent( uLabel ), nY end return false end Updated. You mean position label + text length? Edited March 17, 2012 by Guest
drk Posted March 17, 2012 Author Posted March 17, 2012 idk anyway I found a function "guiLabelGetTextExtent" I will try it.
drk Posted March 17, 2012 Author Posted March 17, 2012 Ok tnx Kenix. What are you talking about? Text Width? smth like that
drk Posted March 17, 2012 Author Posted March 17, 2012 I'm trying this: x = guiLabelGetTextExtent(uLabel) + 0.09 local utLabel = guiCreateLabel ( x, aY, aW + w, aH, cap, aRelative, aParent ) But when I add this the text don't appear anymore, tried 0.01, 0.05 too.
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