X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=bin%2Fspriter.sh;h=4698d634ebff5a52774a4b56d29f6c8664c41687;hb=747d3972d411c6e2d2b9bcd9f9bcf69509cfa2bf;hp=bc53357f7448af90f911653159adf83192095113;hpb=50268bd3d714449096bceea360c2fcac400efd0d;p=brisk-img.git diff --git a/bin/spriter.sh b/bin/spriter.sh index bc53357..4698d63 100755 --- a/bin/spriter.sh +++ b/bin/spriter.sh @@ -19,6 +19,13 @@ h=$(identify -format "%h" ${fold}/00${sfx}.png) convert -size $((w * 9))x$((h * 5)) xc:none ${fou}${sfx}_bg.png convert -size $((h * 9))x$((w * 5)) xc:none ${fou}${sfx}_oriz_bg.png +convert -size ${w}x${h} xc:none ${fou}${sfx}_empty.png +convert -size ${h}x${w} xc:none ${fou}${sfx}_empty_ea.png +cp ${fou}${sfx}_empty_ea.png ${fou}${sfx}_empty_we.png +cssname="${fou}${sfx}.css" +rm -f $cssname +touch $cssname + for direction in "" "_ea" "_we"; do horiz_sfx="" if [ "$direction" != "" ]; then @@ -36,6 +43,17 @@ for direction in "" "_ea" "_we"; do y=$(((card % 5) * w)) fi + card_id=$(printf "%02d" "$((seed * 10 + card))") + if [ "$card_id" = "40" ]; then + card_id="cover" + fi + cat <> $cssname +img[data-card-id="${card_id}${direction}"] { + background: url('img/cards_xx${direction}.png') -${x}px -${y}px; +} + +EOF + fin_no=$(printf "%s/%02d%s.png" "$fold" "$((seed * 10 + card))" "$sfx") fin=$(printf "%s/%02d%s%s.png" "$fold" "$((seed * 10 + card))" "$sfx" "$direction") if [ $seed -lt 4 ]; then @@ -62,4 +80,4 @@ for direction in "" "_ea" "_we"; do echo "Created ${fou}${sfx}${direction}.png" done -rm ${fou}${sfx}_bg.png ${fou}${sfx}_oriz_bg.png ${fold}/[0-3][0-9]${sfx}*.png +rm ${fold}/[0-3][0-9]${sfx}*.png ${fou}${sfx}_bg.png ${fou}${sfx}_oriz_bg.png