Okay wizards - I am trying to make a ring menu. I have a symbol for each available weapon and I want that symbol to appear at a certain location on the ring.
If there is only one symbol, it needs to be at the top of the ring. If there are two symbols: one on top, one on bottom. If there are three, each one appears 1/3 of the distance around the circumference of the circle. And so on and so forth.
Here’s what I have so far:
public function generateMenu(arsenal:Vector.<Weapon>):void {
var ws:WeaponSymbol;
var circumference:Number = 2 * Math.PI * RING_MENU_RADIUS;
var slices:uint = arsenal.length - 1;
_ringBase = new MovieClip();
_ringBase.graphics.beginFill(0x00);
_ringBase.graphics.drawCircle(_stage.stageWidth/2,_stage.stageHeight/2,RING_MENU_RADIUS);
_ringBase.graphics.endFill();
_stage.addChild(_ringBase);
_weaponSymbols = new Vector.<WeaponSymbol>();
for(var i:uint = 0; i < arsenal.length; i++) {
ws = new WeaponSymbol();
ws.gotoAndStop(arsenal*.getAmmoType());
ws.x = (_stage.stageWidth/2) - (ws.width/2);
ws.y = (_stage.stageHeight/2) - RING_MENU_RADIUS - (ws.height/2);
_weaponSymbols.push(ws);
_stage.addChild(_weaponSymbols[_weaponSymbols.length-1]);
}
}
Any ideas?