Skip to content

Instantly share code, notes, and snippets.

@Patosito
Created September 12, 2016 18:41
Show Gist options
  • Save Patosito/e265c87d59264cd0cdb77819be0981ca to your computer and use it in GitHub Desktop.
Save Patosito/e265c87d59264cd0cdb77819be0981ca to your computer and use it in GitHub Desktop.
Ejemplo colorPicker
function main()
ui.addTextArea(0, "<p align='center'><a href='event:color'>Color</a></p>", nil, 10, 32, 120, 16, nil, nil, 1, true)
end
function eventTextAreaCallback(id, name, cb)
if id==0 then
ui.showColorPicker(0, name, 0xC2C2DA, "Escoge un color para tu nombre")
end
end
function eventColorPicked(id, name, color)
if id==0 and color~=-1 then
tfm.exec.setNameColor(name, color)
end
end
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment