Tabletop Simulator

Tabletop Simulator

View Stats:
Ashzwa Jul 3, 2022 @ 8:03pm
UI onClick function with parameter
API Guide shows me this example...
<Button onClick="clickFunction(stringName)" />
but I can't understand how it works.

Is "stringName" parameter sent to the function directly?
such as,
clickFunction("stringName")
Originally posted by Bone White:
The api is just plain wrong, here's a better description:

function clickFunction(player, clickTypeOrValue, id) -- if xml has no value, e.g. onClick="clickFunction()" then clickTypeOrValue will be a number depending on the type of click that triggered onClocl -- if xml has a value, e.g. onClick="clickFunction(stringName)" then clickTypeOrValue will be that value a a string. in this case: "stringName" end

It is much easier (and faster) to get help on the official TTS discord server, specifically the #scripting channel.
< >
Showing 1-1 of 1 comments
The author of this thread has indicated that this post answers the original topic.
Bone White Jul 4, 2022 @ 5:07pm 
The api is just plain wrong, here's a better description:

function clickFunction(player, clickTypeOrValue, id) -- if xml has no value, e.g. onClick="clickFunction()" then clickTypeOrValue will be a number depending on the type of click that triggered onClocl -- if xml has a value, e.g. onClick="clickFunction(stringName)" then clickTypeOrValue will be that value a a string. in this case: "stringName" end

It is much easier (and faster) to get help on the official TTS discord server, specifically the #scripting channel.
Last edited by Bone White; Jul 4, 2022 @ 5:07pm
< >
Showing 1-1 of 1 comments
Per page: 1530 50