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

Question: "To Front" and "To Back" via API

Is there a way to duplicate the "move to Front" and "move to Back" actions (on Tokens) using the API?
1402589654
Lithl
Pro
Sheet Author
API Scripter
page.get('zorder') will tell you how graphics are layered in relation to each other, but it's a read-only property, so you can't alter it.
Hmm. Maybe that will be helpful... thank you for the response!
1402687727
The Aaron
Roll20 Production Team
API Scripter
It's a total hack, but I believe whatever has the current turn is popped to the front. You could save the current list of turns, add your token in question to the front, then restore the list. I'm not sure if the popping happens when the turn order isn't up... That might work...
toFront() and toBack() are commands in the api.
1402700761
The Aaron
Roll20 Production Team
API Scripter
Oh! I was looking for those! Silly me. =D <a href="https://wiki.roll20.net/API:Utility_Functions#Object_Ordering" rel="nofollow">https://wiki.roll20.net/API:Utility_Functions#Object_Ordering</a>
Aha! Thank you HoneyBadger! You're awesome! : )