drk Posted March 17, 2012 Share 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? Link to comment
Kenix Posted March 17, 2012 Share Posted March 17, 2012 You need label text length? Or you mean label x position? Link to comment
drk Posted March 17, 2012 Author Share Posted March 17, 2012 Not label x position, but the end of the label text position. tonumber? Why tonumber? lol Link to comment
Kenix Posted March 17, 2012 Share 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 Link to comment
drk Posted March 17, 2012 Author Share Posted March 17, 2012 idk anyway I found a function "guiLabelGetTextExtent" I will try it. Link to comment
Cadu12 Posted March 17, 2012 Share Posted March 17, 2012 What are you talking about? Text Width? Link to comment
Kenix Posted March 17, 2012 Share Posted March 17, 2012 Ok i create 2 functions. Test it. Link to comment
drk Posted March 17, 2012 Author Share Posted March 17, 2012 Ok tnx Kenix. What are you talking about? Text Width? smth like that Link to comment
drk Posted March 17, 2012 Author Share 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. Link to comment
drk Posted March 17, 2012 Author Share Posted March 17, 2012 Much big. Sending by PM... 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