public override void Draw2D(GameObjectTag DrawTag) { return; if (Drawing) { for (int x = 0; x < CellsX.get(); x++) { for (int y = 0; y < CellsY.get(); y++) { if (CellAlpha[x, y] > 0) { Vector2 TransformedPosition = new Vector2(x, y) * Divisor + Parent2DScene.MinBoundary.get(); Vector3 Position3 = Game1.graphicsDevice.Viewport.Project( new Vector3(TransformedPosition.X, 0, TransformedPosition.Y), StarshipScene.CurrentCamera.ProjectionMatrix, StarshipScene.CurrentCamera.ViewMatrix, Matrix.Identity); Vector2 Position = new Vector2(Position3.X, Position3.Y) - Render.CurrentView.Position; float Size = 6; Render.DrawSolidRect(Position - new Vector2(Size), Position + new Vector2(Size), Color.White * CellAlpha[x, y]); base.Draw2D(DrawTag); } } } } }
public override void Draw2D(GameObjectTag DrawTag) { if (SizeBonus == 0) { return; } Render.DrawSolidRect(InterpolatedPositionL, InterpolatedPositionR, new Color(0, 0, 0, 0.5f)); int i; for (i = 0; i < CurrentCards.Count; i++) { CurrentCards[i].Draw(InterpolatedPositionL + new Vector2(InterpolatedDifference.X * ((0.1f + (float)i) / CurrentCards.Count), InterpolatedDifference.Y * 0.1f), InterpolatedPositionL + new Vector2(InterpolatedDifference.X * ((0.9f + (float)i) / CurrentCards.Count), InterpolatedDifference.Y * 0.9f), i == SelectedSlot ? 1 : OtherAlpha); } if (SinglePlayer || WaveManager.CurrentWave < PickEnemyState.RandomRounds + 1) { Render.DrawSprite(WaveCard.UnitPicker, InterpolatedPositionL + new Vector2((SingleSelectedNode + 0.5f) * InterpolatedDifference.X / CurrentCards.Count, InterpolatedDifference.Y + i * 15), new Vector2(InterpolatedDifference.X / CurrentCards.Count * 1.5f, 90), 0, new Color(1, 0.5f, 0.5f)); } else { i = 0; foreach (int key in TeamFloatingSelection.Keys) { Render.DrawSprite(WaveCard.UnitPicker, InterpolatedPositionL + new Vector2((TeamFloatingSelection[key] + 0.5f) * InterpolatedDifference.X / CurrentCards.Count, InterpolatedDifference.Y + i * 15) , new Vector2(InterpolatedDifference.X / CurrentCards.Count * 1.5f, 90), 0, TeamInfo.GetColor(key)); } } base.Draw2D(DrawTag); }
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); }
protected override void DrawHealthBar(float HealthMult, Vector2 Position, float Size) { Vector2 Offset = new Vector2(Size, 2.5f); Render.DrawSolidRect(Position - Offset, Position + Offset, HealthBackgroundColor); Render.DrawSolidRect(Position - Offset + Vector2.One, Position - Offset + new Vector2((Size * 2 - 2) * HealthMult, 4), TeamInfo.GetColor(GetTeam())); }
public static void Draw() { if (MessageAlpha > 0) { Game1.spriteBatch.Begin(); switch (messageType) { case MessageType.NotAllowed: Render.DrawSolidRect(MasterManager.ProfileMessageRect, Color.Red * MessageBackAlpha * MessageAlpha); Game1.spriteBatch.Draw(MessageTexture, MasterManager.ProfileMessageRect, Color.White * MessageAlpha); break; case MessageType.SignIn: Render.DrawSolidRect(MasterManager.ProfileMessageRect, Color.Green * MessageBackAlpha * MessageAlpha); Game1.spriteBatch.Draw(MessageTexture, MasterManager.ProfileMessageRect, Color.White * MessageAlpha); break; case MessageType.SignOut: Render.DrawSolidRect(MasterManager.ProfileMessageRect, Color.White * MessageBackAlpha * MessageAlpha); Game1.spriteBatch.Draw(MessageTexture, MasterManager.ProfileMessageRect, Color.White * MessageAlpha); break; } Game1.spriteBatch.End(); } }
public void DrawAsHierarchy() { Game1.spriteBatch.DrawString(TopHierarchyParent.Font, Name.get(), HierarchyTextPosition, EditorSelected ? TopHierarchyParent.SelectedTextColor : TopHierarchyParent.HighlightedObject == this ? TopHierarchyParent.HighlightedTextColor : TopHierarchyParent.TextColor); Game1.spriteBatch.Draw(TopHierarchyParent.LineTexture, HierarchyHorizontalLine, TopHierarchyParent.LineColor); if (HierarchyDragRectangle.Contains(TopHierarchyParent.RelativeMouse) && MouseManager.DraggedObject == this) { MouseManager.DraggedMouseAlpha = 1; } if ((HierarchyDragRectangle.Contains(TopHierarchyParent.RelativeMouse) && MouseManager.DraggedObject == null)) { Render.DrawOutlineRect(HierarchyDragRectangle, 1, TopHierarchyParent.LineColor); } else if (MouseManager.DraggedObject == this) { Render.DrawOutlineRect(HierarchyDragRectangle, 1, TopHierarchyParent.LineColor * Math.Max(0.1f, MouseManager.DraggedMouseAlpha)); } else { Render.DrawOutlineRect(HierarchyDragRectangle, 1, TopHierarchyParent.LineColor * 0.1f); if (TopHierarchyParent.HighlightedObject == this && MouseManager.DraggedObject != null && MouseManager.DraggedObject.GetType().IsSubclassOf(typeof(GameObject))) { Render.DrawSolidRect(HierarchyDropRectangle, TopHierarchyParent.LineColor); } } if (HierarchyChildren.Count() > 0) { Game1.spriteBatch.Draw(TopHierarchyParent.LineTexture, HierarchyBoxOutline, TopHierarchyParent.LineColor); Game1.spriteBatch.Draw(TopHierarchyParent.LineTexture, HierarchyBox, TopHierarchyParent.BoxColor); Game1.spriteBatch.Draw(TopHierarchyParent.LineTexture, HierarchyPlusHorizontal, TopHierarchyParent.LineColor); if (!HierarchyExpanded) { Game1.spriteBatch.Draw(TopHierarchyParent.LineTexture, HierarchyPlusVerticle, TopHierarchyParent.LineColor); } else { Game1.spriteBatch.Draw(TopHierarchyParent.LineTexture, HierarchyVerticleLine, TopHierarchyParent.LineColor); } } if (HierarchyExpanded) { foreach (GameObject Child in HierarchyChildren) { Child.DrawAsHierarchy(); } } }
public override void Draw2D(GameObjectTag DrawTag) { return; Vector3 Position3 = Game1.graphicsDevice.Viewport.Project( new Vector3(this.Position.X(), 0, this.Position.Y()), StarshipScene.CurrentCamera.ProjectionMatrix, StarshipScene.CurrentCamera.ViewMatrix, Matrix.Identity); Vector3 Size3 = Game1.graphicsDevice.Viewport.Project( new Vector3(this.Position.X() + this.Size.X(), 0, this.Position.Y()), StarshipScene.CurrentCamera.ProjectionMatrix, StarshipScene.CurrentCamera.ViewMatrix, Matrix.Identity); Vector2 Position = new Vector2(Position3.X, Position3.Y) - Render.CurrentView.Position; float Size = Vector2.Distance(Position, new Vector2(Size3.X, Size3.Y) - Render.CurrentView.Position) / 1.6f; Render.DrawSolidRect(Position - new Vector2(Size), Position + new Vector2(Size), Color.White); base.Draw2D(DrawTag); }
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); }
public void DrawThumbnail() { if (ThumbRectangle != null) { if (SceneThumbnail != null) { Game1.spriteBatch.Draw(SceneThumbnail, ThumbRectangle, Color.White); } Render.DrawSolidRect(ThumbRectangle, ParentLevel.MyScene == this ? Color.Red : ParentLevel.StartingScene == this ? Color.LightGreen : Color.White); Game1.spriteBatch.DrawString(FormFormat.NormalFont, Name.get(), ThumbNamePosition, ParentLevel.MyScene == this ? FormFormat.SelectedTextColor : FormFormat.TextColor); if (ParentLevel.StartingScene == this) { Render.DrawLine(new Vector2(ThumbRectangle.X + 16, ThumbRectangle.Y + 16), new Vector2(ThumbRectangle.X + 16, ThumbRectangle.Y + 48), Color.LightGreen); Render.DrawLine(new Vector2(ThumbRectangle.X + 16, ThumbRectangle.Y + 16), new Vector2(ThumbRectangle.X + 48, ThumbRectangle.Y + 32), Color.LightGreen); Render.DrawLine(new Vector2(ThumbRectangle.X + 16, ThumbRectangle.Y + 48), new Vector2(ThumbRectangle.X + 48, ThumbRectangle.Y + 32), Color.LightGreen); } SceneSelect.self.NeedsToRedraw = true; } }
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); }
public override void Draw(int Completed, int Max, float Alpha) { if (Alpha > 0) { Load(); Game1.spriteBatch.Begin(); Vector2 Position = new Vector2(Game1.ResolutionX, Game1.ResolutionY) / 2; Vector2 Size = new Vector2(Position.Length() * Alpha); Alpha *= 0.75f + Rand.F() * 0.25f; Render.DrawSprite(Gear, Position, Size, Level.Time / 10f, Color.White * Alpha); Size *= 0.8f; Render.DrawSprite(Gear2, Position, Size, Level.Time / 5f, Color.White * (Alpha / 2)); Size *= 0.8f; Render.DrawSprite(Gear3, Position, Size, Level.Time / 2.5f, Color.White * (Alpha / 2)); Size *= 0.8f; Render.DrawSprite(Gear4, Position, Size, Level.Time, Color.White * (Alpha / 4)); Size *= 0.9f; Render.DrawSprite(GearShip, Position, Size, 0, Color.White * (Alpha / 4)); Size *= 0.5f; Position.Y += Size.Y; Render.DrawSolidRect(Position - Size * new Vector2(1, 0.2f), Position + Size * new Vector2(1, 0.2f), Color.Black * Alpha); Size *= 0.85f; Render.DrawSolidRect(Position - Size * new Vector2(1, 0.2f), Position + new Vector2(-Size.X + 2 * Size.X * (float)Completed / Max, Size.Y * 0.2f), Color.White * Alpha); Game1.spriteBatch.End(); } }
public override void Draw2D(GameObjectTag DrawTag) { if (BarTeams.Count == 1) { return; } Render.DrawSolidRect(InterpolatedPositionL, InterpolatedPositionR, new Color(0, 0, 0, 0.5f)); Vector2 BarPositionL = Vector2.Zero; Vector2 BarPositionR = Vector2.Zero; for (int i = 0; i < BarTeams.Count; i++) { BarPositionL = InterpolatedPositionL + InterpolatedDifference / 50 + new Vector2(0, InterpolatedDifference.Y / BarTeams.Count * BarTeams[i].ListPosition); BarPositionR = InterpolatedPositionL + new Vector2(InterpolatedDifference.X * 0.98f, InterpolatedDifference.Y / BarTeams.Count * (BarTeams[i].ListPosition + 0.98f)); Render.DrawSolidRect(BarPositionL, BarPositionR, TeamInfo.Colors[BarTeams[i].Team]); } base.Draw2D(DrawTag); }