houmain / spright

An advanced sprite sheet packer and sprite annotator.
GNU General Public License v3.0
52 stars 10 forks source link

support mixed number+word pivot declarations #5

Closed scgtrp closed 2 years ago

scgtrp commented 2 years ago

Currently, pivot can be pivot float float or pivot word word, where either word can be an X (left/center/right) or Y (top/middle/bottom) anchor.

This allows freely mixing them, in combinations like pivot center 8.

Additionally, this adds an error message to catch cases like pivot center left.

scgtrp commented 2 years ago

Thinking about it more, I'd also like to be able to say things like pivot center 12-pixels-above-the-bottom, but that sounds harder, and I can't think of syntax that I particularly like without going full expression-parser.

houmain commented 2 years ago

Thanks for the suggestion! Have you thought about this syntax: pivot center + 5 middle - 5 I think this would be expressive enough. I will implement it.