]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/mediasource/menuskins/wickedz/background_builder/append.sh
initial checkin from nexuiz svn r8756
[xonotic/xonotic.git] / misc / mediasource / menuskins / wickedz / background_builder / append.sh
1 #!/bin/sh
2 #
3 # Created by Tyler "-z-" Mulligan to build the version number for Nexuiz
4 # in the menu.  Released under the GPLv2
5 #
6 # Usage: pass a string to be converted to an image
7 #
8 # ./append 2.5.1
9 #
10 # _ = space
11 # s = svn
12 # z = z0rz (just for fun :-P)
13
14 # build the image out of the string for the version
15 build_version()
16 {
17         version=$1
18         imagified=$(echo $version | sed 's/\(.\)/vfont_\1.tga /g' | sed 's/s/svn/g;s/_\./_dot/g;s/__/_nbsp/g;s/z/z0rz/g' )
19         f=`mktemp`
20         convert $imagified +append TGA:"$f"
21         echo "$f"
22 }
23
24 # place the image string on the big image
25 place_on_bg()
26 {
27         #convert background_25.tga -page +259+41 TGA:"$1" -flatten "$2"/background.tga
28         #convert background_ingame_25.tga -page +259+41 TGA:"$1" -flatten "$2"/background_ingame.tga
29         convert background_l2.tga -draw "image over 259,41 0,0 'TGA:$1'" "$2"/background_l2.tga
30 }
31
32 # test case
33 #build_version 2.4_sz
34
35 f=`build_version "$1"`
36 place_on_bg "$f" "$2"
37 rm -f "$f"