public ContextualMenu(Simulator simulator, double visualPriority, Color color, List<ContextualMenuChoice> choices, int distanceBetweenTwoChoices) { Simulator = simulator; VisualPriority = visualPriority; DistanceBetweenTwoChoices = distanceBetweenTwoChoices; SelectedIndex = 0; Visible = true; Size = Vector3.Zero; Bubble = new Bubble(Simulator.Scene, new PhysicalRectangle(), visualPriority + 0.00005) { Color = color }; TitleSeparator = new Image("PixelBlanc") { Color = color, VisualPriority = visualPriority + 0.00001, Origin = Vector2.Zero }; WidgetSelection = new Image("PixelBlanc") { Color = color, Alpha = 230, VisualPriority = visualPriority + 0.00001, Origin = Vector2.Zero }; Margin = new Vector3(3, 3, 0); Choices = new List<ContextualMenuChoice>(); foreach (var c in choices) AddChoice(c); ChoiceDataChanged = false; ChoiceAvailabilityChanged = false; Layout = 0; Layouts = new List<ContextualMenuLayout>() { new ContextualMenuLayout(0, 0, new Vector2(30, -20)), new ContextualMenuLayout(1, 3, new Vector2(0, -20)) { SubstractSizeY = true }, new ContextualMenuLayout(2, 1, new Vector2(-30, 0)) { SubstractSizeX = true }, new ContextualMenuLayout(3, 2, new Vector2(-30, -20)) { SubstractSizeX = true, SubstractSizeY = true } }; PossibleLayouts = new List<ContextualMenuLayout>(); }
public NextWaveMenu( Simulator simulator, Dictionary<EnemyType, EnemyDescriptor> ennemisQtes, Vector3 positionInitiale, float prioriteAffichage) { Simulator = simulator; EnnemisQtes = ennemisQtes; Position = positionInitiale; PrioriteAffichage = prioriteAffichage; RepresentationsEnnemis = new Dictionary<EnemyType, Image>(); RepresentationsQtes = new Dictionary<EnemyType, Text>(); RepresentationsNiveaux = new Dictionary<EnemyType, Text>(); foreach (var kvp in EnemiesFactory.ImagesEnemies) { Image im = new Image(kvp.Value) { VisualPriority = this.PrioriteAffichage + 0.00001f, SizeX = 4 }; RepresentationsEnnemis.Add(kvp.Key, im); Text t = new Text(@"Pixelite") { VisualPriority = this.PrioriteAffichage, SizeX = 2 }; RepresentationsQtes.Add(kvp.Key, t); t = new Text(@"Pixelite") { VisualPriority = this.PrioriteAffichage, SizeX = 1 }; RepresentationsNiveaux.Add(kvp.Key, t); } Bubble = new Bubble(Simulator.Scene, new PhysicalRectangle(), this.PrioriteAffichage + 0.0001f); Bubble.BlaPosition = 1; Visible = false; }
public PowerUpsMenu(Simulator simulator, Vector3 position, double visualPriority) { Simulator = simulator; VisualPriority = visualPriority; Position = position; TextSize = 2; ImageSize = 2; DistanceBetweenTwoChoices = new Vector3(30, 30, 0); PowerUpsLayout = new Vector3(4, 4, 0); PowerUpPriceTitleAndCost = new Text(@"Pixelite") { SizeX = TextSize, VisualPriority = VisualPriority + 0.001f }; PowerUpDescription = new Text(@"Pixelite") { SizeX = TextSize - 1, VisualPriority = VisualPriority + 0.001f }; PowerUpPriceBubble = new Bubble(Simulator.Scene, new PhysicalRectangle(0, 0, 100, 30), VisualPriority + 0.002) { BlaPosition = 3 }; ColorPowerUpAvailable = Color.White; ColorPowerUpNotAvailable = Color.Red; ImagesPowerUpsBuy = new Dictionary<PowerUpType, Image>(PowerUpTypeComparer.Default); ImagesPlaceHolders = new Dictionary<PowerUpType, Image>(PowerUpTypeComparer.Default); ImagesTurretsPowerUps = new Dictionary<PowerUpType, Turret>(PowerUpTypeComparer.Default); HumanBattleship = new PowerUpsBattleship(Simulator, VisualPriority + 0.005f); }