Esempio n. 1
0
        public PortalParticleEmitter(Portal p) : base(p.Owner, CreateConfig(p), GDConstants.ORDER_GAME_PORTALPARTICLE)
        {
            Position = p.Position;
            _portal  = p;

            DrawingBoundingBox = new FSize(p.DrawingBoundingBox.Width + 128, p.DrawingBoundingBox.Height + 128);
        }
Esempio n. 2
0
 public SCCMPreviewPanel()
 {
     RelativePosition = FPoint.Zero;
     Size             = new FSize(WIDTH, HEIGHT);
     Alignment        = HUDAlignment.CENTER;
     Background       = FlatColors.Asbestos;
 }
Esempio n. 3
0
        public StarsScoreDisplay(bool count)
        {
            _value.Set(MainGame.Inst.Profile.ScoreStars);
            _value.SetDelta(FloatMath.Max(37, MainGame.Inst.Profile.ScoreStars / 2f));
            if (!count)
            {
                _value.Finish();
            }

            _text = new HUDRawText
            {
                Alignment        = HUDAlignment.CENTERLEFT,
                Text             = ((int)_value.ActualValue).ToString(),
                TextColor        = FlatColors.TextHUD,
                FontSize         = 60f,
                RelativePosition = new FPoint(10 + 40 + 30, 0),
            };

            _icon = new HUDImage
            {
                Image            = Textures.TexIconStar,
                Color            = FlatColors.SunFlower,
                Alignment        = HUDAlignment.CENTERLEFT,
                RelativePosition = new FPoint(10, 0),
                Size             = new FSize(40, 40),
            };

            Alignment        = HUDAlignment.TOPRIGHT;
            RelativePosition = new FPoint(10, 10);
            Size             = new FSize(250, 60);

            IsVisible = (MainGame.Inst.Profile.ScoreStars > 0 || MainGame.Inst.Profile.HasCreatedLevels);

            UpdateRelativePosition();
        }
Esempio n. 4
0
        public ScoreDisplay(bool count)
        {
            _value.Set(MainGame.Inst.Profile.TotalPoints);
            _value.SetDelta(FloatMath.Max(537, MainGame.Inst.Profile.TotalPoints / 4f));
            if (!count)
            {
                _value.Finish();
            }

            _text = new HUDRawText
            {
                Alignment        = HUDAlignment.CENTERLEFT,
                Text             = ((int)_value.ActualValue).ToString(),
                TextColor        = FlatColors.TextHUD,
                FontSize         = 60f,
                RelativePosition = new FPoint(10 + 40 + 30, 0),
            };

            _icon = new HUDImage
            {
                Image            = Textures.TexIconScore,
                Alignment        = HUDAlignment.CENTERLEFT,
                RelativePosition = new FPoint(10, 0),
                Size             = new FSize(40, 40)
            };

            Alignment        = HUDAlignment.TOPRIGHT;
            RelativePosition = new FPoint(10, 10);
            Size             = new FSize(250, 60);
        }
Esempio n. 5
0
        public LaserRenderer(GDGameScreen scrn, LaserNetwork nw, LevelBlueprint bp) : base(scrn, GDConstants.ORDER_GAME_LASER)
        {
            _network = nw;

            Position           = new FPoint(bp.LevelWidth / 2f, bp.LevelHeight / 2f);
            DrawingBoundingBox = new FSize(bp.LevelWidth, bp.LevelHeight);
        }
Esempio n. 6
0
 public WarpNode(GDWorldMapScreen scrn, WarpNodeBlueprint bp) : base(scrn, GDConstants.ORDER_MAP_NODE)
 {
     Position           = new FPoint(bp.X, bp.Y);
     DrawingBoundingBox = new FSize(DIAMETER, DIAMETER);
     Blueprint          = bp;
     Target             = Levels.WORLDS[bp.TargetWorld];
 }
Esempio n. 7
0
        private void Dialoge_Load(object sender, EventArgs e)
        {
            switch (FType.Name.ToString())
            {
            case "Times New Roman":
                radioButton1.Checked = true;
                break;

            case "Arial":
                radioButton2.Checked = true;
                break;

            case "Courier New":
                radioButton3.Checked = true;
                break;
            }

            switch (FSize.ToString())
            {
            case "16":
                radioButton4.Checked = true;
                break;

            case "20":
                radioButton5.Checked = true;
                break;

            case "24":
                radioButton6.Checked = true;
                break;
            }
            textBox1.Text = Olds;
        }
Esempio n. 8
0
 public AttributionsPanel()
 {
     RelativePosition = FPoint.Zero;
     Size             = new FSize(WIDTH, HEIGHT);
     Alignment        = HUDAlignment.CENTER;
     Background       = FlatColors.BackgroundHUD;
 }
Esempio n. 9
0
        private void UpdateOpeningPosition()
        {
            if (openingProgress < 0.5f)
            {
                var stepProgress = openingProgress / 0.5f;

                RelativeCenter = baseButton.RelativeCenter + relSpawnpos * stepProgress;
                Size           = new FSize(width * stepProgress, HEIGHT * stepProgress);
            }
            else if (openingProgress < 0.55f)
            {
                RelativeCenter = baseButton.RelativeCenter + relSpawnpos;
                Size           = new FSize(width, HEIGHT);
            }
            else if (openingProgress < 1f)
            {
                var stepProgress = (openingProgress - 0.55f) / 0.45f;

                var posX = baseButton.RelativeCenter.X + relSpawnpos.X;
                var posY = baseButton.RelativeCenter.Y + relSpawnpos.Y + FloatMath.Min(stepProgress * (btnCount - 1) * (HEIGHT + GAP), btnIndex * (HEIGHT + GAP));

                RelativeCenter = new FPoint(posX, posY);

                Size = new FSize(width, HEIGHT);
            }
            else
            {
                RelativeCenter = baseButton.RelativeCenter + relSpawnpos + new Vector2(0, btnIndex * (HEIGHT + GAP));
                Size           = new FSize(width, HEIGHT);
            }
        }
		protected override void RecalculateState()
		{
			base.RecalculateState();

			float maxDistance = Config.ParticleLifetimeMax * Config.ParticleVelocityMax;
			_boundingbox = vectorPath.Boundings.AsInflated(maxDistance + Config.ParticleSizeFinalMax, maxDistance + Config.ParticleSizeFinalMax).Size;
		}
Esempio n. 11
0
        public WorldPreviewPanel(LevelBlueprint[] bps, Guid unlockID, string iab, int worldnumber)
        {
            _blueprints  = bps;
            _id          = unlockID;
            _iabCode     = iab;
            _worldNumber = worldnumber;

            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.Asbestos;

            _unlockWorldNumber = 1;

            if (UnlockManager.IsUnlocked(Levels.WORLD_001, false) != WorldUnlockState.Unlocked)
            {
                _unlockWorldNumber = 0;
            }
            else
            {
                if (_worldNumber > 2 && UnlockManager.IsUnlocked(Levels.WORLD_002, false) == WorldUnlockState.Unlocked)
                {
                    _unlockWorldNumber = 2;
                }
                if (_worldNumber > 3 && UnlockManager.IsUnlocked(Levels.WORLD_003, false) == WorldUnlockState.Unlocked)
                {
                    _unlockWorldNumber = 3;
                }
                if (_worldNumber > 4 && UnlockManager.IsUnlocked(Levels.WORLD_004, false) == WorldUnlockState.Unlocked)
                {
                    _unlockWorldNumber = 4;
                }
            }
        }
Esempio n. 12
0
        public SubSettingClickZone(SubSettingButton master)
        {
            _master = master;

            Size      = new FSize(0, 0);
            Alignment = HUDAlignment.ABSOLUTE_VERTCENTERED;
        }
        public override void OnInitialize()
        {
            RelativePosition = new FPoint(0, 0);
            Size             = new FSize(14.5f * GDConstants.TILE_WIDTH, 4.0f * GDConstants.TILE_WIDTH);
            Alignment        = HUDAlignment.CENTER;

            AddElement(new HUDDifficultyButton(2, FractionDifficulty.KI_EASY, HUDDifficultyButton.HUDDifficultyButtonMode.ACTIVATED, () => StartTest(FractionDifficulty.KI_EASY))
            {
                Alignment        = HUDAlignment.CENTERLEFT,
                Size             = new FSize(3 * GDConstants.TILE_WIDTH, 3 * GDConstants.TILE_WIDTH),
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 0),
            });

            AddElement(new HUDDifficultyButton(2, FractionDifficulty.KI_NORMAL, HUDDifficultyButton.HUDDifficultyButtonMode.ACTIVATED, () => StartTest(FractionDifficulty.KI_NORMAL))
            {
                Alignment        = HUDAlignment.CENTERLEFT,
                Size             = new FSize(3 * GDConstants.TILE_WIDTH, 3 * GDConstants.TILE_WIDTH),
                RelativePosition = new FPoint(4.0f * GDConstants.TILE_WIDTH, 0),
            });

            AddElement(new HUDDifficultyButton(2, FractionDifficulty.KI_HARD, HUDDifficultyButton.HUDDifficultyButtonMode.ACTIVATED, () => StartTest(FractionDifficulty.KI_HARD))
            {
                Alignment        = HUDAlignment.CENTERLEFT,
                Size             = new FSize(3 * GDConstants.TILE_WIDTH, 3 * GDConstants.TILE_WIDTH),
                RelativePosition = new FPoint(7.5f * GDConstants.TILE_WIDTH, 0),
            });

            AddElement(new HUDDifficultyButton(2, FractionDifficulty.KI_IMPOSSIBLE, HUDDifficultyButton.HUDDifficultyButtonMode.ACTIVATED, () => StartTest(FractionDifficulty.KI_IMPOSSIBLE))
            {
                Alignment        = HUDAlignment.CENTERLEFT,
                Size             = new FSize(3 * GDConstants.TILE_WIDTH, 3 * GDConstants.TILE_WIDTH),
                RelativePosition = new FPoint(11.0f * GDConstants.TILE_WIDTH, 0),
            });
        }
Esempio n. 14
0
 public SettingsButton()
 {
     RelativePosition = new FPoint(8, 8);
     Size             = new FSize(DIAMETER, DIAMETER);
     Alignment        = HUDAlignment.BOTTOMLEFT;
     ClickMode        = HUDButtonClickMode.Single;
 }
Esempio n. 15
0
 public override void OnInitialize()
 {
     RelativePosition = new FPoint(GDConstants.TILE_WIDTH / 2f, 0);
     Size             = new FSize(HUD.Width - 5 * GDConstants.TILE_WIDTH, HEIGHT);
     Alignment        = HUDAlignment.BOTTOMLEFT;
     IsVisible        = false;
 }
        public override void OnInitialize()
        {
            RelativePosition = new FPoint(0, 0);
            Size             = new FSize(12 * GDConstants.TILE_WIDTH, 5 * GDConstants.TILE_WIDTH);
            Alignment        = HUDAlignment.CENTER;

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(8 * GDConstants.TILE_WIDTH, 2 * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_LVLED_BTN_DELLEVEL,
                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 75,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Alizarin, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Pomegranate, 16),

                Click = DoDelete,
            });
        }
Esempio n. 17
0
        public override void OnInitialize()
        {
            Alignment        = HUDAlignment.TOPLEFT;
            RelativePosition = new FPoint(PAD, -_height - PAD - PAD);
            Size             = new FSize(_width, _height);

            IsVisible = !HUD.Enumerate().OfType <AchievementPopup>().Any(p => p.IsVisible);            // only show one achivement at once
        }
        protected override void RecalculateState()
        {
            base.RecalculateState();

            float maxDistance = Config.ParticleLifetimeMax * Config.ParticleVelocityMax;

            _boundingbox = new FSize(maxDistance * 2 + Config.ParticleSizeFinalMax, maxDistance * 2 + Config.ParticleSizeFinalMax);
        }
Esempio n. 19
0
        protected override void RecalculatePosition()
        {
            base.RecalculatePosition();

            RelativePosition = new FPoint(GDConstants.TILE_WIDTH, 0);
            Size             = new FSize(HUD.Width - 6 * GDConstants.TILE_WIDTH, HUD.Height - 2 * GDConstants.TILE_WIDTH);
            Alignment        = HUDAlignment.CENTERLEFT;
        }
Esempio n. 20
0
        protected override void RecalculatePosition()
        {
            base.RecalculatePosition();

            RelativePosition = new FPoint(GDConstants.TILE_WIDTH / 2f, 0);
            Size             = new FSize(HUD.Width - 5 * GDConstants.TILE_WIDTH, HEIGHT);
            Alignment        = HUDAlignment.BOTTOMLEFT;
        }
Esempio n. 21
0
        public RootNode(GDWorldMapScreen scrn, RootNodeBlueprint bp) : base(scrn, GDConstants.ORDER_MAP_NODE)
        {
            Position           = new FPoint(bp.X, bp.Y);
            DrawingBoundingBox = new FSize(DIAMETER, DIAMETER);
            Blueprint          = bp;

            AddOperation(new CyclicLambdaOperation <RootNode>("LevelNode::OrbSpawn", LevelNode.ORB_SPAWN_TIME, false, SpawnOrb));
        }
Esempio n. 22
0
        protected override void RecalculatePosition()
        {
            base.RecalculatePosition();

            RelativePosition = HUD.UnsafeTopRight;
            Size             = new FSize(WIDTH + HUD.SafetyMargins.MarginRight, HUD.RealHeight);
            Alignment        = HUDAlignment.TOPRIGHT;
        }
Esempio n. 23
0
        protected override void RecalculatePosition()
        {
            base.RecalculatePosition();

            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HUD.Height);
            Alignment        = HUDAlignment.TOPRIGHT;
        }
Esempio n. 24
0
        protected override void RecalculateState()
        {
            base.RecalculateState();

            float maxDistance = Config.ParticleLifetimeMax * Config.ParticleVelocityMax;

            _boundingbox = vectorPath.Boundings.AsInflated(maxDistance + Config.ParticleSizeFinalMax, maxDistance + Config.ParticleSizeFinalMax).Size;
        }
		protected override void RecalculateState()
		{
			base.RecalculateState();

			float maxDistance = Config.ParticleLifetimeMax * Config.ParticleVelocityMax;

			_boundingbox = new FSize(maxDistance * 2 + Config.ParticleSizeFinalMax, maxDistance * 2 + Config.ParticleSizeFinalMax);
		}
Esempio n. 26
0
        public MultiplayerRehostPanel(GDMultiplayerServer s)
        {
            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;

            _server = s;
        }
        public MultiplayerJoinLobbyScreen(MultiplayerConnectionType t)
        {
            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;

            Server = new GDMultiplayerClient(t);
        }
Esempio n. 28
0
        public MultiplayerHostPanel(MultiplayerConnectionType t)
        {
            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;

            _server = new GDMultiplayerServer(t);
        }
Esempio n. 29
0
        public MultiplayerMainPanel()
        {
            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;

            _ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_MULTIPLAYER, true);
        }
Esempio n. 30
0
        public SCCMPreviewPanel()
        {
            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.Asbestos;

            //MainGame.Inst.GDBridge.IAB.SynchronizePurchases(GDConstants.IABList);
        }
Esempio n. 31
0
        public MultiplayerClientLobbyPanel(GDMultiplayerClient server)
        {
            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;

            _server = server;
        }
Esempio n. 32
0
		protected override void RecalculatePosition()
		{
			if (HUD == null) return;

			Size = new FSize(HUD.Width, HUD.Height);
			Position = new FPoint(HUD.Left, HUD.Top);
			BoundingRectangle = new FRectangle(Position, Size);
			
			PositionInvalidated = false;
		}
Esempio n. 33
0
        public HUDSCCMScorePanel_Lost(LevelBlueprint lvl, FractionDifficulty d)
        {
            _level             = lvl;
            SelectedDifficulty = d;

            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;
        }
Esempio n. 34
0
		public HUDScorePanel(PlayerProfile.PlayerProfile playerprofile, FractionDifficulty? newDifficulty, bool playerHasWon)
		{
			gainLevel = newDifficulty;
			successScreen = playerHasWon;
			profile = playerprofile;

			RelativePosition = FPoint.Zero;
			Size = new FSize(WIDTH, HEIGHT);
			Alignment = HUDAlignment.CENTER;
			Background = FlatColors.BackgroundHUD;
		}
Esempio n. 35
0
		public HUDSpeedSetButton(HUDSpeedBaseButton baseBtn, GameSpeedModes buttonSpeed)
		{
			speed = buttonSpeed;
			baseButton = baseBtn;

			RelativePosition = baseButton.RelativePosition;
			Size = baseButton.Size;
			Alignment = baseButton.Alignment;

			OverrideEllipseSize = new FSize(REAL_DIAMETER, REAL_DIAMETER);
		}
Esempio n. 36
0
		public Bullet(GameScreen scrn, Cannon shooter, Vector2 pos, Vector2 velo, float entityScale)
			: base(scrn)
		{
			BulletPosition = pos;
			initialVelocity = velo;
			Source = shooter;
			Fraction = Source.Fraction;
			Scale = entityScale;

			DrawingBoundingBox = new FSize(BULLET_DIAMETER, BULLET_DIAMETER);
		}
Esempio n. 37
0
		public HUDPauseButton()
		{
			RelativePosition = new FPoint(12, 12);
			Size = new FSize(DIAMETER, DIAMETER);
			Alignment = HUDAlignment.TOPRIGHT;
#if DEBUG
			ClickMode = HUDButtonClickMode.Single | HUDButtonClickMode.InstantHold;
#else
			ClickMode = HUDButtonClickMode.Single;
#endif

		}
Esempio n. 38
0
		public BulletSplitter(GameScreen scrn, Bullet b, Direction8 d) : base(scrn)
		{
			scale = b.Scale;
			ShapePosition = b.BulletPosition;
			ShapeAlpha = 1f;
			Fraction = b.Fraction;
			velocity = VELOCITIES[(int)d] * FloatMath.GetRangedRandom(0.5f, 2f) + ConvertUnits.ToDisplayUnits(b.PhysicsBody.LinearVelocity)/10f;
			maxLifetime = FloatMath.GetRangedRandom(SPLITTER_LIFETIME_MIN, SPLITTER_LIFETIME_MAX);
			ShapeRotation = FloatMath.ToRadians((int) d * 45f);
			rotationSpeed = FloatMath.GetRangedRandom(-FloatMath.TAU, FloatMath.TAU);

			DrawingBoundingBox = new FSize(Bullet.BULLET_DIAMETER, Bullet.BULLET_DIAMETER) * scale;
		}
		public HUDPauseMenuButton(HUDPauseButton owner, string buttonText, int buttonDepth, int buttonIndex, int totalButtonCount, Action buttonAction)
		{
			baseButton = owner;
			btnIndex = buttonIndex;
			btnCount = totalButtonCount;
			btnText = buttonText;
			btnAction = buttonAction;

			Depth = buttonDepth;

			RelativePosition = new FPoint(12, 12);
			Size = new FSize(0, 0);
			Alignment = owner.Alignment;
		}
Esempio n. 40
0
		protected override void OnBeforeRecalculatePosition()
		{
			switch (Orientation)
			{
				case HUDOrientation.Horizontal:
					Size = new FSize(Size.Width, SeperatorWidth ?? HUD.PixelWidth);
					break;
				case HUDOrientation.Vertical:
					Size = new FSize(SeperatorWidth ?? HUD.PixelWidth, Size.Height);
					break;
				default:
					throw new ArgumentOutOfRangeException();
			}
		}
Esempio n. 41
0
		public LevelNode(GameScreen scrn, Vector2 pos) : base(scrn)
		{
			Position = pos;
			DrawingBoundingBox = new FSize(DIAMETER + 2 * (HEIGHT_EXTENDER - INSET_EXTENDER), DIAMETER + 2 * (HEIGHT_EXTENDER - INSET_EXTENDER));
		}
		private void UpdateOpeningPosition()
		{
			if (openingProgress < 0.5f)
			{
				var stepProgress = openingProgress / 0.5f;

				RelativeCenter = baseButton.RelativeCenter + RELATIVE_SPAWNPOSITION * stepProgress;
				Size = new FSize(WIDTH * stepProgress, HEIGHT * stepProgress);
			}
			else if (openingProgress < 0.55f)
			{
				RelativeCenter = baseButton.RelativeCenter + RELATIVE_SPAWNPOSITION;
				Size = new FSize(WIDTH, HEIGHT);
			}
			else if (openingProgress < 1f)
			{
				var stepProgress = (openingProgress - 0.55f) / 0.45f;

				var posX = baseButton.RelativeCenter.X + RELATIVE_SPAWNPOSITION.X;
				var posY = baseButton.RelativeCenter.Y + RELATIVE_SPAWNPOSITION.Y + FloatMath.Min(stepProgress * (btnCount - 1) * (HEIGHT + GAP), btnIndex * (HEIGHT + GAP));

				RelativeCenter = new Vector2(posX, posY);

				Size = new FSize(WIDTH, HEIGHT);
			}
			else
			{
				RelativeCenter = baseButton.RelativeCenter + RELATIVE_SPAWNPOSITION + new Vector2(0, btnIndex * (HEIGHT + GAP));
				Size = new FSize(WIDTH, HEIGHT);
			}
		}
Esempio n. 43
0
		public Cannon(GDGameScreen scrn, LPCannon blueprint, Fraction[] fractions) : base(scrn)
		{
			Fraction = fractions[blueprint.Player];

			Center = new Vector2(blueprint.X, blueprint.Y);
			Scale = blueprint.Scale;
			DrawingBoundingBox = new FSize(CANNON_OUTER_DIAMETER, CANNON_OUTER_DIAMETER) * Scale;

			Rotation = new DeltaLimitedModuloFloat(FloatMath.ToRadians(blueprint.Rotation), ROTATION_SPEED, FloatMath.TAU);
			
			CannonHealth.SetForce(Fraction.IsNeutral ? 0f : 1f);

			FindParticleSpawns();
		}
		public HUDSpeedBaseButton()
		{
			RelativePosition = new FPoint(8, 8);
			Size = new FSize(62, 62);
			Alignment = HUDAlignment.BOTTOMLEFT;
		}