Skip to content

Instantly share code, notes, and snippets.

//This is very optional - it's for movement with the arrow keys which looks worse than the below commands
on("change:graphic", function(obj, prev) {
if (obj.get("pageid") == findObjs({type: 'page', name: 'Roleplay'})[0].get("_id")) {
//Dragging the token from one part of the screen to another is not a reason to flip them around.
if (obj.get("top") != prev.top) {
return;
}
if (obj.get("left") < prev.left && obj.get("fliph") ) {
obj.set( {
fliph: false