public HeroSkillAttrForm() { InitializeComponent(); this.bitmapButtonClose.ImageNormal = PicLoader.Read("ButtonBitmap", "CloseButton1.JPG"); this.nlPageSelector1 = new ControlPlus.NLPageSelector(this, 398, 282, 150); nlPageSelector1.PageChange += nlPageSelector1_PageChange; }
public PeopleViewForm() { InitializeComponent(); this.bitmapButtonClose.ImageNormal = PicLoader.Read("ButtonBitmap", "CloseButton1.JPG"); people = new List <DbRivalState>(); virtualRegion = new VirtualRegion(this); virtualRegion.AddRegion(new PictureRegion(1, 41, 40, 70, 70, PictureRegionCellType.People, 0)); for (int i = 0; i < 20; i++) { int xoff = (i % 5) * cardWidth + 19; int yoff = (i / 5) * cardHeight + 159; SubVirtualRegion region = new PictureAnimRegion(i + 2, xoff, yoff, cardWidth, cardHeight, PictureRegionCellType.People, 0); region.AddDecorator(new RegionTextDecorator(0, 45, 9)); virtualRegion.AddRegion(region); } types = GetPeopleAvailTypes(); for (int i = 0; i < types.Count; i++) { int xoff = i * 26 + 19; int yoff = 125; virtualRegion.AddRegion(new ButtonRegion(i + 30, xoff, yoff, 24, 24, string.Format("MiniPeopleType{0}.JPG", types[i]), string.Format("MiniPeopleType{0}On.JPG", types[i]))); } virtualRegion.RegionEntered += new VirtualRegion.VRegionEnteredEventHandler(virtualRegion_RegionEntered); virtualRegion.RegionLeft += new VirtualRegion.VRegionLeftEventHandler(virtualRegion_RegionLeft); virtualRegion.RegionClicked += new VirtualRegion.VRegionClickEventHandler(virtualRegion_RegionClick); }
public static Image GetImage(string tableName, int id) { string url = ""; if (tableName == "Dna") { url = ConfigData.GetPlayerDnaConfig(id).Url; } else if (tableName == "Samurai") { url = ConfigData.GetSamuraiConfig(id).Figue; } else if (tableName == "Job") { url = ConfigData.GetJobConfig(id).Icon; } else { throw new ApplicationException(string.Format("not implement tablename({0}) in HSIcons.GetImage", tableName)); } string fname = string.Format("{0}/{1}.png", tableName, url); if (!ImageManager.HasImage(fname)) { Image image = PicLoader.Read(tableName, string.Format("{0}.png", url)); ImageManager.AddImage(fname, image); } return(ImageManager.GetImage(fname)); }
public static Image GetEffectImage(string name, int type, bool flip) { string fname = string.Format("Effect/{0}t{1}{2}", name, type, flip ? "f" : ""); if (!ImageManager.HasImage(fname)) { Image image = PicLoader.Read("Effect", string.Format("{0}.PNG", name)); switch (type) { case 1: image.RotateFlip(RotateFlipType.Rotate90FlipNone); break; case 2: image.RotateFlip(RotateFlipType.Rotate180FlipNone); break; case 3: image.RotateFlip(RotateFlipType.Rotate270FlipNone); break; case 4: image.RotateFlip(RotateFlipType.RotateNoneFlipX); break; case 5: image.RotateFlip(RotateFlipType.Rotate90FlipX); break; case 6: image.RotateFlip(RotateFlipType.Rotate180FlipX); break; case 7: image.RotateFlip(RotateFlipType.Rotate270FlipX); break; default: ImagePixelTool.Effect((Bitmap)image, (ImagePixelTool.ImagePixelEffects)(type / 10), type % 10); break; } if (flip) { image.RotateFlip(RotateFlipType.RotateNoneFlipX); } ImageManager.AddImage(fname, image); } return(ImageManager.GetImage(fname)); }
public override void Init(int width, int height) { base.Init(width, height); this.bitmapButtonClose.ImageNormal = PicLoader.Read("ButtonBitmap", "CloseButton1.JPG"); this.bitmapButtonHelp.ImageNormal = PicLoader.Read("ButtonBitmap", "LearnButton.JPG"); show = true; }
public override void Draw(Graphics g, bool isTarget) { base.Draw(g, isTarget); Image markQuest = PicLoader.Read("Map", "SymWarp.PNG"); int drawWidth = markQuest.Width * Width / GameConstants.SceneTileStandardWidth; int drawHeight = markQuest.Height * Height / GameConstants.SceneTileStandardHeight; var destRect = new Rectangle(X - drawWidth / 2 + Width / 8, Y - drawHeight / 2, drawWidth, drawHeight); if (Disabled) { g.DrawImage(markQuest, destRect, 0, 0, markQuest.Width, markQuest.Height, GraphicsUnit.Pixel, HSImageAttributes.ToGray); } else { g.DrawImage(markQuest, destRect, 0, 0, markQuest.Width, markQuest.Height, GraphicsUnit.Pixel); } var targetName = ConfigData.GetSceneConfig(TargetMap).Name; int sceneLevel = ConfigData.GetSceneConfig(TargetMap).Level; Brush brush = Brushes.Wheat; if (sceneLevel > UserProfile.InfoBasic.Level) { targetName = "等级" + sceneLevel; brush = Brushes.Red; } Font fontName = new Font("宋体", 11 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); g.DrawString(targetName, fontName, Brushes.Black, X - drawWidth / 2 + Width / 8 + 1, Y - drawHeight / 2 + 1); g.DrawString(targetName, fontName, Disabled ? Brushes.Gray : brush, X - drawWidth / 2 + Width / 8, Y - drawHeight / 2); fontName.Dispose(); markQuest.Dispose(); }
public SelectJobForm() { InitializeComponent(); bitmapButtonClose.ImageNormal = PicLoader.Read("ButtonBitmap", "CloseButton1.JPG"); bitmapButtonSelect.ImageNormal = PicLoader.Read("ButtonBitmap", "ButtonBack2.PNG"); bitmapButtonSelect.Font = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); bitmapButtonSelect.ForeColor = Color.White; bitmapButtonSelect.IconImage = TaleofMonsters.Core.HSIcons.GetIconsByEName("oth2"); bitmapButtonSelect.IconSize = new Size(16, 16); bitmapButtonSelect.IconXY = new Point(8, 5); bitmapButtonSelect.TextOffX = 8; selectPanel = new NLSelectPanel(8, 38, 154, 400, this); selectPanel.ItemHeight = 35; selectPanel.SelectIndexChanged += selectPanel_SelectedIndexChanged; selectPanel.DrawCell += selectPanel_DrawCell; this.nlPageSelector1 = new NLPageSelector(this, 10, 321, 150); nlPageSelector1.PageChange += nlPageSelector1_PageChange; jobDes = new ColorWordRegion(180, 70, 320, "宋体", 10, Color.White); virtualRegion = new VirtualRegion(this); PictureRegion region = new PictureRegion(1, 178, 266, 48, 48, PictureRegionCellType.HeroSkill, 0); region.AddDecorator(new RegionBorderDecorator(Color.DodgerBlue)); virtualRegion.AddRegion(region); virtualRegion.AddRegion(new PictureRegion(2, 238, 266, 48, 48, PictureRegionCellType.Card, 0)); virtualRegion.AddRegion(new PictureRegion(3, 298, 266, 48, 48, PictureRegionCellType.Card, 0)); virtualRegion.AddRegion(new PictureRegion(4, 358, 266, 48, 48, PictureRegionCellType.Card, 0)); virtualRegion.RegionEntered += virtualRegion_RegionEntered; virtualRegion.RegionLeft += virtualRegion_RegionLeft; }
private void MainForm_Load(object sender, EventArgs e) { string version = FileVersionInfo.GetVersionInfo(Application.ExecutablePath).FileVersion; Text = string.Format("风月传说 v{0}", version); try { ConfigData.LoadData(); SystemMenuManager.Load(tabPageGame.Width, tabPageGame.Height); MainTipManager.Init(tabPageGame.Height); PanelManager.Init(tabPageGame.Width, tabPageGame.Height); DbSerializer.Init(); } catch (Exception ex) { NLog.Warn(ex); Close(); } tabPageLogin.BackgroundImage = PicLoader.Read("System", "logback.jpg"); passport = WorldInfoManager.LastAccountName; labelAccount.Text = string.Format("账户 {0}", passport); ChangePage(0); myCursor.ChangeCursor("default"); workThread = new Thread(TimeGo); workThread.IsBackground = true; workThread.Start(); }
private void tabPageLogin_Paint(object sender, PaintEventArgs e) { //Brush b = new SolidBrush(Color.FromArgb(40+(int)(Math.Sin((double)timeTick/8)*20), Color.Black)); //e.Graphics.FillRectangle(b, 0,0, tabPageLogin.Width, tabPageLogin.Height); //b.Dispose(); var logoImg = PicLoader.Read("System", "logo.png"); var logWid = tabPageLogin.Width / 4; var logHeight = tabPageLogin.Height / 5; var logX = (tabPageLogin.Width - logWid) / 2; var logY = (tabPageLogin.Height - logHeight) / 2 + Math.Sin((double)timeTick / 12) * 6; e.Graphics.DrawImage(logoImg, logX, (int)logY, logWid, logHeight); logoImg.Dispose(); //e.Graphics.DrawImage(HSIcons.GetIconsByEName("rac5"), 10, 30, 20, 20); //e.Graphics.DrawImage(HSIcons.GetIconsByEName("hatt1"), 10, 55, 20, 20); //e.Graphics.DrawImage(HSIcons.GetIconsByEName("spl2"), 10, 80, 20, 20); //Font font = new Font("微软雅黑", 12 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); //e.Graphics.DrawString(string.Format("{0} / {1}", CardConfigManager.MonsterAvail, CardConfigManager.MonsterTotal), font, Brushes.White, 35, 30); //e.Graphics.DrawString(string.Format("{0} / {1}", CardConfigManager.WeaponAvail, CardConfigManager.WeaponTotal), font, Brushes.White, 35, 55); //e.Graphics.DrawString(string.Format("{0} / {1}", CardConfigManager.SpellAvail, CardConfigManager.SpellTotal), font, Brushes.White, 35, 80); //font.Dispose(); }
public override void Init(int width, int height) { base.Init(width, height); showImage = true; this.bitmapButtonFight.ImageNormal = PicLoader.Read("ButtonBitmap", "ButtonBack2.PNG"); bitmapButtonFight.Font = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); bitmapButtonFight.ForeColor = Color.White; bitmapButtonFight.IconImage = TaleofMonsters.Core.HSIcons.GetIconsByEName("abl1"); bitmapButtonFight.IconSize = new Size(18, 18); bitmapButtonFight.IconXY = new Point(5, 5); bitmapButtonFight.TextOffX = 8; if (types.Count > 0) { virtualRegion.SetRegionState(30, RegionState.Rectangled); Bind(types[0]); } SoundManager.PlayBGM("TOM002.mp3"); IsChangeBgm = true; if (UserProfile.InfoBasic.LastRival > 0) { FastBind(UserProfile.InfoBasic.LastRival); } }
public QuestForm() { InitializeComponent(); this.bitmapButtonClose.ImageNormal = PicLoader.Read("ButtonBitmap", "CloseButton1.JPG"); InitTasks(); }
private void TimeViewer_Paint(object sender, PaintEventArgs e) { LinearGradientBrush b1 = new LinearGradientBrush(new Rectangle(0, 0, Width, Height), Color.LightGreen, Color.Green, LinearGradientMode.Vertical); e.Graphics.FillRectangle(b1, 0, 0, round * Width, 30); b1.Dispose(); Font font = new Font("Arial", 20 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); e.Graphics.DrawString(string.Format("{0:00}:{1:00}", time / 4, (time % 4) * 15), font, Brushes.White, 22, 0); font.Dispose(); if (isShow) { string url = string.Format("d{0}.JPG", daytime); Image img = PicLoader.Read("Weather", url); e.Graphics.DrawImage(img, 6, 35, 30, 30); img.Dispose(); url = string.Format("w{0}.JPG", weather); img = PicLoader.Read("Weather", url); e.Graphics.DrawImage(img, 41, 35, 30, 30); img.Dispose(); url = string.Format("s{0}.JPG", special); img = PicLoader.Read("Weather", url); e.Graphics.DrawImage(img, 76, 35, 30, 30); img.Dispose(); } }
public override void Init(int width, int height) { base.Init(width, height); worldMap = PicLoader.Read("Map", "worldmap.JPG"); Graphics g = Graphics.FromImage(worldMap); foreach (var sceneConfig in ConfigData.SceneDict.Values) { if (sceneConfig.Icon == "") { continue; } Image image = PicLoader.Read("MapIcon", string.Format("{0}.PNG", sceneConfig.Icon)); iconSizeDict[sceneConfig.Id] = new Size(image.Width, image.Height); Rectangle destRect = new Rectangle(sceneConfig.IconX, sceneConfig.IconY, image.Width, image.Height); g.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, sceneConfig.Level > UserProfile.InfoBasic.Level ? HSImageAttributes.ToRed : HSImageAttributes.ToGray); image.Dispose(); if (sceneConfig.Id == UserProfile.InfoBasic.MapId) { baseX = sceneConfig.IconX - 750 / 2 + 30; baseY = sceneConfig.IconY - 500 / 2 + 30; baseX = MathTool.Clamp(baseX, 0, worldMap.Width - 750); baseY = MathTool.Clamp(baseY, 0, worldMap.Height - 500); } } g.Dispose(); showImage = true; }
public MGThreeBody() { InitializeComponent(); this.bitmapButtonC1.ImageNormal = PicLoader.Read("ButtonBitmap", "ButtonBack2.PNG"); bitmapButtonC1.Font = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); bitmapButtonC1.ForeColor = Color.White; bitmapButtonC1.IconImage = TaleofMonsters.Core.HSIcons.GetIconsByEName("rot3"); bitmapButtonC1.IconSize = new Size(16, 16); bitmapButtonC1.IconXY = new Point(4, 5); bitmapButtonC1.TextOffX = 8; virtualRegion = new VirtualRegion(this); for (int i = 0; i < 5; i++) { ButtonRegion region = new ButtonRegion(i + 1, 40 + 55 * i, 310, 50, 50, string.Format("GameSanTi{0}.PNG", i + 1), string.Format("GameSanTi{0}On.PNG", i + 1)); region.AddDecorator(new RegionTextDecorator(10, 30, 10)); virtualRegion.AddRegion(region); } virtualRegion.SetRegionDecorator(1, 0, "浸泡"); virtualRegion.SetRegionDecorator(2, 0, "脱水"); virtualRegion.SetRegionDecorator(3, 0, "医疗"); virtualRegion.SetRegionDecorator(4, 0, "农耕"); virtualRegion.SetRegionDecorator(5, 0, "科研"); virtualRegion.RegionClicked += new VirtualRegion.VRegionClickEventHandler(virtualRegion_RegionClicked); }
public MGOvercome() { InitializeComponent(); this.bitmapButtonC1.ImageNormal = PicLoader.Read("ButtonBitmap", "ButtonBack2.PNG"); bitmapButtonC1.Font = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); bitmapButtonC1.ForeColor = Color.White; bitmapButtonC1.IconImage = TaleofMonsters.Core.HSIcons.GetIconsByEName("hatt1"); bitmapButtonC1.IconSize = new Size(16, 16); bitmapButtonC1.IconXY = new Point(4, 5); bitmapButtonC1.TextOffX = 8; virtualRegion = new VirtualRegion(this); for (int i = 0; i < 5; i++) { ButtonRegion region = new ButtonRegion(i + 1, 35 + 55 * i, 310, 50, 50, "GameBackNormal1.PNG", "GameBackNormal1On.PNG"); region.AddDecorator(new RegionTextDecorator(10, 20, 10)); virtualRegion.AddRegion(region); } virtualRegion.SetRegionDecorator(1, 0, " 水"); virtualRegion.SetRegionDecorator(2, 0, " 风"); virtualRegion.SetRegionDecorator(3, 0, " 火"); virtualRegion.SetRegionDecorator(4, 0, " 光"); virtualRegion.SetRegionDecorator(5, 0, " 暗"); virtualRegion.RegionClicked += new VirtualRegion.VRegionClickEventHandler(virtualRegion_RegionClicked); }
public WorldMapViewForm() { InitializeComponent(); this.bitmapButtonClose.ImageNormal = PicLoader.Read("ButtonBitmap", "CloseButton1.JPG"); bitmapButtonClose.NoUseDrawNine = true; myCursor = new HSCursor(this); }
private void MGUpToNumber_Paint(object sender, PaintEventArgs e) { DrawBase(e.Graphics); if (!show) { return; } virtualRegion.Draw(e.Graphics); var font = new Font("宋体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); DrawShadeText(e.Graphics, string.Format("牛肉x{0}", itemRequired[0]), font, level == 0 ? Brushes.LightGreen : Brushes.White, xoff + 5, 20 + yoff); DrawShadeText(e.Graphics, string.Format("蜂蜜x{0}", itemRequired[1]), font, level == 1 ? Brushes.LightGreen : Brushes.White, xoff + 5, 50 + yoff); DrawShadeText(e.Graphics, string.Format("黄油x{0}", itemRequired[2]), font, level == 2 ? Brushes.LightGreen : Brushes.White, xoff + 5, 80 + yoff); DrawShadeText(e.Graphics, string.Format(" 水 x{0}", itemRequired[3]), font, level == 3 ? Brushes.LightGreen : Brushes.White, xoff + 5, 110 + yoff); font.Dispose(); for (int i = 0; i < 4; i++) { Image img = PicLoader.Read("MiniGame.Soup", string.Format("item{0}.PNG", i + 1)); for (int j = 0; j < itemGet[i]; j++) { e.Graphics.DrawImage(img, 80 + xoff + j * 12, 17 + yoff + 30 * i, 24, 24); } img.Dispose(); } font = new Font("宋体", 26 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); DrawShadeText(e.Graphics, string.Format(string.Format("{0}/100", GetPoints())), font, Brushes.Gold, 105 + xoff, 140 + yoff); font.Dispose(); }
public static Image GetWeaponImage(int id, int width, int height) { WeaponConfig weaponConfig = ConfigData.GetWeaponConfig(id); string fname = string.Format("Weapon/{0}{1}x{2}", weaponConfig.Icon, width, height); if (!ImageManager.HasImage(fname)) { Image image = PicLoader.Read("Weapon", string.Format("{0}.JPG", weaponConfig.Icon)); if (image == null) { NLog.Error(string.Format("GetWeaponImage {0} {1} not found", id, fname)); return(null); } #if DEBUG if (weaponConfig.Remark.Contains("未完成")) { Graphics g = Graphics.FromImage(image); var icon = PicLoader.Read("System", "NotFinish.PNG"); g.DrawImage(icon, 0, 0, 180, 180); g.Save(); } #endif if (image.Width != width || image.Height != height) { image = image.GetThumbnailImage(width, height, null, new IntPtr(0)); } ImageManager.AddImage(fname, image); } return(ImageManager.GetImage(fname)); }
public void Draw(Graphics g) { Image back = PicLoader.Read("System", "CardBack2.JPG"); g.DrawImage(back, x, y, width - 1, height - 1); back.Dispose(); if (show) { // g.FillRectangle(PaintTool.GetBrushByAttribute(CardConfigManager.GetCardConfig(product.Cid).Attr), x + 10, y + 12, 70 - 2, 90 - 2); virtualRegion.Draw(g); CardAssistant.DrawBase(g, product.Cid, x + 12, y + 14, 64, 84); if (coverEffect != null) { coverEffect.Draw(g); } if ((CardProductMarkTypes)product.Mark != CardProductMarkTypes.Null) { Image marker = PicLoader.Read("System", string.Format("Mark{0}.PNG", (int)product.Mark)); g.DrawImage(marker, x + 28, y + 12, 50, 51); marker.Dispose(); } var cardConfigData = CardConfigManager.GetCardConfig(product.Cid); var quality = cardConfigData.Quality + 1; g.DrawImage(HSIcons.GetIconsByEName("gem" + quality), x + width / 2 - 8, y + height - 44, 16, 16); } }
private int speed; //当前的速度模式 public MGRacing() { InitializeComponent(); this.bitmapButtonC1.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png"); bitmapButtonC1.Font = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); bitmapButtonC1.ForeColor = Color.White; bitmapButtonC1.IconImage = HSIcons.GetIconsByEName("rot3"); bitmapButtonC1.IconSize = new Size(16, 16); bitmapButtonC1.IconXY = new Point(4, 5); bitmapButtonC1.TextOffX = 8; vRegion = new VirtualRegion(this); string[] txt = { "低速", "中速", "高速" }; for (int i = 0; i < 3; i++) { ButtonRegion region = new ButtonRegion(i + 1, 40 + 70 * i, 310, 50, 50, "GameBackNormal1.png", "GameBackNormal1On.png"); region.AddDecorator(new RegionTextDecorator(10, 20, 10, txt[i])); vRegion.AddRegion(region); } var region2 = new ButtonRegion(4, 40 + 55 * 4, 310, 50, 50, "GameBackNormal2.png", "GameBackNormal1On.png"); region2.AddDecorator(new RegionTextDecorator(10, 20, 10, "氮气")); vRegion.AddRegion(region2); vRegion.RegionClicked += new VirtualRegion.VRegionClickEventHandler(virtualRegion_RegionClicked); }
private static void DrawIcon(Graphics g, int x, int y, int v) { if (v == 99) { var img2 = PicLoader.Read("System", "CardBack.jpg"); g.DrawImage(img2, x, y, 40, 50); img2.Dispose(); return; } g.FillRectangle(Brushes.Wheat, x, y, 40, 50); int type = (v / 13) + 1; var img = PicLoader.Read("MiniGame.Poker", type + ".png"); g.DrawImage(img, x, y, 20, 20); img.Dispose(); int number = (v % 13) + 1; string numberStr = number.ToString(); if (number == 11) { numberStr = "J"; } else if (number == 12) { numberStr = "Q"; } else if (number == 13) { numberStr = "K"; } System.Drawing.Font ft = new Font("宋体", 12, FontStyle.Bold); g.DrawString(numberStr, ft, type == 1 || type == 3 ? Brushes.Black: Brushes.Red, x + 18, y + 30); }
public void Draw(Graphics g) { SolidBrush sb = new SolidBrush(Color.FromArgb(20, 20, 20)); g.FillRectangle(sb, x + 2, y + 2, width - 4, height - 4); sb.Dispose(); g.DrawRectangle(Pens.Teal, x + 2, y + 2, width - 4, height - 4); if (show) { HeroSkillAttrConfig heroSkillAttrConfig = ConfigData.GetHeroSkillAttrConfig(sid); virtualRegion.Draw(g); g.DrawRectangle(Pens.White, x + 3, y + 3, 76, 75); Font ft = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); g.DrawString(heroSkillAttrConfig.Name, ft, Brushes.Gold, x + 90, y + 10); int slevel = UserProfile.InfoSkill.GetSkillAttrLevel(sid); g.DrawString(string.Format("等级{0}级", slevel), ft, Brushes.White, x + 90, y + 32); ft.Dispose(); if (slevel == 0) { Image marker = PicLoader.Read("System", "Mark1.PNG"); g.DrawImage(marker, x + 30, y + 2, 50, 51); marker.Dispose(); } } }
public void Draw(Graphics g, int yMin, int yMax) { if (Y + 64 < yMin || Y > yMax) { return; } Image img = PicLoader.Read("MiniGame.Seven", string.Format("g{0}.PNG", Index)); if (Y >= yMin && Y + 64 < yMax) //画整个 { g.DrawImage(img, X, Y, 64, 64); } else if (Y < yMin) //下半个 { g.DrawImage(img, new RectangleF(X, yMin, 64, 64 + Y - yMin), new RectangleF(0, yMin - Y, 64, 64 + Y - yMin), GraphicsUnit.Pixel); } else if (Y + 64 > yMax) //上半个 { float yAdd = yMax - Y; g.DrawImage(img, new RectangleF(X, yMax - yAdd, 64, yAdd), new RectangleF(0, 0, 64, yAdd), GraphicsUnit.Pixel); } img.Dispose(); }
private void GenerateMiniMap(int mapid, int wx, int wy) { Image allMap = PicLoader.Read("Map", "worldmap.JPG"); //生成世界地图 Graphics g = Graphics.FromImage(allMap); Font font = new Font("微软雅黑", 18 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); foreach (var sceneConfig in ConfigData.SceneDict.Values) { if (sceneConfig.Icon == "") { continue; } if (sceneConfig.IconX < wx || sceneConfig.IconX > wx + 300 || sceneConfig.IconY < wy || sceneConfig.IconY > wy + 300) { continue; } string tname = ConfigData.GetSceneConfig(sceneConfig.Id).Name; g.DrawString(tname, font, Brushes.Black, sceneConfig.IconX + 2, sceneConfig.IconY + 21); g.DrawString(tname, font, sceneConfig.Id == mapid ? Brushes.Lime : Brushes.White, sceneConfig.IconX, sceneConfig.IconY + 20); } font.Dispose(); g.Dispose(); if (miniMap != null) { miniMap.Dispose(); } miniMap = new Bitmap(150, 150); //绘制小地图 g = Graphics.FromImage(miniMap); Rectangle destRect = new Rectangle(0, 0, 150, 150); g.DrawImage(allMap, destRect, wx, wy, 300, 300, GraphicsUnit.Pixel); g.Dispose(); allMap.Dispose(); }
public void Draw(Graphics g, bool enable) { Image back = PicLoader.Read("System", "ItemGrid.JPG"); g.DrawImage(back, x + 3, y + 3, 32, 32); back.Dispose(); if (itemPos >= 0) { Font font = new Font("Aril", 11 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); int itemId = UserProfile.InfoBag.Items[itemPos].Type; if (enable) { g.DrawImage(HItemBook.GetHItemImage(itemId), x + 3, y + 3, 32, 32); } else { Rectangle ret = new Rectangle(x + 3, y + 3, 32, 32); g.DrawImage(HItemBook.GetHItemImage(itemId), ret, 0, 0, 64, 64, GraphicsUnit.Pixel, HSImageAttributes.ToGray); } int count = UserProfile.InfoBag.Items[itemPos].Value; g.DrawString(count.ToString(), font, Brushes.Black, x + 4, y + 4); g.DrawString(count.ToString(), font, Brushes.White, x + 3, y + 3); if (percent > 1) { Brush brush = new SolidBrush(Color.FromArgb(200, Color.Black)); g.FillRectangle(brush, x, y, 35, 35 * percent / 100); brush.Dispose(); } font.Dispose(); } }
private void MGUpToNumber_Paint(object sender, PaintEventArgs e) { DrawBase(e.Graphics); if (!show) { return; } vRegion.Draw(e.Graphics); string hardDes = ""; string distanceDes = ""; var info = raceSeg[raceId]; switch (info.Hardness) { case RaceSegData.HardnessType.Easy: hardDes = "简单"; break; case RaceSegData.HardnessType.Med: hardDes = "中等"; break; case RaceSegData.HardnessType.Danger: hardDes = "艰险"; break; } if (info.Length > 1200) { distanceDes = "长"; } else if (info.Length > 800) { distanceDes = "中等"; } else { distanceDes = "短"; } Image img = PicLoader.Read("MiniGame.Racing", string.Format("race{0}.png", (int)info.Hardness + 1)); e.Graphics.DrawImage(img, 50 + xoff, 50 + yoff, 100, 100); img.Dispose(); img = PicLoader.Read("Border", "questb1.png"); e.Graphics.DrawImage(img, 50 + xoff, 50 + yoff, 100, 100); img.Dispose(); var font = new Font("宋体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); DrawShadeText(e.Graphics, string.Format("第{0}赛段", raceId + 1), font, Brushes.Lime, xoff + 165, 35 + yoff); DrawShadeText(e.Graphics, string.Format("长度 {0}", distanceDes), font, Brushes.White, xoff + 165, 65 + yoff); DrawShadeText(e.Graphics, string.Format("难度 {0}", hardDes), font, Brushes.White, xoff + 165, 95 + yoff); if (distanceDiffer >= 0) { DrawShadeText(e.Graphics, string.Format("领先 {0}米", distanceDiffer), font, Brushes.Lime, xoff + 165, 125 + yoff); } else { DrawShadeText(e.Graphics, string.Format("落后 {0}米", -distanceDiffer), font, Brushes.Red, xoff + 165, 125 + yoff); } font.Dispose(); }
public NpcShopForm() { InitializeComponent(); this.bitmapButtonClose2.ImageNormal = PicLoader.Read("ButtonBitmap", "CloseButton1.JPG"); this.nlPageSelector1 = new ControlPlus.NLPageSelector(this, 143, 244, 150); nlPageSelector1.PageChange += nlPageSelector1_PageChange; }
private void NpcTalkForm_Paint(object sender, PaintEventArgs e) { BorderPainter.Draw(e.Graphics, "", Width, Height); if (showImage) { Font font2 = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); e.Graphics.DrawString(string.Format("{0}(Lv{1})", config.Name, eventLevel), font2, Brushes.White, Width / 2 - 40, 8); font2.Dispose(); e.Graphics.DrawImage(SceneBook.GetSceneQuestImage(config.Id), 15, 40, 140, 140); Image border = PicLoader.Read("Border", "questb1.PNG"); //边框 e.Graphics.DrawImage(border, 15, 40, 140, 140); border.Dispose(); if (evtItem != null) { evtItem.Draw(e.Graphics); } colorWord.Draw(e.Graphics); if (answerList != null && (evtItem == null || evtItem.RunningState != TalkEventItem.TalkEventState.Running)) { Font font = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); int id = 0; foreach (var word in answerList) { if (id == tar) { e.Graphics.FillRectangle(Brushes.DarkBlue, 10, id * 20 + Height - 10 - answerList.Count * 20, Width - 20, 20); } int textOff = 20; if (!string.IsNullOrEmpty(word.Prefix)) { string icon = ""; if (word.Prefix.StartsWith("quest")) { icon = "npc5"; } if (word.Prefix.StartsWith("rival")) { icon = "tsk1"; } if (icon != "") { e.Graphics.DrawImage(HSIcons.GetIconsByEName(icon), textOff, id * 20 + Height - 10 - answerList.Count * 20 + 2, 18, 18); textOff += 20; } } e.Graphics.DrawString(word.Script, font, Brushes.Wheat, textOff, id * 20 + Height - 10 - answerList.Count * 20 + 2); id++; } font.Dispose(); } } }
public void OnClickIcon() { Image cardImg = cardObj.GetComponent <Image>(); PicLoader cardLoader = cardObj.GetComponent <PicLoader>(); string cardName = "f" + uiText.text; cardLoader.LoadPic("card", cardName, cardImg); }
public void UpdateItem(int count) { uiText.text = (count + 1).ToString("000"); string iconName = "f" + uiText.text; PicLoader picLoader = GetComponent <PicLoader>(); picLoader.LoadPic("icon", iconName, uiIcon); }