private Image GenerateBuildingImage() { Bitmap bmp = new Bitmap(base.Width, base.Height); using (Graphics g = Graphics.FromImage(bmp)) { g.DrawImage(World.Biome[BiomeID].Terrain, 0, 0, base.Width, base.Height); string buildingName = BuildingName; if (BuildingID == 0) { if (World.Region[RegionID].Type == RegionType.Capital) { buildingName = "Capital Pallace"; } else { buildingName = "City Pallace"; } } if (BuildingID == 0) { g.DrawImage(DrawingPlus.LoadImage(NarivianClass.AssetsDirectory + World.AssetsPack + "\\Buildings\\" + World.Culture[CultureID].Name + "\\Small\\" + buildingName + ".PNG"), 0, 0, base.Width, base.Height); } else { g.DrawImage(World.Building[BuildingID].Icon[CultureID], 0, 0, base.Width, base.Height); } } return((Image)bmp); }
public RegionBar() { Size = new System.Drawing.Size(240, 36); InitializeComponent(); AddControls(); lblRegionName.Image = DrawingPlus.LoadImage(NarivianClass.PanelsDirectory + "Region Name.PNG"); }
public frmRecruit(frmGame frmGame) { InitializeComponent(); this.frmGame = frmGame; unitCard.BackColor = frmGame.World.Faction[frmGame.Player].Color; pbMoney.Image = DrawingPlus.LoadImage(NarivianClass.IconsDirectory + "Money.PNG"); lblMoney.Text = frmGame.World.Faction[frmGame.Player].Money + " gold"; SelectUnit(1); }
protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; Rectangle r = new Rectangle(0, (base.Size.Height - 16) / 2, 16, 16); Image img; Brush fb; int dotSize = 5; g.SmoothingMode = SmoothingMode.AntiAlias; if (Enabled) { fb = new SolidBrush(ForeColor); } else { fb = new SolidBrush(ColorTranslator.FromHtml("#A0A0A0")); } base.OnPaint(e); if (Selected == false) { if (Clicked == false) { img = DrawingPlus.LoadImage(NarivianClass.PanelsDirectory + "RadioButton\\Idle.PNG", false); } else { img = DrawingPlus.LoadImage(NarivianClass.PanelsDirectory + "RadioButton\\Clicked.PNG", false); } } else { img = DrawingPlus.LoadImage(NarivianClass.PanelsDirectory + "RadioButton\\Selected.PNG", false); } if (img != null) { g.DrawImage(img, r); } else { g.FillEllipse(new SolidBrush(BoxColor), r); } if (Checked) { g.FillEllipse(fb, new Rectangle( r.X + (r.Width - dotSize) / 2, r.Y + (r.Height - dotSize) / 2, dotSize, dotSize)); } }
public Notice() { InitializeComponent(); InitializeStyles(); InitializeButtons(); InitializeDrag(); BackgroundImage = DrawingPlus.LoadImage(NarivianClass.NoticesDirectory + "Background.PNG"); Cursor = CustomCursor.Load("Default.CUR"); Sound.Play("Notice\\Notice.MP3"); BringToFront(); }
public static DialogResult Show(string msg, string title, string imageSound) { Me = new Notice(); Me.pbImage.Image = DrawingPlus.LoadImage(NarivianClass.NoticesDirectory + imageSound + ".PNG"); Me.lblMessage.Text = msg; Me.lblTitle.Text = title; Sound.Play("Notice\\" + imageSound + ".MP3"); Me.ShowDialog(); return(dialogResult); }
public frmBuild(frmGame frmGame) { InitializeComponent(); this.frmGame = frmGame; BuildingID = -1; RegionID = frmGame.selectedRegion; World world = frmGame.World; pbMoney.Image = DrawingPlus.LoadImage(NarivianClass.IconsDirectory + "Money.PNG"); pbMoney2.Image = pbMoney.Image; lblMoney.Text = frmGame.World.Faction[frmGame.Player].Money.ToString(); UpdateBuildingList(); }
private void OnDraw(object sender, DrawToolTipEventArgs e) { Graphics g = e.Graphics; Color clrFaction = Faction.Color; int titleTextSpacer = 1; int borderSize = 1; Rectangle r = new Rectangle(1, 1, e.Bounds.Width - 2, e.Bounds.Height - 2); Rectangle rTitle = new Rectangle(r.X, r.Y, r.Width, 16); Rectangle rBody = new Rectangle(r.X, r.Y + rTitle.Height + borderSize, r.Width, r.Height - rTitle.Height - borderSize); g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; g.Clear(Color.Black); // Header DrawingPlus.DrawBilinearHorizontalGradient(g, rTitle, clrFaction, 2); // Body g.FillRectangle(new LinearGradientBrush(e.Bounds, clrFaction, Color.White, 45f), rBody); // Faction Symbol g.DrawImage(DrawingPlus.ResizeImage(Faction.Symbol, 39, 39), new Point(1, rBody.Y + (rBody.Height - 39) / 2)); // Resource Icon if (Region.Resource != 0) { g.DrawImage((DrawingPlus.ResizeImage(Resource.Icon, 16, 16)), new Point(titleTextSpacer, 1)); titleTextSpacer += 17; } // Religion Icon if (Region.DominantReligion != 0) { g.DrawImage((DrawingPlus.ResizeImage(Religion.Icon, 16, 16)), new Point(titleTextSpacer, 1)); titleTextSpacer += 17; } // Capital Icon if (Region.Type == RegionType.Capital) { Image imgCapital; if (Region.State == RegionState.Free) { imgCapital = DrawingPlus.ResizeImage(DrawingPlus.LoadImage(NarivianClass.IconsDirectory + "Capital.PNG"), 16, 16); } else { imgCapital = DrawingPlus.ResizeImage(DrawingPlus.LoadImage(NarivianClass.IconsDirectory + "Capital Other.PNG"), 16, 16); } g.DrawImage(imgCapital, new Point(e.Bounds.Width - 17, 1)); } // Title g.DrawString(Region.Name, new Font("Microsoft Sans Serif", 10, FontStyle.Bold), Brushes.Black, new Point(rTitle.X + titleTextSpacer, rTitle.Y)); // Message g.DrawString(e.ToolTipText, new Font("Microsoft Sans Serif", 8), Brushes.Black, new PointF(40, rBody.Y + 2)); // Border //g.DrawRectangle(new Pen(Color.Black, borderSize * 2), new Rectangle( //e.Bounds.X, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height - 1)); //g.DrawLine(new Pen(Color.Black, borderSize), new Point(0, 17), new Point(e.Bounds.Width, 17)); }