mixologee
August 11th, 2021, 00:29
So I am trying to update the text in a label, based off of the value of a number field. Any help would be appreciated.
The code I have tied to the numberfield would be something like:
function onValueChanged()
local nMod = math.floor(getValue());
--...grab some label on my sheet...
local mylabel = getmylabelsomehow;
--...change the value of the text on the label based on nMod from array in another file...
mylabel.setValue(ability_level_itos[nMod]);
end
My array is a simple number to string which is in some_common_data_file.
ability_level_itos = {
["1"] = "somevalue",
["2"] = "somevalue",
["3"] = "somevalue",
["4"] = "somevalue",
["5"] = "somevalue",
};
The code I have tied to the numberfield would be something like:
function onValueChanged()
local nMod = math.floor(getValue());
--...grab some label on my sheet...
local mylabel = getmylabelsomehow;
--...change the value of the text on the label based on nMod from array in another file...
mylabel.setValue(ability_level_itos[nMod]);
end
My array is a simple number to string which is in some_common_data_file.
ability_level_itos = {
["1"] = "somevalue",
["2"] = "somevalue",
["3"] = "somevalue",
["4"] = "somevalue",
["5"] = "somevalue",
};