How to use Text String to give the value to any variable

In order to develop a GUI interface for a vehicle, so need to set its initial velocity through the control panel–the interface. Question is how to use PtText and PtButton to achieve it like input a number 10 and click the button to give this number to a variable “velocity” to set the maximum velocity of the vehicle, anyone have suggestions or examples about PtText? Thank you!

PS: The attachment is an example layout of the control panel.

If you want to set the value, you want to use either PtSetResource or PtSetResources. If you want to get the value, it’s PtGetResource or PtGetResources. If you want to be informed when the value is changed or someone hits a button, look at the callbacks for PtText. You can set the callback in PhAB or programmatically.