Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Could something like this be done with the API? (Tokens and Light)

See this xkcd comic: <a href="https://xkcd.com/1663/" rel="nofollow">https://xkcd.com/1663/</a> Click the grow light and use the triangle control to change the direction and angle of the light beam. Use the dot control to change the color of the light. Anyone know how this was accomplished? Was it just HTML and JavaScript? Could the API duplicate something like this for tokens?
1485532071
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Yes, this could be done with the API by leveraging some clever math, but it won't allow you to adjust the direction and angle of the light while its triangle is being dragged. It would have to take effect when the triangle finishes getting moved.
1485539037
Lithl
Pro
Sheet Author
API Scripter
Rabulias said: Anyone know how this was accomplished? Was it just HTML and JavaScript? Could the API duplicate something like this for tokens? It's a Canvas element, just like Roll20 is. However, most of that would require changes to Roll20 itself, not an API script.
Thanks for the replies and the info, Stephen and Brian.