public ChooseHeroDialog(int width, int height, List<Hero> heroes) : base(width, height, "Choose hero") { this.heroes = heroes; int i = 0; foreach (var character in this.heroes) { var image = new ScaledImage(new Vector2(50 + 50 * i, 50), character.GetImage(), 0.35f); image.AlterPositionX(image.GetWidth() * i); ImageGameButton button = new ImageGameButton(image); button.RegisterCallbackObject(character); AddRendable(i, button); i++; } }
public ImageGameButton(ScaledImage image) : base(new Vector2(image.GetWidth(), image.GetHeight()), image.Position) { Image = image; }