Advertisement Create a free account

Centre-Aligned Small Tokens on the Square Grid

Score + 23
1439741660
I'm proposing the suggestion that the smaller tokens center on the middle when snapping to the grid (like they do on the hex grid) - The current way just doesn't look aesthetically pleasing to the eye on a square grid. Currently any token smaller than 1 unit (70x70 pixel) snaps to the top right of the square. I realise that we can set tokens to 'Is Drawing' and have them move around free-form - But when they're creature tokens, the ease and uniformity of them snapping-to-grid makes things much smoother during game-time. I've had a look around with my best keywords for a suggestions & ideas post on the subject but I cannot find any regarding this (if there is such a thread, please let me know).
OMG, yes! This would be fantastic. It's very annoying having to hold down ALT to get the token where I want it.  Every token should align to grid center. +1 indeed!
1440506111

Edited 1440592105
The Aaron
Forum Champion
API Scripter
It won't help everyone, but in the interim if you have a Pro Subscription, you can do this with the API pretty easily: on('ready', function(){     "use strict";     on('change:graphic',function(obj,prev){         if( ( _.contains(['gmlayer','objects'],obj.get('layer')) ) &&             ( !obj.get('isdrawing') ) &&             ( obj.get('left') !== prev.left || obj.get('top') !== prev.top) &&             ( obj.get('width') < 70 || obj.get('height') < 70) ){             obj.set( {                 left: obj.get('left')+35-(obj.get('width')/2),                 top:  obj.get('top')+35-(obj.get('height')/2)             });         }     }); }); Edit: changed to ignore drawings.
+1 I play as a tiny beast (cat) and having a cat scaled to a 5ft grid ruins a lot of fun and creates confusion when moving through another creatures tile (as DM has to remember I am tiny, not Medium)  So having it so we can scale the cat icon to a tiny scale, but center on the grid, would be extremely useful.
1485692286
The Spades Lie
Sheet Author
The API script that Aaron provides is fine. As long as you keep the maps to the default scale of 5ft for 1 unit square. If you change the maps grid size. i.e.  10ft for 0.5 unit square, then unfortunately the tokens will snap to the centre of a grid axis and not the centre of the squares. Its really annoying because I thought I had found a fix ! !
1485725172

Edited 1485725191
Ziechael
Forum Champion
Sheet Author
API Scripter
Another note from my last session using Aaron's snippet (thin windy caves) the centring of a token can cause it to cross dynamic lighting lines... oops. Poor halfling rogue was constantly peeking behind the curtain lol.
1485788943
The Aaron
Forum Champion
API Scripter
Good points!  I can probably fix both of those issues in a couple days. What would be the best way to handle the "through the wall" issue? Have it stop at the wall or push up against it?
1485793638
Ziechael
Forum Champion
Sheet Author
API Scripter
'Stop at' would probably be best to prevent token bleed. Not really an issue for player tokens but for those little monsters behind the cave walls it would prevent premature exposure?
1494878726
The Spades Lie
Sheet Author
Any luck Aaron on these fixes? :-)
1494972648

Edited 1494972806
The Spades Lie
Sheet Author
Hmmm. Seems like this is simply thinking around the box. Aaron does the hard part and all I had to do was fiddle with mathematics. Half a scale, so half the numbers in the script. Simple! on('ready', function(){     "use strict";     on('change:graphic',function(obj,prev){         if( ( _.contains(['gmlayer','objects'],obj.get('layer')) ) &&             ( !obj.get('isdrawing') ) &&             ( obj.get('left') !== prev.left || obj.get('top') !== prev.top) &&             ( obj.get('width') < 35 || obj.get('height') < 35 ) ){             obj.set( {                 left: obj.get('left')+ 17.5 -(obj.get('width')/2),                 top:  obj.get('top')+ 17.5 -(obj.get('height')/2)             });         }     }); }); As long as my Grid is always the same I should be okay. The grid is usually the same so no problem!
1494973812
Sky
Pro
Kissker said: +1 I play as a tiny beast (cat) and having a cat scaled to a 5ft grid ruins a lot of fun and creates confusion when moving through another creatures tile (as DM has to remember I am tiny, not Medium)  So having it so we can scale the cat icon to a tiny scale, but center on the grid, would be extremely useful. Just fyi, you could pad the cat token to medium size (1 square) with empty space all around in GIMP or photoshop.
1494975910

Edited 1494975992
The Spades Lie
Sheet Author
Ha... yeah really. Although that would work for some, I can make tokens fairly quickly and know that padding my tokens could become a little complicated (I have a bunch of tokens already which would require repadding) This API is pretty much doing the trick, so why set up tokens for padding? :-)  Thanks for the suggestion though, I appreciate the help.
1569194334
This has stopped working for me. Anyone have an alternative? Thanks.
1570397728
Heyo! +1 for this not working. Has there been an update to the API related to this?
1570470584
N Robaina
Pro
Marketplace Creator
+1 GREAT IDEA!
1570629624
+1, Not sure why this wasn't a thing when the platform launched.
I make my tokens using tokenstamp 2 and for small tokens I make the size be .5 so when I put them on the table and set the size to 70x70 it has a transparent area around it and it sits in the center.