public void Initalize(IEnumerable <object> controls, int maxElements) { radios.Clear(); var Ypos = position.y; var Xpos = position.x; var i = 0; foreach (var item in controls) { if (i % ItemsInCollumn == 0 && i != 0) { Xpos += 40; Ypos = position.y; } var radio = new IndexedButton(new Vector2(Xpos, Ypos), item, 30, changeSelection, Drawer, Mouse); radios.Add(radio); Ypos -= 30; i++; if (i == maxElements) { break; } } }
public SelectionEventArgs(IndexedButton radio) { this.radio = radio; }