コード例 #1
0
        public override void DrawAsForm(Vector2 Position, Vector2 Size)
        {
            Render.DrawShadowedText(Font.get(), Text.get(), Position - Size / 2,
                                    Vector2.Zero, MyColor.getAsColor() * Alpha, Color.Black * Alpha);

            base.DrawAsForm(Position, Size);
        }
コード例 #2
0
        public override void DrawAsForm(Vector2 Position, Vector2 Size)
        {
            Render.DrawSprite(HudItem.GlowTexture, Position, Size * 32, 0, Color.Black * (Alpha - 0.5f) * 2);

            Arrow1.Draw(Position, Size);
            Arrow2.Draw(Position, Size);

            Render.DrawShadowedText(Font.get(), Text.get(), Position + new Vector2(0, -Size.Y) - Font.get().MeasureString(Text.get()) / 2,
                                    Vector2.Zero, MyColor.getAsColor() * Alpha, Color.Black * Alpha);

            float MinX          = Position.X - Size.X / 2 + Size.Y / 2;
            float MaxX          = Position.X + Size.X / 2 - Size.Y / 2;
            float InterpolatedX = MinX;

            if (SliderValue != null)
            {
                InterpolatedX += (MaxX - MinX) * (SliderValue.get() - MinValue.get()) / (MaxValue.get() - MinValue.get());
            }

            Render.DrawSprite(SliderCircleTexture, Position, new Vector2(Size.Y / 2), 0, Color.Red * Alpha);
            Render.DrawSprite(SliderCircleTexture, new Vector2(InterpolatedX, Position.Y), new Vector2(Size.Y * 0.75f), 0, Color.White * Alpha);
            Render.DrawSprite(SliderBarTexture, Position, Size, 0, Color.White * Alpha);

            base.DrawAsForm(Position, Size);
        }
コード例 #3
0
        public virtual void DrawTechTree(Vector2 Position, float Alpha, PlayerShip Ship)
        {
            if (!GetUnitImagePath().Equals(""))
            {
                if (!SortedTextures.ContainsKey(GetImagePath()))
                {
                    SortedTextures.Add(GetImagePath(), AssetManager.Load <Texture2D>("Textures/ShipGame/TurretPictures/" + GetImagePath()));
                }
            }
            else
            {
                if (!SortedTextures.ContainsKey(GetUnitImagePath()))
                {
                    SortedTextures.Add(GetUnitImagePath(), AssetManager.Load <Texture2D>("Textures/ShipGame/UnitPictures/" + GetUnitImagePath()));
                }
            }

            Color     col = new Color(((Color.White * (1 - RedFlashAlpha)).ToVector3() + (Color.Red * RedFlashAlpha).ToVector3())) * (Alpha) * Alpha;
            Rectangle r   = new Rectangle((int)Position.X, (int)Position.Y, (int)TechTreeGroup.CellSize.X, (int)TechTreeGroup.CellSize.Y);

            Render.DrawSolidRect(r, Color.Black * Alpha);
            Render.DrawSprite(SortedTextures[GetImagePath()], Position + TechTreeGroup.CellSize / 2, TechTreeGroup.CellSize, 0, col);
            Render.DrawOutlineRect(r, 3, col);
            Render.DrawShadowedText(Name, Position, col);
        }
コード例 #4
0
 public void Draw(Vector2 Position, float Alpha)
 {
     if (Alpha > 0)
     {
         Position.X += (1 - Alpha) * 200 + 50;
         Render.DrawShadowedText(Font, Text, Position, Vector2.One, Color.White * Alpha, Color.Black * Alpha);
     }
 }
コード例 #5
0
 public void Draw(Vector2 Position)
 {
     if (EventTexture != null)
     {
         Render.DrawSprite(EventTexture, Position + PositionOffset + new Vector2(0, -64), new Vector2(64), 0, Color.White * Alpha);
     }
     Render.DrawShadowedText(FeedFont, EventString, Position + PositionOffset - FeedFont.MeasureString(EventString) / 2, Vector2.Zero, EventColor * Alpha, Color.Black * Alpha);
 }
コード例 #6
0
 public override void Draw()
 {
     CurrentGroup.DrawAll();
     if (CardPickingMode)
     {
         Render.DrawShadowedText("Position: " + FactionManager.GetFaction(ParentShip.FactionNumber).CardPickPosition.ToString(), new Vector2(100));
     }
 }
コード例 #7
0
 public override void Draw(Vector2 Position, Vector2 Size)
 {
     if (PayToRespawnAlpha > 0)
     {
         Render.DrawShadowedText(FactionEvent.FeedFont, RespawnString, Position - new Vector2(StringWidth / 2, 100),
                                 Vector2.Zero, Color.White * PayToRespawnAlpha, Color.Black * PayToRespawnAlpha);
     }
     FactionManager.GetFaction(ParentShip.FactionNumber).Draw(Position);
 }
コード例 #8
0
        public static void Draw()
        {
            if (performanceDisplay != PerformanceDisplay.None)
            {
                if (performanceDisplay == PerformanceDisplay.BorderTest)
                {
                    Load();

                    Game1.spriteBatch.Begin();

                    Render.DrawOutlineRect(InnerBorderTestRectangle, 3, Color.Yellow);
                    Render.DrawOutlineRect(OuterBorderTestRectangle, 3, Color.Red);

                    Game1.spriteBatch.End();
                }
                else
                {
                    frameCounter++;

                    Load();

                    string fps = string.Format("fps: {0}", frameRate);
                    Game1.spriteBatch.Begin();

                    Render.DrawShadowedText(Font, fps, new Vector2(32), Vector2.One);
                    if (performanceDisplay == PerformanceDisplay.Extended)
                    {
                        Vector2 DrawPos = new Vector2(32, 64);

                        Render.DrawShadowedText(Font, "DrawCalls: " + Render.DrawCalls, DrawPos, Vector2.One);
                        DrawPos += new Vector2(0, 32);

                        Render.DrawShadowedText(Font, "Objects: " + GameManager.GetLevel().getCurrentScene().Children.Count, DrawPos, Vector2.One);
                        DrawPos += new Vector2(0, 32);

                        Render.DrawShadowedText(Font, "EffectUpdates: " + Render.EffectUpdateCalls, DrawPos, Vector2.One);
                        DrawPos += new Vector2(0, 32);

                        Render.DrawShadowedText(Font, Render.RenderTime.get(), DrawPos, Vector2.One);

                        if (GameManager.GetLevel().MyScene != null)
                        {
                            foreach (StopwatchWrapper sw in GameManager.GetLevel().MyScene.Watches)
                            {
                                DrawPos += new Vector2(0, 32);
                                Render.DrawShadowedText(Font, sw.get(), DrawPos, Vector2.One);
                            }
                        }
                    }
                    Game1.spriteBatch.End();

                    Render.DrawCalls = 0;
                }
            }
        }
コード例 #9
0
        public override void Draw(Vector2 Position, Vector2 Size)
        {
            string Text = FactionManager.Factions[ParentShip.FactionNumber].BestSurvivedWave.ToString() + "<>" +
                          FactionManager.Factions[ParentShip.FactionNumber].SurvivedMinutes.ToString() + ":" +
                          FactionManager.Factions[ParentShip.FactionNumber].SurvivedSeconds.ToString() + ":" +
                          FactionManager.Factions[ParentShip.FactionNumber].SurvivedMilliSeconds.ToString() + "\nMining Rings:" +
                          FactionManager.Factions[ParentShip.FactionNumber].MiningPlatformCount.ToString();
            Vector2 TextSize = TimerFont.MeasureString(Text);

            Render.DrawShadowedText(TimerFont, Text, Position - TextSize / 2, Vector2.One, TeamInfo.HudColors[ParentShip.GetTeam()], Color.Black);
        }
コード例 #10
0
 public static void Draw()
 {
     if (GameManager.GetLevel() == null)
     {
         Game1.graphicsDevice.Clear(Color.DarkBlue);
         Game1.spriteBatch.Begin();
         Render.DrawShadowedText(RecieverMessage, new Vector2(128));
         Render.DrawShadowedText("Network Status:\n" + NetworkManager.NetworkStatus, new Vector2(128, 256));
         Game1.spriteBatch.End();
     }
     else
     {
         GameManager.Draw();
         FPSCounter.Draw();
     }
 }
コード例 #11
0
 public override void DrawChildren()
 {
     if (NetworkManager.NetworkStatus != "")
     {
         StringBuilder sb = new StringBuilder(NetworkManager.NetworkStatus);
         int           s  = 0;
         for (int i = 0; i < sb.Length; i++)
         {
             s++;
             if (s > 110 && sb[i] == ' ')
             {
                 sb[i] = '\n';
                 s     = 0;
             }
         }
         Render.DrawShadowedText(sb.ToString(), new Vector2(16, 48));
     }
     base.DrawChildren();
 }
コード例 #12
0
        public override void DrawAsForm(Vector2 Position, Vector2 Size)
        {
            Render.DrawSprite(HudItem.GlowTexture, Position, Size * 3, 0, Color.Black * (Alpha - 0.5f));

            Render.DrawShadowedText(Font.get(), Text.get(), Position - Font.get().MeasureString(Text.get()) / 2,
                                    Vector2.Zero, MyColor.getAsColor() * Alpha, Color.Black * Alpha);

            Render.DrawOutlineRect(Position - Size / 2, Position + Size / 2, 2, Color.White * Alpha);

            if (FlashAlpha > 0)
            {
                Render.DrawSolidRect(Position - Size / 2, Position + Size / 2, Color.White * FlashAlpha * Alpha);
            }
            if (ErrorAlpha > 0)
            {
                Render.DrawSolidRect(Position - Size / 2, Position + Size / 2, Color.Red * ErrorAlpha * Alpha);
            }

            base.DrawAsForm(Position, Size);
        }
コード例 #13
0
        public void Draw(Camera3D DrawCamera, int CurrentTime)
        {
            float AlphaMult = 1 - (CurrentTime - StartingTime) / (float)TextParticleSystem.ParticleLifeTime;

            Vector3 Position3 = Game1.graphicsDevice.Viewport.Project(Position, DrawCamera.ProjectionMatrix, DrawCamera.ViewMatrix, Matrix.Identity);
            Vector2 Position2 = new Vector2(Position3.X, Position3.Y) - Render.CurrentView.Position;

            Position2.X -= TextOffset;
            Position2.Y -= (1 - AlphaMult) * TextParticleSystem.ParticleMoveAmount - TextParticleSystem.ParticleYOffset;

            //Render.DrawOutlineRect(Position2 + ULBox, Position2 + LRBox, 1, Col);

            if (Icon != null)
            {
                Game1.spriteBatch.Draw(Icon, Position2 + IconOffset, Color.White * AlphaMult);
            }

            Render.DrawShadowedText(TextParticleSystem.TextParticleFont, Text, Position2, Vector2.One,
                                    color * AlphaMult, Color.Black * AlphaMult);
        }
コード例 #14
0
        public override void DrawTechTree(Vector2 Position, float Alpha, PlayerShip Ship)
        {
            if (!SortedTextures.ContainsKey(GetImagePath()))
            {
                SortedTextures.Add(GetImagePath(), AssetManager.Load <Texture2D>("Textures/ShipGame/TurretPictures/" + GetImagePath()));
            }

            int CardCost = CardCellsCost;

            if (FactionCostIncreases.ContainsKey(Ship.FactionNumber))
            {
                CardCost += CardCellsCostIncrease * FactionCostIncreases[Ship.FactionNumber];
            }

            Color     col = new Color(((Color.White * (1 - RedFlashAlpha)).ToVector3() + (Color.Red * RedFlashAlpha).ToVector3())) * (Alpha) * Alpha;
            Rectangle r   = new Rectangle((int)Position.X, (int)Position.Y, (int)TechTreeGroup.CellSize.X, (int)TechTreeGroup.CellSize.Y);

            Render.DrawSolidRect(r, Color.Black * Alpha * 0.4f);
            Render.DrawSprite(SortedTextures[GetImagePath()], Position + TechTreeGroup.CellSize / 2, TechTreeGroup.CellSize, 0, col);
            Render.DrawOutlineRect(r, 3, col);
            Render.DrawShadowedText(Name + "\n$ " + CardCost.ToString(), Position, col);
        }
コード例 #15
0
 public virtual void Draw(int Completed, int Max, float Alpha)
 {
     Game1.spriteBatch.Begin();
     Render.DrawShadowedText(Completed.ToString() + '/' + Max.ToString(), new Vector2(100), Color.White * Alpha);
     Game1.spriteBatch.End();
 }
コード例 #16
0
        public override void DrawAsForm(Vector2 Position, Vector2 Size)
        {
            Vector2 FormSize  = Size * Alpha * 1.5f;
            float   FormAlpha = Alpha * DistanceAlpha;

            Render.DrawSprite(WaveCard.UnitPicker, Position, Size * new Vector2((Rand.F() + 6) / 7 * 4, 2.5f), Rotation.get(), MyColor * FormAlpha * 2);

            Render.DrawSprite(WaveCard.UnitBox, Position, FormSize * 1.25f, Rotation.get(), MyColor * (FormAlpha * FormAlpha * 0.3f * (4 + Rand.F())));
            Render.DrawSprite(WaveCard.UnitPicker, Position, FormSize * new Vector2((Rand.F() + 6) / 7, 1), Rotation.get(), MyColor * (FormAlpha * FormAlpha * 0.3f * (4 + Rand.F())));
            Render.DrawSprite(MyTexture, Position, FormSize, Rotation.get(), Color.White * FormAlpha);


            if (FlashAlpha > 0)
            {
                Render.DrawSprite(HudItem.GlowTexture, Position, FormSize * 2, Rotation.get(), MyColor * 1.5f * FlashAlpha * FormAlpha);
            }
            if (ErrorAlpha > 0)
            {
                Render.DrawSprite(HudItem.GlowTexture, Position, FormSize * 2, Rotation.get(), Color.Red * 1.5f * ErrorAlpha * FormAlpha);
                Render.DrawSprite(FactionEvent.LossTexture, Position, FormSize, Rotation.get(), Color.Red * 1.5f * ErrorAlpha * FormAlpha);
            }
            if (SelectedAlpha > 0)
            {
                Render.DrawSprite(FactionEvent.ReadyTexture, Position, FormSize * SelectedAlpha, Rotation.get(), MyColor * SelectedAlpha * 2 * FormAlpha);
                Render.DrawSprite(HudItem.GlowTexture, Position, FormSize, Rotation.get(), MyColor * SelectedAlpha * FormAlpha * 1.5f);
            }

            if (FormAlpha > 0.5 && Font.get() != null)
            {
                float DrawHeight = Position.Y - Size.Y / 2;
                float FontHeight = Font.get().MeasureString(Name.get()).Y;
                DrawHeight -= FontHeight * 2;

                string CostString = "";
                if (MyCard.FactionCostIncreases.ContainsKey(ParentShip.FactionNumber))
                {
                    CostString = "$" + (MyCard.CardCellsCost + MyCard.CardCellsCostIncrease * MyCard.FactionCostIncreases[ParentShip.FactionNumber]).ToString();
                }
                else
                {
                    CostString = "$" + (MyCard.CardCellsCost).ToString();
                }

                Render.DrawShadowedText(Font.get(), Text.get(), new Vector2(Position.X - Font.get().MeasureString(Text.get()).X / 2, DrawHeight),
                                        Vector2.One * 2, Color.White * (FormAlpha - 0.5f) * 2, Color.Black * (FormAlpha - 0.5f) * 2);
                DrawHeight -= FontHeight;
                Render.DrawShadowedText(Font.get(), CostString, new Vector2(Position.X - Font.get().MeasureString(CostString).X / 2, DrawHeight),
                                        Vector2.One * 2, Color.White * (FormAlpha - 0.5f) * 2, Color.Black * (FormAlpha - 0.5f) * 2);
                if (FactionManager.GetFaction(ParentShip.FactionNumber).PickingCards)
                {
                    Vector2 s = Font.get().MeasureString(MyCard.Caption);
                    DrawHeight -= s.Y + 20;
                    //DrawHeight += 2 * FontHeight;
                    Render.DrawSprite(HudItem.GlowTexture, new Vector2(Position.X, DrawHeight + s.Y / 2), s * 6,
                                      0, Color.Black * (FormAlpha - 0.5f) * 2);
                    Render.DrawShadowedText(Font.get(), MyCard.Caption, new Vector2(Position.X - Font.get().MeasureString(MyCard.Caption).X / 2, DrawHeight),
                                            Vector2.One * 2, Color.White * (FormAlpha - 0.5f) * 2, Color.Black * (FormAlpha - 0.5f) * 2);
                }

                if (!MyCard.StrongVs.Equals(""))
                {
                    Render.DrawSprite(MyCard.GetStrongTexture(), Position - Size * 3 / 8 * new Vector2(1, -1), Size / 2, 0, Color.White * (FormAlpha * FormAlpha));
                    Render.DrawShadowedText(Font.get(), MyCard.StrongVs,
                                            new Vector2(Position.X - Size.X * 1 / 8, Position.Y - Font.get().MeasureString(MyCard.StrongVs).Y * 3 / 4 + Size.Y / 2),
                                            Vector2.One * 2, Color.White * (FormAlpha - 0.5f) * 2, Color.Black * (FormAlpha - 0.5f) * 2);
                }
            }

            Render.DrawOutlineRect(Position - FormSize * (FormAlpha - 0.5f), Position + FormSize * (FormAlpha - 0.5f), 2 * FormAlpha, Color.White * (FormAlpha * FormAlpha * FormAlpha));

            base.DrawAsForm(Position, FormSize);
        }
コード例 #17
0
 public static void Draw(SceneView view)
 {
     Render.DrawShadowedText(WaveFont, WaveMessage, view.Size / HUDFormat.BaseScreenSize * HUDFormat.WavePosition - new Vector2(WaveFont.MeasureString(WaveMessage).X / 2, 0)
                             , Vector2.One / (WaveAlpha + 0.1f), Color.White * WaveAlpha, Color.Black * WaveAlpha);
 }
コード例 #18
0
        public override void Draw2D(GameObjectTag DrawTag)
        {
            if (Alpha == 0)
            {
                return;
            }

            float   Size     = InterpolatedDifference.X * SizeMult;
            Vector2 Position = (InterpolatedPositionL + InterpolatedPositionR) / 2 - new Vector2(Size / 2);

            if (CurrentIcon == null)
            {
                if (NeutralManager.MyPattern.CurrentCard.MyIconTexture == null)
                {
                    switch (NeutralManager.MyPattern.CurrentCard.Type)
                    {
                    case "Light":
                        CurrentIcon = WaveCard.LightIcon;
                        break;

                    case "Medium":
                        CurrentIcon = WaveCard.MediumIcon;
                        break;

                    case "Heavy":
                        CurrentIcon = WaveCard.HeavyIcon;
                        break;
                    }
                }
                else
                {
                    CurrentIcon = NeutralManager.MyPattern.CurrentCard.MyIconTexture;
                }
            }

            Render.DrawSprite(CurrentIcon, Position + new Vector2(Size) / 2,
                              new Vector2(Size * Alpha), 0, Color.White * 0.5f * Alpha);
            Render.DrawShadowedText(WaveFont,
                                    CurrentString,
                                    Position + new Vector2(Size / 4, Size), Vector2.One,
                                    CurrentColor * SizeMult * Alpha, Color.Black * SizeMult * Alpha);

            return;


            Render.DrawSprite(Render.BlankTexture, Position + new Vector2(Size) / 2, new Vector2(Size), 0, Color.Black * 0.3f);

            foreach (WallChain n in GameManager.GetLevel().getCurrentScene().Enumerate(typeof(WallChain)))
            {
                n.DrawFromMiniMap(Position, Size, Min, Max);
            }

            foreach (BasicShipGameObject u in AllUnits)
            {
                u.DrawFromMiniMap(Position, Size, Min, Max);
            }

            Render.DrawOutlineRect(Position, Position + new Vector2(Size), 1, Color.White);
            //Render.DrawSprite(HudWaveText, Position + new Vector2(Size / 3, Size * 1.1f), new Vector2(Size * 0.6f, Size * 0.2f), 0);
            //DigitRenderer.DrawDigits(WaveManager.CurrentWave, 2, Position + new Vector2(Size / 1.5f, Size * 1.1f), new Vector2(Size * 0.25f, Size * 0.15f), Color.White);

            base.Draw2D(DrawTag);
        }