-
Self Referring snap to whole pixels
I’ve been using this old chestnut to keep vector layers crisp:
newX = Math.round(transform.position[0]);
newY = Math.round(transform.position[1]);
[newX, newY]Is there a simpler (and easier to remember) way to write this? In the position parameter, something like…
Math.round(value)
or
transform.position.toFixed(0)Neither of these work, of course.