I find it a bit of a pain working out x,y,w,h of ‘button areas’ on my ipod menus and such. so I wrote a little script which works in Adobe Fireworks (you need to save it as a .jsf file in the command directory of your adobe fireworks installation)
step 1 create UnityHotSpotScripter.jsf in the command directory on your machine.
step 2 load in the 480x320 or 320 x 480 image which your graphics guru has created for you that has the buttons shown on it, into fireworks
step 3 define fireworks ‘Hotspot slices’ for each button giving it a name in the property inspector.
step 4 run the script by selecting it from the bottom of the commands menu in fireworks.
The script then creates a unity JS script snippet into the clipboard which you can then past into your unity JS file.
Have fun
Feel free to post any improvements / comments etc
var fwd=fw.getDocumentDOM();
var idx;
var hdr="class HotBox{\u000D"
hdr +="var zone : Rect;\u000D"
hdr +="var name : String;\u000D"
hdr +="\u000D"
hdr +="function HotBox(tZone : Rect, myName :String){\u000D"
hdr +="zone=tZone;\u000D"
hdr +="name=myName;\u000D"
hdr +="}\u000D"
hdr +="}\u000D"
hdr +="\u000D"
hdr +="var hZones :Array =new Array();\u000D"
hdr +="\u000D"
hdr +="//Generated by FW\u000D"
hdr +="\u000Dfunction initHotZones(){"
var body=hdr;
fwd.selectAll()
//if landscape top left = 0,0
//if portrait top left =0,480
for (idx=0;idx<fw.selection.length;idx++){
ele=fw.selection[idx];
var r;
//Fixed this bit
if (fwd.width==480)r="("+ele.left+","+ (320.0-(ele.height+ele.top)) +","+ele.width+","+ele.height+")";
if (fwd.width==320)r="("+ele.left+","+ (480-ele.top) +","+ele.width+","+ele.height+")";
var line="hZones.Add( new HotBox(Rect"+r+",\u0022"+ele.name+"\u0022));\u000D";
body+=line;
}
body+="}";
fw.getDocumentDOM().clipCopyJsToExecute(body);