protected void DrawGridProgress(IBatchRenderer sbatch) { var outerBounds = FRectangle.CreateByCenter(Position, DrawingBoundingBox); var innerBounds = FRectangle.CreateByCenter(Position, new FSize(INNERSIZE, INNERSIZE)); var scoreRectSize = innerBounds.Width / 8f; FlatRenderHelper.DrawRoundedBlurPanel(sbatch, outerBounds, clickArea.IsMouseDown() ? FlatColors.ButtonPressedHUD : FlatColors.Asbestos, 0.5f * GDConstants.TILE_WIDTH); SimpleRenderHelper.DrawRoundedRectOutline(sbatch, outerBounds.AsInflated(1f, 1f), FlatColors.MidnightBlue, 8, 2f, 0.5f * GDConstants.TILE_WIDTH); for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { var col = ColorMath.Blend(FlatColors.Background, GetCellColor(x, y), AlphaOverride); sbatch.FillRectangle(new FRectangle(innerBounds.X + scoreRectSize * x, innerBounds.Y + scoreRectSize * y, scoreRectSize, scoreRectSize), col); } } for (int i = 0; i <= 8; i++) { sbatch.DrawLine(innerBounds.Left, innerBounds.Top + i * scoreRectSize, innerBounds.Right, innerBounds.Top + i * scoreRectSize, Color.Black * AlphaOverride, Owner.PixelWidth); sbatch.DrawLine(innerBounds.Left + i * scoreRectSize, innerBounds.Top, innerBounds.Left + i * scoreRectSize, innerBounds.Bottom, Color.Black * AlphaOverride, Owner.PixelWidth); } FontRenderHelper.DrawTextCentered(sbatch, Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH, L10N.T(_l10ndescription), FlatColors.TextHUD, Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH)); }
protected override void OnDraw(IBatchRenderer sbatch) { var outerBounds = FRectangle.CreateByCenter(Position, DrawingBoundingBox); var innerBounds = FRectangle.CreateByCenter(Position, new FSize(INNERSIZE, INNERSIZE)); if (!MainGame.Inst.Profile.GetLevelData(Levels.LEVEL_TUTORIAL.UniqueID).HasAnyCompleted()) { var iconBounds = FRectangle.CreateByCenter(Position, new FSize(ICONSIZE + ICONSIZESWIGGLE * FloatMath.Sin(Lifetime), ICONSIZE + ICONSIZESWIGGLE * FloatMath.Sin(Lifetime))); FlatRenderHelper.DrawRoundedBlurPanel(sbatch, outerBounds, clickArea.IsMouseDown() ? FlatColors.ButtonPressedHUD : FlatColors.Asbestos, 0.5f * GDConstants.TILE_WIDTH); SimpleRenderHelper.DrawRoundedRectOutline(sbatch, outerBounds.AsInflated(1f, 1f), FlatColors.MidnightBlue, 8, 2f, 0.5f * GDConstants.TILE_WIDTH); sbatch.FillRectangle(innerBounds, FlatColors.Background); sbatch.DrawStretched(Textures.TexIconTutorial, iconBounds, Color.White * AlphaOverride); FontRenderHelper.DrawTextCentered(sbatch, Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH, L10N.T(_l10ndescription), FlatColors.TextHUD, Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH)); } else { var iconBounds = FRectangle.CreateByCenter(Position, new FSize(ICONSIZE, ICONSIZE)); FlatRenderHelper.DrawRoundedBlurPanel(sbatch, outerBounds, clickArea.IsMouseDown() ? FlatColors.ButtonPressedHUD : FlatColors.Asbestos, 0.5f * GDConstants.TILE_WIDTH); SimpleRenderHelper.DrawRoundedRectOutline(sbatch, outerBounds.AsInflated(1f, 1f), FlatColors.MidnightBlue, 8, 2f, 0.5f * GDConstants.TILE_WIDTH); sbatch.FillRectangle(innerBounds, FlatColors.Background); sbatch.DrawStretched(Textures.TexIconTutorial, iconBounds, FlatColors.Emerald * AlphaOverride); FontRenderHelper.DrawTextCentered(sbatch, Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH, L10N.T(_l10ndescription), FlatColors.TextHUD, Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH)); } }
protected override void DoDraw(IBatchRenderer sbatch, FRectangle bounds) { var bgrect = bounds.ToSubRectangleSouth(Height * 2); if (_cogMovement > 0) { sbatch.DrawCentered(Textures.CannonCogBig, bounds.BottomRight - RAD_INSET - PAD_VEC * (1.5f * (1 - _cogMovement)), FONTSIZE, FONTSIZE, FlatColors.Clouds * _fadeOutAlpha * _fadeOutAlpha * _fadeOutAlpha, _rotation); } SimpleRenderHelper.DrawRoundedRect(sbatch, bgrect.AsDeflated(HUD.PixelWidth * 1), Background * _fadeOutAlpha, CORNER_RADIUS); SimpleRenderHelper.DrawRoundedRectOutline(sbatch, bgrect, Outline * _fadeOutAlpha, 12, HUD.PixelWidth * 2, CORNER_RADIUS); FontRenderHelper.DrawTextCentered(sbatch, _font, FONTSIZE, _text, Foreground * _fadeOutAlpha, bounds.Center); foreach (var particle in _particles) { if (particle.RemainingLifetime < PARTICLE_LIFETIME_FADE) { sbatch.DrawCentered(Textures.TexPixel, particle.Position, particle.Size.Width, particle.Size.Height, particle.Color * (particle.RemainingLifetime / PARTICLE_LIFETIME_FADE), particle.Rotation); } else { sbatch.DrawCentered(Textures.TexPixel, particle.Position, particle.Size.Width, particle.Size.Height, particle.Color, particle.Rotation); } } }
protected void DrawGridGreenLock(IBatchRenderer sbatch) { var outerBounds = FRectangle.CreateByCenter(Position, DrawingBoundingBox); var innerBounds = FRectangle.CreateByCenter(Position, new FSize(INNERSIZE, INNERSIZE)); FlatRenderHelper.DrawRoundedBlurPanel(sbatch, outerBounds, clickArea.IsMouseDown() ? FlatColors.ButtonPressedHUD : FlatColors.Asbestos, 0.5f * GDConstants.TILE_WIDTH); SimpleRenderHelper.DrawRoundedRectOutline(sbatch, outerBounds.AsInflated(1f, 1f), FlatColors.MidnightBlue, 8, 2f, 0.5f * GDConstants.TILE_WIDTH); sbatch.FillRectangle(innerBounds, FlatColors.Background); sbatch.DrawCentered(Textures.TexIconLockOpen, innerBounds.Center, INNERSIZE * 0.75f, INNERSIZE * 0.75f, FlatColors.Nephritis); FontRenderHelper.DrawTextCentered(sbatch, Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH, L10N.T(_l10ndescription), FlatColors.TextHUD, Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH)); }
protected override void OnDraw(IBatchRenderer sbatch) { var outerBounds = FRectangle.CreateByCenter(Position, DrawingBoundingBox); var innerBounds = FRectangle.CreateByCenter(Position, new FSize(INNERSIZE, INNERSIZE)); FlatRenderHelper.DrawRoundedBlurPanel(sbatch, outerBounds, clickArea.IsMouseDown() ? FlatColors.ButtonPressedHUD : FlatColors.Asbestos, 0.5f * GDConstants.TILE_WIDTH); SimpleRenderHelper.DrawRoundedRectOutline(sbatch, outerBounds.AsInflated(1f, 1f), FlatColors.MidnightBlue, 8, 2f, 0.5f * GDConstants.TILE_WIDTH); sbatch.FillRectangle(innerBounds, FlatColors.Background); var scoreRectSize = innerBounds.Width / 8f; for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { var bc = ((x % 2 == 0) ^ (y % 2 == 0)) ? FlatColors.Background : FlatColors.BackgroundLight; if (_ustate == WorldUnlockState.OpenAndUnlocked) { var d = FloatMath.Sqrt((x - 3.5f) * (x - 3.5f) + (y - 3.5f) * (y - 3.5f)); var p = 1 - (d / 4.5f); if (p < 0) { p = 0; } p *= FloatMath.PercSin(_pulseTimer * FloatMath.TAU * 0.25f); bc = ColorMath.Blend(bc, FlatColors.PeterRiver, p); } var col = ColorMath.Blend(FlatColors.Background, bc, AlphaOverride); sbatch.FillRectangle(new FRectangle(innerBounds.X + scoreRectSize * x, innerBounds.Y + scoreRectSize * y, scoreRectSize, scoreRectSize), col); } } sbatch.DrawStretched(Textures.TexIconNetworkBase, innerBounds, Color.White); sbatch.DrawStretched(Textures.TexIconNetworkVertex1, innerBounds, Color.White, VertexRotations[0]); sbatch.DrawStretched(Textures.TexIconNetworkVertex2, innerBounds, Color.White, VertexRotations[1]); sbatch.DrawStretched(Textures.TexIconNetworkVertex3, innerBounds, Color.White, VertexRotations[2]); sbatch.DrawStretched(Textures.TexIconNetworkVertex4, innerBounds, Color.White, VertexRotations[3]); sbatch.DrawStretched(Textures.TexIconNetworkVertex5, innerBounds, Color.White, VertexRotations[4]); sbatch.DrawRectangle(innerBounds, Color.Black, Owner.PixelWidth); FontRenderHelper.DrawTextCentered(sbatch, Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH, L10N.T(_l10ndescription), FlatColors.TextHUD, Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH)); }
protected void DrawLockSwing(IBatchRenderer sbatch) { var outerBounds = FRectangle.CreateByCenter(Position, DrawingBoundingBox); var innerBounds = FRectangle.CreateByCenter(Position, new FSize(INNERSIZE, INNERSIZE)); FlatRenderHelper.DrawRoundedBlurPanel(sbatch, outerBounds, clickArea.IsMouseDown() ? FlatColors.ButtonPressedHUD : FlatColors.Asbestos, 0.5f * GDConstants.TILE_WIDTH); SimpleRenderHelper.DrawRoundedRectOutline(sbatch, outerBounds.AsInflated(1f, 1f), FlatColors.MidnightBlue, 8, 2f, 0.5f * GDConstants.TILE_WIDTH); sbatch.DrawRectangle(innerBounds, Color.Black); var rot = FloatMath.Sin(Lifetime * FloatMath.TAU / _swingPeriode) * FloatMath.RAD_POS_005; sbatch.DrawCentered(Textures.TexIconLock, innerBounds.Center, INNERSIZE * 0.75f, INNERSIZE * 0.75f, Color.White, rot); FontRenderHelper.DrawTextCentered(sbatch, Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH, L10N.T(_l10ndescription), FlatColors.Asbestos, Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH)); }
protected override void OnDraw(IBatchRenderer sbatch) { var outerBounds = FRectangle.CreateByCenter(Position, DrawingBoundingBox); var innerBounds = FRectangle.CreateByCenter(Position, new FSize(INNERSIZE, INNERSIZE)); FlatRenderHelper.DrawRoundedBlurPanel(sbatch, outerBounds, clickArea.IsMouseDown() ? FlatColors.ButtonPressedHUD : FlatColors.Asbestos, 0.5f * GDConstants.TILE_WIDTH); SimpleRenderHelper.DrawRoundedRectOutline(sbatch, outerBounds.AsInflated(1f, 1f), FlatColors.MidnightBlue, 8, 2f, 0.5f * GDConstants.TILE_WIDTH); sbatch.FillRectangle(innerBounds, FlatColors.Background); var scoreRectSize = innerBounds.Width / 10f; for (int x = 0; x < 10; x++) { for (int y = 0; y < 10; y++) { var bc = ((x % 2 == 0) ^ (y % 2 == 0)) ? FlatColors.Background : FlatColors.BackgroundLight; if (_ustate == WorldUnlockState.OpenAndUnlocked) { var d = FloatMath.Sqrt((x - 4.5f) * (x - 4.5f) + (y - 4.5f) * (y - 4.5f)); var p = FloatMath.PercSin(FloatMath.PI * 3 * d / 14f - Lifetime); p *= 0.25f; bc = ColorMath.Blend(bc, FlatColors.PeterRiver, p); } var col = ColorMath.Blend(FlatColors.Background, bc, AlphaOverride); sbatch.FillRectangle(new FRectangle(innerBounds.X + scoreRectSize * x, innerBounds.Y + scoreRectSize * y, scoreRectSize, scoreRectSize), col); } } foreach (var block in Blocks) { sbatch.FillRectangle(block.Item1.WithOrigin(Position), block.Item2); } sbatch.DrawRectangle(innerBounds, Color.Black, Owner.PixelWidth); FontRenderHelper.DrawTextCentered(sbatch, Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH, L10N.T(_l10ndescription), FlatColors.TextHUD, Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH)); }