It is currently March 29th, 2024, 6:56 am

How to get a string value of a measure?

Discuss the use of Lua in Script measures.
User avatar
XANCI
Posts: 104
Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China

How to get a string value of a measure?

Post by XANCI »

Both "Measure:GetValue()" and "tostring(Measure:GetValue())" returns zero
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: How to get a string value of a measure?

Post by poiru »

Measure:GetStringValue() ;)

All functions are listed in the manual.
User avatar
Hydra
Posts: 12
Joined: January 26th, 2012, 11:50 pm
Location: Canada

Re: How to get a string value of a measure?

Post by Hydra »

Code: Select all

local Measure = SKIN:GetMeasure("SomeMeasureName")
local String = Measure:GetStringValue()
or

Code: Select all

local String = SKIN:GetMeasure("SomeMeasureName"):GetStringValue()
Make sure you get the handle for the measure first via GetMeasure() before you perform GetStringValue() on it.
I don't suffer from insanity, I enjoy it.