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? EPT Team Server Development: 0% Learning C++ | C++ is amazing
Kenix Posted March 17, 2012 Posted March 17, 2012 You need label text length? Or you mean label x position? http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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 EPT Team Server Development: 0% Learning C++ | C++ is amazing
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 http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
drk Posted March 17, 2012 Author Posted March 17, 2012 idk anyway I found a function "guiLabelGetTextExtent" I will try it. EPT Team Server Development: 0% Learning C++ | C++ is amazing
Cadu12 Posted March 17, 2012 Posted March 17, 2012 What are you talking about? Text Width? Ingame nick: Cadu12
Kenix Posted March 17, 2012 Posted March 17, 2012 Ok i create 2 functions. Test it. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
drk Posted March 17, 2012 Author Posted March 17, 2012 Ok tnx Kenix. What are you talking about? Text Width? smth like that EPT Team Server Development: 0% Learning C++ | C++ is amazing
Kenix Posted March 17, 2012 Posted March 17, 2012 Ok tnx Kenix. No problem. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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. EPT Team Server Development: 0% Learning C++ | C++ is amazing
Kenix Posted March 17, 2012 Posted March 17, 2012 Show full code. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
drk Posted March 17, 2012 Author Posted March 17, 2012 Much big. Sending by PM... EPT Team Server Development: 0% Learning C++ | C++ is amazing
drk Posted March 17, 2012 Author Posted March 17, 2012 Problem solved. EPT Team Server Development: 0% Learning C++ | C++ is amazing
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