Closed WiSangUk closed 3 years ago
This is a question while using spriteSmith.
When creating a sprite, based on the maximum horizontal and vertical values of each image When creating a sprite, how do I make it the same horizontal and vertical size, and centered within that area?
For example:
(img) ■(1x1) + ■■■(3x1) + ■(1x3) ■ ■
=(sprite) □□□ (area 3x3, img1x1) □■□ □□□ ---------- (padding) □□□ (area 3x3, img3x1) ■■■ □□□ ---------- (padding) □■□ (area 3x3, img1x3) □■□ □■□
We don't have anything built-in for per-image padding but here's a few ways to accomplish this:
gulp
spritesmith
This is a question while using spriteSmith.
When creating a sprite, based on the maximum horizontal and vertical values of each image When creating a sprite, how do I make it the same horizontal and vertical size, and centered within that area?
For example:
(img) ■(1x1) + ■■■(3x1) + ■(1x3) ■ ■
=(sprite) □□□ (area 3x3, img1x1) □■□ □□□ ---------- (padding) □□□ (area 3x3, img3x1) ■■■ □□□ ---------- (padding) □■□ (area 3x3, img1x3) □■□ □■□