public void AddTask(string s, Font font, Brush brush, PointF point) { if (!(brush is SolidBrush)) { throw new NotSupportedException("brush"); } _colors.Add((brush as SolidBrush).Color); MyFont myFont = FontManager.GetFont(FontManager.FindClosestFont(font)); string[] lines = s.Split('\n'); float k = (font.SizeInPoints / myFont.FontInfo.Pt); //k = 1; int glyphHeight = (int)(k * myFont.FontInfo.Height); int realStrLen = 0; foreach (string str in lines) { int strLen = str.Length; realStrLen += strLen; float x = point.X; for (int j = 0; j < strLen; j++) { if (!myFont.Symbols.ContainsKey(str[j])) { realStrLen--; continue; } GlyphData symbol = myFont.Symbols[str[j]]; AddVertex(x + symbol.XOffset * k, point.Y + symbol.YOffset * k, symbol.TextureXPos, symbol.TextureYPos); AddVertex(x + (symbol.XOffset + symbol.Width) * k, point.Y + symbol.YOffset * k, symbol.TextureWidth, symbol.TextureYPos); AddVertex(x + symbol.XOffset * k, point.Y + (symbol.YOffset + symbol.Height) * k, symbol.TextureXPos, symbol.TextureHeight); AddVertex(x + (symbol.XOffset + symbol.Width) * k, point.Y + symbol.YOffset * k, symbol.TextureWidth, symbol.TextureYPos); AddVertex(x + (symbol.XOffset + symbol.Width) * k, point.Y + (symbol.YOffset + symbol.Height) * k, symbol.TextureWidth, symbol.TextureHeight); AddVertex(x + symbol.XOffset * k, point.Y + (symbol.YOffset + symbol.Height) * k, symbol.TextureXPos, symbol.TextureHeight); x += (myFont.Symbols[str[j]].OrigW + (j != strLen - 1 ? myFont.GetKerningDelta(str[j], str[j + 1]) : 0.0f)) * k; } point.Y += glyphHeight; } _stringLens.Add(realStrLen); _fontTextures.Add(myFont.FontTexture); }
private void ShowConfirmationOptions() { float yStart = (GlobalValues.ScreenCenter.Y - (GlobalValues.FontYSpacer * 5)); LinkedList <Vector2> areYouSure = MyFont.GetWord(GlobalValues.FontScaleSize, $"Are you sure you want to delete {mapNames[oldSelectedItem - 1]}"); LinkedList <Vector2> yesOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Yes"); LinkedList <Vector2> noOption = MyFont.GetWord(GlobalValues.FontScaleSize, "No"); Vector2 areYouSurePos = new Vector2(GlobalValues.GetWordCenterPos($"Are you sure you want to delete {mapNames[oldSelectedItem - 1]}", false).X, yStart); Vector2 yesOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Yes", false).X, yStart + (GlobalValues.FontYSpacer * 5)); Vector2 noOptionPos = new Vector2(GlobalValues.GetWordCenterPos("No", false).X, yStart + (GlobalValues.FontYSpacer * 6)); foreach (Vector2 v2 in areYouSure) { pb.AddVertex(v2 + areYouSurePos, Color.White); } foreach (Vector2 v2 in yesOption) { pb.AddVertex(v2 + yesOptionPos, Color.White); } foreach (Vector2 v2 in noOption) { pb.AddVertex(v2 + noOptionPos, Color.White); } List <Vector2> positions = new List <Vector2>() { yesOptionPos, noOptionPos }; ShowSelectedIcon(positions); }
private void ShowControls() { int yStart = 10 + GlobalValues.FontYSpacer; LinkedList <Vector2> turn = MyFont.GetWord(GlobalValues.FontScaleSize, "Arrow keys or A:D to rotate"); LinkedList <Vector2> thrust = MyFont.GetWord(GlobalValues.FontScaleSize, "W:Space:Up Arrow to thrust"); LinkedList <Vector2> pause = MyFont.GetWord(GlobalValues.FontScaleSize, "P:ESC to pause"); Vector2 turnPosition = new Vector2(GlobalValues.GetWordCenterPos("Arrow keys or A:D to rotate", false).X, yStart); Vector2 thrustPosition = new Vector2(GlobalValues.GetWordCenterPos("W:Space:Up Arrow to thrust", false).X, yStart + GlobalValues.FontYSpacer); Vector2 pausePosition = new Vector2(GlobalValues.GetWordCenterPos("P:ESC to pause", false).X, yStart + (GlobalValues.FontYSpacer * 2)); foreach (Vector2 v2 in turn) { pb.AddVertex(v2 + turnPosition, Color.White); } foreach (Vector2 v2 in thrust) { pb.AddVertex(v2 + thrustPosition, Color.White); } foreach (Vector2 v2 in pause) { pb.AddVertex(v2 + pausePosition, Color.White); } }
public override void Draw(GameTime gameTime) { LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Splash Screen"); Vector2 screenTitlePos = GlobalValues.GetWordCenterPos("Splash Screen", true); if (GlobalValues.ValuesInitialized) { if (spriteBatch != null) { spriteBatch.Begin(); spriteBatch.Draw(myImage, new Vector2(0, 0)); spriteBatch.End(); } if (pb != null) { pb.Begin(PrimitiveType.LineList); DrawLander(); DrawLanderRocket(); DisplayKeys(); pb.End(); } else { pb = GlobalValues.PrimitiveBatch; } } }
public MyText(MyText s, int numeric) : base(s, numeric) { text = s.text; coord = s.coord; myFont = s.myFont; font = myFont.toFont(); }
public MyText(String _text, Point _coord, MyPaintSettings settings, int _name) : base(_name, settings) { text = _text; coord = _coord; myFont = new MyFont(settings.font); font = myFont.toFont(); }
public JsonResult Purchase(int user_seq, int font_seq) { try { var user = db.User .Where(u => !u.deleted_at.HasValue && u.seq == user_seq) .FirstOrDefault(); if (user == null) { return(Json(new { state = "no user" }, "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet)); } var my_font = db.MyFont .Where(mf => !mf.deleted_at.HasValue && mf.user_seq == user_seq && mf.font_seq == font_seq && !mf.purchased_at.HasValue) .FirstOrDefault(); if (my_font == null) { var new_my_font = new MyFont { created_at = DateTime.Now, font_seq = font_seq, purchased_at = DateTime.Now, updated_at = DateTime.Now, user_seq = user_seq }; db.MyFont.Add(new_my_font); } else { my_font.purchased_at = DateTime.Now; my_font.updated_at = DateTime.Now; } var font = db.Font .Where(f => !f.deleted_at.HasValue && f.seq == font_seq) .FirstOrDefault(); if (font != null) { font.important_point += 1000; } db.SaveChanges(); var result = new { state = "ok" }; return(Json(result, "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet)); } catch (HttpException e) { Response.StatusCode = e.GetHttpCode(); return(Json(e.Message, "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet)); } }
private void ShowTitle() { LinkedList <Vector2> title = MyFont.GetWord(GlobalValues.FontScaleSize, "Lunar Lander"); Vector2 titlePosition = new Vector2(GlobalValues.GetWordCenterPos("Lunar Lander", false).X, 10); foreach (Vector2 v2 in title) { pb.AddVertex(v2 + titlePosition, Color.White); } }
private void DisplayKeys() { LinkedList <Vector2> display = MyFont.GetWord(GlobalValues.FontScaleSize, $"Press Space to continue or wait {5 - elapsedTime.Seconds} seconds"); Vector2 displayPos = new Vector2(GlobalValues.GetWordCenterPos("Press Space to continue or wait 5 seconds", false).X, 270); foreach (Vector2 v2 in display) { pb.AddVertex(v2 + displayPos, Color.Red); } }
private void ShowKeys() { LinkedList <Vector2> display = MyFont.GetWord(GlobalValues.FontScaleSize, "Press ESC to return to Main Menu"); Vector2 displayPos = GlobalValues.GetWordCenterPos("Press ESC to return to Main Menu", false) + new Vector2(0, 325); foreach (Vector2 v2 in display) { pb.AddVertex(v2 + displayPos, Color.White); } }
private void ShowMenuOptions() { LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Main Menu"); LinkedList <Vector2> playOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Play"); LinkedList <Vector2> optionsOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Options"); LinkedList <Vector2> creatorOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Map Creator"); LinkedList <Vector2> creditsOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Credits"); LinkedList <Vector2> exitOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Exit"); Vector2 screenTitlePos = new Vector2(GlobalValues.GetWordCenterPos("Main Menu", true).X, 100); Vector2 playOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Play", false).X, GlobalValues.ScreenCenter.Y - GlobalValues.FontYSpacer); Vector2 optionsOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Options", false).X, GlobalValues.ScreenCenter.Y); Vector2 creatorOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Map Creator", false).X, GlobalValues.ScreenCenter.Y + GlobalValues.FontYSpacer); Vector2 creditsOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Credits", false).X, GlobalValues.ScreenCenter.Y + (GlobalValues.FontYSpacer * 2)); Vector2 exitOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Exit", false).X, GlobalValues.ScreenCenter.Y + (GlobalValues.FontYSpacer * 3)); List <Vector2> positions = new List <Vector2>() { playOptionPos, optionsOptionPos, creatorOptionPos, creditsOptionPos, exitOptionPos }; ShowSelectedIcon(positions); #region Foreach foreach (Vector2 v2 in screenTitle) { pb.AddVertex(v2 + screenTitlePos, Color.White); } foreach (Vector2 v2 in playOption) { pb.AddVertex(v2 + playOptionPos, Color.White); } foreach (Vector2 v2 in optionsOption) { pb.AddVertex(v2 + optionsOptionPos, Color.White); } foreach (Vector2 v2 in creatorOption) { pb.AddVertex(v2 + creatorOptionPos, Color.White); } foreach (Vector2 v2 in creditsOption) { pb.AddVertex(v2 + creditsOptionPos, Color.White); } foreach (Vector2 v2 in exitOption) { pb.AddVertex(v2 + exitOptionPos, Color.White); } #endregion }
public JsonResult AddCart(int user_seq, int font_seq, int is_personal) { try { var user = db.User .Where(u => !u.deleted_at.HasValue && u.seq == user_seq) .FirstOrDefault(); if (user == null) { return(Json(new { state = "no user" }, "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet)); } var my_font = db.MyFont .Where(mf => !mf.deleted_at.HasValue && mf.user_seq == user_seq && mf.font_seq == font_seq && mf.is_personal == is_personal) .FirstOrDefault(); if (my_font != null) { if (my_font.purchased_at.HasValue) { return(Json(new { state = "purchased" }, "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet)); } else { return(Json(new { state = "duplicated" }, "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet)); } } var new_my_font = new MyFont { created_at = DateTime.Now, font_seq = font_seq, updated_at = DateTime.Now, user_seq = user_seq, is_personal = is_personal }; db.MyFont.Add(new_my_font); db.SaveChanges(); var result = new { state = "ok" }; return(Json(result, "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet)); } catch (HttpException e) { Response.StatusCode = e.GetHttpCode(); return(Json(e.Message, "application/json", Encoding.UTF8, JsonRequestBehavior.AllowGet)); } }
private void Score() { lblScore = new MyLabel( "lblHighScore", $"Score: {game.ReturnScore()}", Color.Transparent, Color.GhostWhite, new Point(0, 0), MyFont.Font(MyStrings.fontPath, 30F) ); lblScore.Location = new Point(0, Height - (lblScore.Height * 2)); Controls.Add(lblScore); }
private void PixelMemory() { lblPixelMemory = new MyLabel( "lblPixelMemory", "Pixel Memory", Color.Transparent, Color.GhostWhite, new Point(0, 0), MyFont.Font(MyStrings.fontPath, 35F) ); lblPixelMemory.Location = new Point((Width / 2) - 125, ((Height - lblPixelMemory.Height) / 2) - 150); Controls.Add(lblPixelMemory); }
private void Attacks() { lblAttacks = new MyLabel( "lblHighScore", $"Attacks: {game.Attacks}", Color.Transparent, Color.GhostWhite, new Point(0, 0), MyFont.Font(MyStrings.fontPath, 30F) ); lblAttacks.Location = new Point((Width - 185), Height - (lblAttacks.Height * 2)); Controls.Add(lblAttacks); }
private void ShowGUIWords() { int xLeftSide = 10; int xRightSide = 1000; int yStart = 20; LinkedList <Vector2> score = MyFont.GetWord(GlobalValues.FontScaleSize, "Score"); LinkedList <Vector2> time = MyFont.GetWord(GlobalValues.FontScaleSize, "Time"); LinkedList <Vector2> fuel = MyFont.GetWord(GlobalValues.FontScaleSize, "Fuel"); LinkedList <Vector2> rotation = MyFont.GetWord(GlobalValues.FontScaleSize, "Rotation"); LinkedList <Vector2> xVelocity = MyFont.GetWord(GlobalValues.FontScaleSize, "X Velocity"); LinkedList <Vector2> yVelocity = MyFont.GetWord(GlobalValues.FontScaleSize, "Y Velocity"); Vector2 scorePosition = new Vector2(xLeftSide, yStart); Vector2 timePosition = new Vector2(xLeftSide, yStart + GlobalValues.FontYSpacer); Vector2 fuelPosition = new Vector2(xLeftSide, yStart + (GlobalValues.FontYSpacer * 2)); Vector2 rotationPosition = new Vector2(xRightSide, yStart); Vector2 xVelocityPosition = new Vector2(xRightSide, yStart + GlobalValues.FontYSpacer); Vector2 yVelocityPosition = new Vector2(xRightSide, yStart + (GlobalValues.FontYSpacer * 2)); foreach (Vector2 v2 in score) { pb.AddVertex(v2 + scorePosition, Color.White); } foreach (Vector2 v2 in time) { pb.AddVertex(v2 + timePosition, Color.White); } foreach (Vector2 v2 in fuel) { pb.AddVertex(v2 + fuelPosition, Color.White); } foreach (Vector2 v2 in xVelocity) { pb.AddVertex(v2 + xVelocityPosition, Color.White); } foreach (Vector2 v2 in rotation) { pb.AddVertex(v2 + rotationPosition, Color.White); } foreach (Vector2 v2 in yVelocity) { pb.AddVertex(v2 + yVelocityPosition, Color.White); } }
private void ShowControls() { float yStart = 500; LinkedList <Vector2> leave = MyFont.GetWord(GlobalValues.FontScaleSize, "Press escape to return to options screen."); Vector2 leavePos = new Vector2(GlobalValues.GetWordCenterPos("Press escape to return to options screen.", false).X, yStart); #region Foreach foreach (Vector2 v2 in leave) { pb.AddVertex(v2 + leavePos, Color.White); } #endregion }
private void HighScore() { foreach (Player player in SQLiteDataAccess.SelectHighScore()) { lblHighScore = new MyLabel( "lblHighScore", $"High Score: {player.HighScore} - {player.NamePlayer}", Color.Transparent, Color.GhostWhite, new Point(0, 0), MyFont.Font(MyStrings.fontPath, 30F) ); lblHighScore.Location = new Point(0, Height - (lblHighScore.Height * 2)); } Controls.Add(lblHighScore); }
private void ShowMenuOptions() { float yStart = (GlobalValues.ScreenCenter.Y - (GlobalValues.FontYSpacer * 2)); LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Map Manager"); LinkedList <Vector2> mainMenuOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Main Menu"); Vector2 screenTitlePos = new Vector2(GlobalValues.GetWordCenterPos("Map Manager", true).X, 100); Vector2 mainMenuOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Main Menu", false).X, GlobalValues.ScreenCenter.Y - (GlobalValues.FontYSpacer * 3)); foreach (Vector2 v2 in screenTitle) { pb.AddVertex(v2 + screenTitlePos, Color.White); } foreach (Vector2 v2 in mainMenuOption) { pb.AddVertex(v2 + mainMenuOptionPos, Color.White); } LinkedList <Vector2> option = new LinkedList <Vector2>(); Vector2 optionPos = new Vector2(); List <Vector2> positions = new List <Vector2>() { mainMenuOptionPos }; int mapNum = 0; foreach (string map in mapNames) { option = MyFont.GetWord(GlobalValues.FontScaleSize, map); optionPos = new Vector2(GlobalValues.GetWordCenterPos(map, false).X, yStart + (GlobalValues.FontYSpacer * mapNum)); foreach (Vector2 v2 in option) { pb.AddVertex(v2 + optionPos, Color.White); } positions.Add(optionPos); mapNum++; } ShowSelectedIcon(positions); }
private void ShowMenuOptions() { float xPos = GlobalValues.ScreenCenter.X - ("Restart".Length * (GlobalValues.FontScaleSize * 2)); float yStart = GlobalValues.ScreenCenter.Y; LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Pause"); LinkedList <Vector2> continueOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Continue"); LinkedList <Vector2> restartOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Restart"); LinkedList <Vector2> mainMenuOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Main Menu"); Vector2 screenTitlePos = new Vector2(GlobalValues.GetWordCenterPos("Pause", true).X, 100); Vector2 continueOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Continue", false).X, GlobalValues.ScreenCenter.Y - GlobalValues.FontYSpacer); Vector2 restartOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Restart", false).X, GlobalValues.ScreenCenter.Y); Vector2 mainMenuOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Main Menu", false).X, GlobalValues.ScreenCenter.Y + GlobalValues.FontYSpacer); List <Vector2> positions = new List <Vector2>() { continueOptionPos, restartOptionPos, mainMenuOptionPos }; ShowSelectedIcon(positions); #region Foreach foreach (Vector2 v2 in screenTitle) { pb.AddVertex(v2 + screenTitlePos, Color.White); } foreach (Vector2 v2 in continueOption) { pb.AddVertex(v2 + continueOptionPos, Color.White); } foreach (Vector2 v2 in restartOption) { pb.AddVertex(v2 + restartOptionPos, Color.White); } foreach (Vector2 v2 in mainMenuOption) { pb.AddVertex(v2 + mainMenuOptionPos, Color.White); } #endregion }
private void ShowMenu() { LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Resolution"); LinkedList <Vector2> notImplemented = MyFont.GetWord(GlobalValues.FontScaleSize, "Not implemented"); Vector2 screenTitlePos = new Vector2(GlobalValues.GetWordCenterPos("Resolution", true).X, 100); Vector2 notImplementedPos = new Vector2(GlobalValues.GetWordCenterPos("Not implemented", false).X, GlobalValues.ScreenCenter.Y); #region Foreach foreach (Vector2 v2 in screenTitle) { pb.AddVertex(v2 + screenTitlePos, Color.White); } foreach (Vector2 v2 in notImplemented) { pb.AddVertex(v2 + notImplementedPos, Color.White); } #endregion }
private void ShowMenu() { LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Volume"); LinkedList <Vector2> currentVolume = MyFont.GetWord(GlobalValues.FontScaleSize, (volume * 100).ToString()); Vector2 screenTitlePos = new Vector2(GlobalValues.GetWordCenterPos("Volume", true).X, 100); Vector2 currentVolumePos = new Vector2(GlobalValues.GetWordCenterPos((volume * 100).ToString(), false).X, GlobalValues.ScreenCenter.Y); #region Foreach foreach (Vector2 v2 in screenTitle) { pb.AddVertex(v2 + screenTitlePos, Color.White); } foreach (Vector2 v2 in currentVolume) { pb.AddVertex(v2 + currentVolumePos, Color.White); } #endregion }
private void MyForm_Load(object sender, EventArgs e) { MyFont font = new MyFont(); fontList = font.getFontFamilies(); foreach (string item in fontList) { fontComboBox.Items.Add(item); } fontSizeList = font.getFontSize(); foreach (int item in fontSizeList) { fontSizeComboBox.Items.Add(item.ToString()); } string fontName = richTextBox.SelectionFont.Name; float fontSize = richTextBox.SelectionFont.Size; setComboBoxSelectedIndex(fontName, fontSize); }
private void ShowControls() { float yStart = 500; LinkedList <Vector2> leftRight = MyFont.GetWord(GlobalValues.FontScaleSize, "Use left:right arrow keys or a:d to change volume"); LinkedList <Vector2> amounts = MyFont.GetWord(GlobalValues.FontScaleSize, "hold control to change by 10 or shift to change by 5"); LinkedList <Vector2> leave = MyFont.GetWord(GlobalValues.FontScaleSize, "press escape to leave without saving changes"); LinkedList <Vector2> confirm = MyFont.GetWord(GlobalValues.FontScaleSize, "press enter to update volume"); Vector2 leftRightPos = new Vector2(GlobalValues.GetWordCenterPos("Use left:right arrow keys or a:d to change volume", false).X, yStart); Vector2 amountsPos = new Vector2(GlobalValues.GetWordCenterPos("hold control to change by 10 or shift to change by 5", false).X, yStart + GlobalValues.FontYSpacer); Vector2 leavePos = new Vector2(GlobalValues.GetWordCenterPos("press escape to leave without saving changes", false).X, yStart + (GlobalValues.FontYSpacer * 2)); Vector2 confirmPos = new Vector2(GlobalValues.GetWordCenterPos("press enter to update volume", false).X, yStart + (GlobalValues.FontYSpacer * 3)); #region Foreach foreach (Vector2 v2 in leftRight) { pb.AddVertex(v2 + leftRightPos, Color.White); } foreach (Vector2 v2 in amounts) { pb.AddVertex(v2 + amountsPos, Color.White); } foreach (Vector2 v2 in leave) { pb.AddVertex(v2 + leavePos, Color.White); } foreach (Vector2 v2 in confirm) { pb.AddVertex(v2 + confirmPos, Color.White); } #endregion }
public override void Draw(GameTime gameTime) { LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Studio Screen"); Vector2 screenTitlePos = GlobalValues.GetWordCenterPos("Studio Screen", true); spriteBatch.Begin(); spriteBatch.Draw(myImage, new Vector2(275, 0)); spriteBatch.End(); pb.Begin(PrimitiveType.LineList); //foreach (Vector2 v2 in screenTitle) //{ // pb.AddVertex(v2 + screenTitlePos, Color.White); //} DisplayKeys(); pb.End(); }
public override void Draw(GameTime gameTime) { LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Credits"); LinkedList <Vector2> credits = MyFont.GetWord(GlobalValues.FontScaleSize, "Created by: Steven Endres"); Vector2 screenTitlePos = new Vector2(GlobalValues.GetWordCenterPos("Credits", true).X, 100); Vector2 creditsPos = new Vector2(GlobalValues.GetWordCenterPos("Created By: Steven Endres", false).X, GlobalValues.ScreenCenter.Y); pb.Begin(PrimitiveType.LineList); foreach (Vector2 v2 in screenTitle) { pb.AddVertex(v2 + screenTitlePos, Color.White); } foreach (Vector2 v2 in credits) { pb.AddVertex(v2 + creditsPos, Color.White); } ShowKeys(); pb.End(); }
/// <summary> /// 绘制图片 /// </summary> /// <param name="imgUrl"></param> /// <param name="dataStyle"></param> /// <param name="dataText"></param> /// <param name="dataCmd">命令参数(后期多样式时用)</param> /// <param name="sNo">屏幕编号</param> /// <param name="bgColor">可变参数,无值时全部默认为透明,一个参数时文字画布的颜色,两个参数时第二个参数为主画布的颜色</param> /// <returns></returns> public static string GenerateImage(string imgUrl, int dataStyle, string dataText, string dataCmd, string sNo, params string[] bgColor) { Image imageFrom = null; var fromPath = imgUrl; // const string savePath = "Images/";//保存图片的路径 try { if (!string.IsNullOrEmpty(fromPath)) { #region 获取网络图片 var myUri = new Uri(fromPath); var webRequest = WebRequest.Create(myUri); var webResponse = webRequest.GetResponse(); var reStream = webResponse.GetResponseStream(); if (reStream != null) imageFrom = new Bitmap(reStream); //读取原图 #endregion } } catch (Exception exp) { // new Common.Log().WriteLog(exp.Message + "PicEditAndPreview.aspx.cs->GenerateImage()->Line64->读取图片时异常"); } if (imageFrom == null) { return null; } var ratio = (float) imageFrom.Width/imageFrom.Height; //原始图片的长宽比例 const int imageWidth = 1280; //背景画布宽高(720P) const int imageHeight = 720; //背景画布宽高(720P) var ratioStyle = 1F; //图片区域的宽高比例 var size = new Size(); var screenType = (ScreenStyle) dataStyle; switch (screenType) { case ScreenStyle.UpAndDown: { #region 图片上文字下的风格(图片:1230*420,上半部分:720*0.618=445px 下半部分:275px) ratioStyle = 2.9286F; if (ratio > ratioStyle) //宽度较宽时 { size = new Size(1230, (int) (1230/ratio)); } else { size = new Size((int) (420*ratio), 420); } #endregion } break; case ScreenStyle.LeftAndRight: { #region 图片左文字右的风格(图片:765*670 左边:790,右边490) ratioStyle = 1.1418F; if (ratio > ratioStyle) //宽度较宽时 { size = new Size(765, (int) (765/ratio)); } else { size = new Size((int) (670*ratio), 670); } #endregion } break; case ScreenStyle.FullScreen: #region 图片全屏的风格(1280*720) ratioStyle = 1.7778F; if (ratio > ratioStyle) //宽度较宽时 { size = new Size(1280, (int) (1280/ratio)); } else { size = new Size((int) (720*ratio), 720); } #endregion break; default: break; } Image bmap = new Bitmap(imageWidth, imageHeight); var g = Graphics.FromImage(bmap); #region 更改画布颜色 var color = Color.Transparent; //默认为透明的 if (bgColor.Length > 0) { color = ColorTranslator.FromHtml(bgColor[0]); //获取十六进制的颜色 } if (bgColor.Length > 1) { g.Clear(ColorTranslator.FromHtml(bgColor[1])); //给画布上色 } else { g.Clear(Color.Transparent); } #endregion Image imageResize = new Bitmap(imageFrom, size); //重新修改图片的尺寸 switch (screenType) { case ScreenStyle.UpAndDown: { g.DrawImage(imageResize, (imageWidth - size.Width)/2, 445 - size.Height + 40); //把图片往画布中画 } break; case ScreenStyle.LeftAndRight: { g.DrawImage(imageResize, 790 - size.Width, (imageHeight - size.Height)/2); } break; case ScreenStyle.FullScreen: { g.DrawImage(imageResize, (imageWidth - size.Width)/2, (imageHeight - size.Height)/2); } break; default: break; } #region 绘制文本 MyFont myFont; Image textBitmap; switch (screenType) { case ScreenStyle.UpAndDown: { myFont = new MyFont(dataText, new Bitmap(1230, 250), color, screenType); textBitmap = myFont.GenerateText(); g.DrawImage(textBitmap, 25, 445); //往画布中贴图片 } break; case ScreenStyle.LeftAndRight: { myFont = new MyFont(dataText, new Bitmap(475, 670), color, screenType); textBitmap = myFont.GenerateText(); g.DrawImage(textBitmap, 790, 25); } break; case ScreenStyle.FullScreen: { myFont = new MyFont(dataText, new Bitmap(400, 250), color, screenType); textBitmap = myFont.GenerateText(); g.DrawImage(textBitmap, (imageWidth + size.Width)/2 - 425, (imageHeight + size.Height)/2 - 275); //在图片的右下角方位 } break; default: break; } #endregion var sPicName = DateTime.Now.ToString("yyyyMMddhhmmss"); var savePath = HttpContext.Current.Server.MapPath(string.Format(saveEditPath, sNo)); if (!Directory.Exists(savePath)) { Directory.CreateDirectory(savePath); } var sPicPath = HttpContext.Current.Server.MapPath(string.Format(saveEditPath, sNo) + sPicName + "_thumbnail.jpg"); var sPreFix = HttpContext.Current.Server.MapPath(string.Format(saveEditPath, sNo) + sPicName); #region 创建缩略图 var smBmap = bmap.GetThumbnailImage(Convert.ToInt32(bmap.Width/4.267), Convert.ToInt32(bmap.Height/4.267), null, IntPtr.Zero); smBmap.Save(sPicPath, ImageFormat.Jpeg); #endregion bmap.Save(sPreFix + ".jpg", ImageFormat.Jpeg); var returnImg = string.Format(relative_edit_path, sNo) + sPicName + "_thumbnail.jpg"; return returnImg; }
private static void Processing() { while (running) { byte command = (byte)int8(); if ((Command)command == Command.SET_COLOR) { //Console.WriteLine("SetColor"); SetColor((uint)int8()); } else if ((Command)command == Command.SET_PALETTE) { Console.WriteLine("SetPalette"); SetPalette((byte)int8(), (ushort)int16()); } else if ((Command)command == Command.FILL_REGION) { //Console.WriteLine("FillRegion"); FillRegion(int16(), int8(), int16(), int8()); } else if ((Command)command == Command.END_SCENE) { //Console.WriteLine("EndScene"); EndScene(); running = false; } else if ((Command)command == Command.DRAW_HLINE) { //Console.WriteLine("DrawHLine"); DrawHLine(int8(), int16(), int16()); } else if ((Command)command == Command.DRAW_VLINE) { //Console.WriteLine("DrawVLine"); DrawVLine(int16(), int8(), int8()); } else if ((Command)command == Command.SET_POINT) { //Console.WriteLine("SetPoint"); SetPoint(int16(), int8()); } else if ((Command)command == Command.DRAW_SIGNAL_POINTS) { int x0 = int16(); //Console.WriteLine("DRAW_SIGNAL_POINTS"); for (int i = 0; i < 281; i++) { SetPoint(x0 + i, int8()); } //Console.WriteLine("EXIT DRAW_SIGNAL_POINTS"); } else if ((Command)command == Command.DRAW_SIGNAL_LINES) { int x0 = int16(); int prevX = int8(); //Console.WriteLine("DRAW_SIGNAL_LINES"); for (int i = 0; i < 280; i++) { int nextX = int8(); DrawVLine(x0 + i, prevX, nextX); prevX = nextX; } //Console.WriteLine("EXIT DRAW_SIGNAL_LINES"); } else if ((Command)command == Command.DRAW_MULTI_HPOINT_LINES_2) { //Console.WriteLine("DRAW_MULTI_HPOINT_LINES_2"); int numLines = int8(); int x0 = int16(); int numPoints = int8(); int dX = int8(); for (int i = 0; i < numLines; i++) { int y = int8(); for (int point = 0; point < numPoints; point++) { SetPoint(x0 + dX * point, y); } } //Console.WriteLine("EXIT DRAW_MULTI_HPOINT_LINES_2"); } else if ((Command)command == Command.DRAW_MULTI_VPOINT_LINES) { //Console.WriteLine("DRAW_MULTI_VPOINT_LINES"); int numLines = int8(); int y0 = int8(); int numPoints = int8(); int dY = int8(); int8(); for (int i = 0; i < numLines; i++) { int x = int16(); for (int point = 0; point < numPoints; point++) { SetPoint(x, y0 + dY * point); } } //Console.WriteLine("EXIT DRAW_MULTI_VPOINT_LIINES"); } else if ((Command)command == Command.DRAW_VLINES_ARRAY) { //Console.WriteLine("DRAW_VLINES_ARRAY"); int x0 = int16(); int numLines = int8(); for (int i = 0; i < numLines; i++) { DrawVLine(x0 + i, int8(), int8()); } //Console.WriteLine("EXIT DRAW_VLINES_ARRAY"); } else if ((Command)command == Command.LOAD_FONT) { //Console.WriteLine("LOAD_FONT"); int typeFont = int8(); if (typeFont < 4) { fonts[typeFont] = new MyFont(); fonts[typeFont].height = int8(); int8(); int8(); int8(); for (int i = 0; i < 256; i++) { fonts[typeFont].symbols[i] = new Symbol(); fonts[typeFont].symbols[i].width = int8(); for (int j = 0; j < 8; j++) { fonts[typeFont].symbols[i].bytes[j] = int8(); } } } //Console.WriteLine("EXIT LOAD_FONT"); } else if ((Command)command == Command.SET_FONT) { //Console.WriteLine("SET_FONT"); currentFont = int8(); } else if ((Command)command == Command.DRAW_TEXT) { //Console.WriteLine("DRAW_TEXT"); int x0 = int16(); int y0 = int8(); int numSymbols = int8(); char[] str = new char[numSymbols]; for (int i = 0; i < numSymbols; i++) { str[i] = (char)int8(); } DrawText(x0, y0, str); } else { Console.WriteLine("Неизвестная команда " + command); } } if (needForEndDrawing == false) { SendEndFrameEvent(); } }
private void Display() { float xLeft = 25; int yStart = 25; #region Linked Lists LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.FontScaleSize, "Map Creator"); LinkedList <Vector2> togglePads = MyFont.GetWord(GlobalValues.FontScaleSize, "Toggle pads: P"); LinkedList <Vector2> saveMap = MyFont.GetWord(GlobalValues.FontScaleSize, "Save Map: S"); LinkedList <Vector2> exit = MyFont.GetWord(GlobalValues.FontScaleSize, "Exit: ESC"); LinkedList <Vector2> arePadsToggled = MyFont.GetWord(GlobalValues.FontScaleSize, $"Pads Toggled: {makingPads}"); LinkedList <Vector2> isMapSaved = MyFont.GetWord(GlobalValues.FontScaleSize, $"Map Saved: {isSaved}"); LinkedList <Vector2> currentX = MyFont.GetWord(GlobalValues.FontScaleSize, $"Current X Pos: {newMouseState.X}"); LinkedList <Vector2> currentY = MyFont.GetWord(GlobalValues.FontScaleSize, $"Current Y Pos: {newMouseState.Y}"); #endregion #region Positions Vector2 screenTitlePos = new Vector2(xLeft, yStart); Vector2 togglePadsPos = new Vector2(xLeft, yStart + GlobalValues.FontYSpacer); Vector2 saveMapPos = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 2)); Vector2 exitPos = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 3)); Vector2 arePadsToggledPos = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 4)); Vector2 isMapSavedPos = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 5)); Vector2 currentXPos = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 6)); Vector2 currentYPos = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 7)); #endregion #region Foreach foreach (Vector2 v2 in screenTitle) { pb.AddVertex(v2 + screenTitlePos, Color.White); } foreach (Vector2 v2 in togglePads) { pb.AddVertex(v2 + togglePadsPos, Color.White); } foreach (Vector2 v2 in saveMap) { pb.AddVertex(v2 + saveMapPos, Color.White); } foreach (Vector2 v2 in exit) { pb.AddVertex(v2 + exitPos, Color.White); } foreach (Vector2 v2 in arePadsToggled) { pb.AddVertex(v2 + arePadsToggledPos, Color.White); } foreach (Vector2 v2 in isMapSaved) { pb.AddVertex(v2 + isMapSavedPos, Color.White); } foreach (Vector2 v2 in currentX) { pb.AddVertex(v2 + currentXPos, Color.White); } foreach (Vector2 v2 in currentY) { pb.AddVertex(v2 + currentYPos, Color.White); } #endregion }
private void InitFontUGO() { fonts[2] = new MyFont(); MyFont font = fonts[2]; font.height = 8; font.symbols[0] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[1] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[2] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[3] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[4] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[5] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[6] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[7] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[8] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[9] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[10] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[11] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[12] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[13] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[14] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[15] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[16] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[17] = new Symbol(1, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[18] = new Symbol(2, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[19] = new Symbol(3, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[20] = new Symbol(4, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[21] = new Symbol(5, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[22] = new Symbol(6, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[23] = new Symbol(7, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[24] = new Symbol(8, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[25] = new Symbol(9, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[26] = new Symbol(10, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[27] = new Symbol(11, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[28] = new Symbol(12, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[29] = new Symbol(13, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[30] = new Symbol(14, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[31] = new Symbol(15, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[32] = new Symbol(8, new int[8] { 34, 112, 248, 32, 32, 32, 32, 35 }); font.symbols[33] = new Symbol(8, new int[8] { 170, 6, 11, 9, 8, 8, 8, 200 }); font.symbols[34] = new Symbol(7, new int[8] { 170, 0, 248, 140, 4, 4, 4, 6 }); font.symbols[35] = new Symbol(8, new int[8] { 170, 3, 5, 4, 4, 4, 4, 4 }); font.symbols[36] = new Symbol(8, new int[8] { 170, 0, 252, 198, 2, 2, 2, 3 }); font.symbols[37] = new Symbol(8, new int[8] { 0, 0, 0, 0, 0, 0, 0, 3 }); font.symbols[38] = new Symbol(8, new int[8] { 0, 6, 11, 9, 8, 8, 8, 200 }); font.symbols[39] = new Symbol(7, new int[8] { 0, 0, 248, 140, 4, 4, 4, 6 }); font.symbols[40] = new Symbol(8, new int[8] { 0, 0, 1, 1, 1, 1, 1, 35 }); font.symbols[41] = new Symbol(7, new int[8] { 0, 192, 60, 6, 2, 2, 2, 2 }); font.symbols[42] = new Symbol(7, new int[8] { 34, 112, 248, 32, 32, 32, 32, 32 }); font.symbols[43] = new Symbol(8, new int[8] { 170, 12, 23, 16, 16, 16, 16, 16 }); font.symbols[44] = new Symbol(7, new int[8] { 170, 0, 192, 32, 32, 32, 32, 48 }); font.symbols[45] = new Symbol(8, new int[8] { 170, 28, 55, 32, 32, 32, 32, 32 }); font.symbols[46] = new Symbol(7, new int[8] { 170, 0, 128, 96, 32, 32, 32, 32 }); font.symbols[47] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[48] = new Symbol(5, new int[8] { 32, 32, 32, 32, 32, 32, 32, 248 }); font.symbols[49] = new Symbol(5, new int[8] { 104, 48, 0, 0, 0, 0, 0, 0 }); font.symbols[50] = new Symbol(8, new int[8] { 2, 1, 0, 0, 0, 0, 0, 0 }); font.symbols[51] = new Symbol(6, new int[8] { 100, 244, 24, 0, 0, 0, 0, 0 }); font.symbols[52] = new Symbol(8, new int[8] { 1, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[53] = new Symbol(7, new int[8] { 0, 0, 34, 112, 248, 32, 32, 248 }); font.symbols[54] = new Symbol(7, new int[8] { 104, 48, 170, 0, 0, 0, 0, 0 }); font.symbols[55] = new Symbol(8, new int[8] { 3, 0, 170, 0, 0, 0, 0, 0 }); font.symbols[56] = new Symbol(7, new int[8] { 242, 28, 170, 0, 0, 0, 0, 0 }); font.symbols[57] = new Symbol(8, new int[8] { 2, 1, 170, 0, 0, 0, 0, 0 }); font.symbols[58] = new Symbol(8, new int[8] { 32, 251, 112, 34, 0, 0, 0, 0 }); font.symbols[59] = new Symbol(7, new int[8] { 16, 176, 192, 170, 0, 0, 0, 0 }); font.symbols[60] = new Symbol(8, new int[8] { 16, 28, 7, 170, 0, 0, 0, 0 }); font.symbols[61] = new Symbol(7, new int[8] { 32, 96, 192, 170, 0, 0, 0, 0 }); font.symbols[62] = new Symbol(8, new int[8] { 32, 39, 28, 170, 0, 0, 0, 0 }); font.symbols[63] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[64] = new Symbol(8, new int[8] { 0, 0, 34, 112, 248, 32, 32, 35 }); font.symbols[65] = new Symbol(8, new int[8] { 2, 6, 171, 9, 8, 8, 8, 200 }); font.symbols[66] = new Symbol(7, new int[8] { 0, 0, 250, 140, 4, 4, 4, 6 }); font.symbols[67] = new Symbol(8, new int[8] { 1, 7, 174, 4, 4, 4, 4, 4 }); font.symbols[68] = new Symbol(8, new int[8] { 0, 0, 252, 70, 2, 2, 2, 3 }); font.symbols[69] = new Symbol(8, new int[8] { 0, 0, 0, 0, 0, 0, 0, 35 }); font.symbols[70] = new Symbol(8, new int[8] { 2, 6, 11, 9, 8, 8, 8, 234 }); font.symbols[71] = new Symbol(8, new int[8] { 0, 0, 240, 152, 8, 8, 8, 175 }); font.symbols[72] = new Symbol(8, new int[8] { 4, 6, 11, 9, 8, 8, 24, 250 }); font.symbols[73] = new Symbol(7, new int[8] { 0, 8, 248, 168, 8, 8, 8, 174 }); font.symbols[74] = new Symbol(7, new int[8] { 0, 0, 34, 112, 248, 32, 32, 32 }); font.symbols[75] = new Symbol(8, new int[8] { 2, 6, 173, 8, 8, 8, 8, 8 }); font.symbols[76] = new Symbol(7, new int[8] { 0, 0, 250, 4, 4, 4, 4, 4 }); font.symbols[77] = new Symbol(8, new int[8] { 4, 7, 171, 8, 8, 8, 8, 8 }); font.symbols[78] = new Symbol(7, new int[8] { 0, 0, 250, 4, 4, 4, 4, 4 }); font.symbols[79] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[80] = new Symbol(5, new int[8] { 32, 32, 32, 32, 32, 32, 32, 248 }); font.symbols[81] = new Symbol(5, new int[8] { 104, 48, 0, 0, 0, 0, 0, 0 }); font.symbols[82] = new Symbol(8, new int[8] { 2, 1, 0, 0, 0, 0, 0, 0 }); font.symbols[83] = new Symbol(6, new int[8] { 100, 244, 24, 0, 0, 0, 0, 0 }); font.symbols[84] = new Symbol(8, new int[8] { 1, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[85] = new Symbol(5, new int[8] { 112, 248, 32, 32, 32, 32, 32, 248 }); font.symbols[86] = new Symbol(5, new int[8] { 104, 48, 0, 0, 0, 0, 0, 0 }); font.symbols[87] = new Symbol(8, new int[8] { 3, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[88] = new Symbol(4, new int[8] { 144, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[89] = new Symbol(8, new int[8] { 3, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[90] = new Symbol(8, new int[8] { 248, 112, 35, 0, 0, 0, 0, 0 }); font.symbols[91] = new Symbol(7, new int[8] { 8, 8, 250, 48, 0, 0, 0, 0 }); font.symbols[92] = new Symbol(8, new int[8] { 4, 4, 171, 0, 0, 0, 0, 0 }); font.symbols[93] = new Symbol(7, new int[8] { 8, 8, 250, 112, 16, 0, 0, 0 }); font.symbols[94] = new Symbol(8, new int[8] { 4, 4, 171, 0, 0, 0, 0, 0 }); font.symbols[95] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[96] = new Symbol(8, new int[8] { 0, 0, 1, 1, 2, 7, 34, 112 }); font.symbols[97] = new Symbol(8, new int[8] { 96, 144, 8, 8, 4, 85, 4, 2 }); font.symbols[98] = new Symbol(8, new int[8] { 1, 2, 4, 4, 8, 93, 8, 16 }); font.symbols[99] = new Symbol(8, new int[8] { 128, 64, 32, 32, 16, 85, 16, 8 }); font.symbols[100] = new Symbol(8, new int[8] { 6, 9, 16, 16, 32, 117, 32, 64 }); font.symbols[101] = new Symbol(8, new int[8] { 0, 0, 37, 113, 250, 34, 34, 32 }); font.symbols[102] = new Symbol(8, new int[8] { 96, 144, 93, 8, 4, 4, 4, 2 }); font.symbols[103] = new Symbol(8, new int[8] { 1, 2, 85, 4, 8, 8, 8, 16 }); font.symbols[104] = new Symbol(8, new int[8] { 128, 64, 117, 32, 16, 16, 16, 8 }); font.symbols[105] = new Symbol(8, new int[8] { 6, 9, 85, 16, 32, 32, 32, 64 }); font.symbols[106] = new Symbol(8, new int[8] { 37, 112, 248, 32, 248, 112, 37, 0 }); font.symbols[107] = new Symbol(8, new int[8] { 85, 0, 0, 0, 0, 0, 85, 0 }); font.symbols[108] = new Symbol(8, new int[8] { 85, 160, 160, 164, 170, 170, 170, 170 }); font.symbols[109] = new Symbol(8, new int[8] { 85, 0, 0, 0, 0, 0, 255, 128 }); font.symbols[110] = new Symbol(8, new int[8] { 85, 0, 0, 0, 0, 0, 255, 0 }); font.symbols[111] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[112] = new Symbol(5, new int[8] { 248, 32, 32, 32, 32, 32, 32, 248 }); font.symbols[113] = new Symbol(8, new int[8] { 2, 1, 0, 0, 0, 0, 0, 0 }); font.symbols[114] = new Symbol(4, new int[8] { 16, 32, 192, 0, 0, 0, 0, 0 }); font.symbols[115] = new Symbol(8, new int[8] { 8, 4, 3, 0, 0, 0, 0, 0 }); font.symbols[116] = new Symbol(2, new int[8] { 64, 128, 0, 0, 0, 0, 0, 0 }); font.symbols[117] = new Symbol(5, new int[8] { 32, 32, 32, 32, 32, 32, 32, 248 }); font.symbols[118] = new Symbol(8, new int[8] { 2, 1, 0, 0, 0, 0, 0, 0 }); font.symbols[119] = new Symbol(4, new int[8] { 16, 32, 192, 0, 0, 0, 0, 0 }); font.symbols[120] = new Symbol(8, new int[8] { 8, 4, 3, 0, 0, 0, 0, 0 }); font.symbols[121] = new Symbol(2, new int[8] { 64, 128, 0, 0, 0, 0, 0, 0 }); font.symbols[122] = new Symbol(8, new int[8] { 0, 0, 0, 0, 7, 0, 0, 0 }); font.symbols[123] = new Symbol(8, new int[8] { 0, 0, 0, 0, 254, 1, 0, 0 }); font.symbols[124] = new Symbol(8, new int[8] { 169, 168, 144, 128, 128, 0, 0, 0 }); font.symbols[125] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[126] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[127] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[128] = new Symbol(8, new int[8] { 0, 0, 255, 0, 0, 0, 0, 0 }); font.symbols[129] = new Symbol(8, new int[8] { 0, 0, 255, 1, 1, 1, 1, 1 }); font.symbols[130] = new Symbol(7, new int[8] { 0, 0, 0, 0, 0, 0, 32, 82 }); font.symbols[131] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[132] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[133] = new Symbol(8, new int[8] { 1, 1, 1, 1, 7, 1, 1, 1 }); font.symbols[134] = new Symbol(8, new int[8] { 255, 1, 1, 1, 193, 1, 1, 1 }); font.symbols[135] = new Symbol(8, new int[8] { 1, 1, 1, 1, 7, 1, 1, 1 }); font.symbols[136] = new Symbol(8, new int[8] { 255, 1, 1, 1, 193, 1, 1, 1 }); font.symbols[137] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[138] = new Symbol(8, new int[8] { 127, 1, 1, 1, 7, 1, 97, 33 }); font.symbols[139] = new Symbol(8, new int[8] { 1, 1, 1, 1, 193, 1, 1, 1 }); font.symbols[140] = new Symbol(8, new int[8] { 255, 1, 1, 1, 7, 1, 1, 1 }); font.symbols[141] = new Symbol(8, new int[8] { 1, 1, 1, 1, 193, 1, 1, 1 }); font.symbols[142] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[143] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[144] = new Symbol(8, new int[8] { 21, 56, 124, 0, 124, 56, 18, 0 }); font.symbols[145] = new Symbol(8, new int[8] { 85, 1, 1, 1, 1, 1, 170, 0 }); font.symbols[146] = new Symbol(8, new int[8] { 85, 84, 84, 84, 72, 64, 128, 0 }); font.symbols[147] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[148] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[149] = new Symbol(8, new int[8] { 127, 0, 0, 0, 1, 0, 0, 0 }); font.symbols[150] = new Symbol(8, new int[8] { 1, 0, 64, 192, 255, 192, 64, 0 }); font.symbols[151] = new Symbol(8, new int[8] { 255, 0, 4, 6, 255, 6, 4, 0 }); font.symbols[152] = new Symbol(8, new int[8] { 1, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[153] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[154] = new Symbol(8, new int[8] { 33, 32, 114, 4, 9, 16, 32, 0 }); font.symbols[155] = new Symbol(8, new int[8] { 255, 0, 64, 192, 255, 192, 64, 0 }); font.symbols[156] = new Symbol(8, new int[8] { 1, 0, 4, 6, 255, 6, 4, 0 }); font.symbols[157] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[158] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[159] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[160] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[161] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[162] = new Symbol(8, new int[8] { 0, 0, 1, 0, 1, 2, 4, 8 }); font.symbols[163] = new Symbol(8, new int[8] { 31, 32, 240, 128, 0, 0, 0, 0 }); font.symbols[164] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[165] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[166] = new Symbol(8, new int[8] { 252, 2, 7, 0, 0, 0, 0, 0 }); font.symbols[167] = new Symbol(5, new int[8] { 0, 0, 192, 128, 64, 32, 16, 8 }); font.symbols[168] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[169] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[170] = new Symbol(8, new int[8] { 0, 0, 0, 0, 3, 0, 0, 0 }); font.symbols[171] = new Symbol(8, new int[8] { 255, 128, 128, 128, 224, 128, 128, 128 }); font.symbols[172] = new Symbol(8, new int[8] { 254, 2, 2, 2, 15, 2, 2, 2 }); font.symbols[173] = new Symbol(1, new int[8] { 0, 0, 0, 0, 128, 0, 0, 0 }); font.symbols[174] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[175] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[176] = new Symbol(8, new int[8] { 0, 0, 0, 0, 255, 0, 0, 0 }); font.symbols[177] = new Symbol(8, new int[8] { 0, 0, 1, 0, 255, 0, 0, 0 }); font.symbols[178] = new Symbol(8, new int[8] { 17, 35, 247, 131, 1, 0, 0, 0 }); font.symbols[179] = new Symbol(4, new int[8] { 64, 96, 240, 96, 64, 0, 0, 0 }); font.symbols[180] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[181] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[182] = new Symbol(8, new int[8] { 1, 3, 7, 3, 1, 0, 0, 0 }); font.symbols[183] = new Symbol(8, new int[8] { 68, 98, 247, 96, 64, 0, 0, 0 }); font.symbols[184] = new Symbol(8, new int[8] { 0, 0, 192, 128, 127, 0, 0, 0 }); font.symbols[185] = new Symbol(8, new int[8] { 0, 0, 0, 0, 255, 0, 0, 0 }); font.symbols[186] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[187] = new Symbol(8, new int[8] { 128, 0, 32, 96, 255, 96, 32, 0 }); font.symbols[188] = new Symbol(8, new int[8] { 3, 0, 8, 12, 254, 12, 8, 0 }); font.symbols[189] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[190] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[191] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[192] = new Symbol(8, new int[8] { 255, 0, 0, 0, 3, 0, 0, 0 }); font.symbols[193] = new Symbol(3, new int[8] { 128, 128, 128, 128, 224, 128, 128, 128 }); font.symbols[194] = new Symbol(8, new int[8] { 3, 2, 2, 2, 15, 2, 2, 2 }); font.symbols[195] = new Symbol(8, new int[8] { 255, 0, 0, 0, 128, 0, 0, 0 }); font.symbols[196] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[197] = new Symbol(8, new int[8] { 0, 0, 0, 0, 3, 0, 0, 0 }); font.symbols[198] = new Symbol(8, new int[8] { 255, 128, 128, 128, 224, 128, 128, 128 }); font.symbols[199] = new Symbol(8, new int[8] { 254, 2, 2, 2, 15, 2, 2, 2 }); font.symbols[200] = new Symbol(8, new int[8] { 1, 1, 1, 1, 129, 1, 1, 1 }); font.symbols[201] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[202] = new Symbol(8, new int[8] { 255, 0, 0, 0, 3, 0, 0, 0 }); font.symbols[203] = new Symbol(3, new int[8] { 128, 128, 128, 128, 224, 128, 128, 128 }); font.symbols[204] = new Symbol(8, new int[8] { 3, 2, 2, 2, 15, 2, 2, 2 }); font.symbols[205] = new Symbol(8, new int[8] { 255, 1, 1, 1, 129, 1, 1, 1 }); font.symbols[206] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[207] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[208] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[209] = new Symbol(8, new int[8] { 255, 0, 32, 96, 255, 96, 32, 0 }); font.symbols[210] = new Symbol(7, new int[8] { 254, 0, 8, 12, 254, 12, 8, 0 }); font.symbols[211] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[212] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[213] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[214] = new Symbol(8, new int[8] { 128, 0, 32, 96, 255, 96, 32, 0 }); font.symbols[215] = new Symbol(8, new int[8] { 3, 0, 8, 12, 254, 12, 8, 0 }); font.symbols[216] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[217] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[218] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[219] = new Symbol(8, new int[8] { 255, 0, 32, 96, 255, 96, 32, 0 }); font.symbols[220] = new Symbol(7, new int[8] { 254, 0, 8, 12, 254, 12, 8, 0 }); font.symbols[221] = new Symbol(8, new int[8] { 1, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[222] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[223] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[224] = new Symbol(8, new int[8] { 0, 0, 0, 0, 3, 1, 1, 1 }); font.symbols[225] = new Symbol(8, new int[8] { 63, 32, 32, 32, 34, 38, 47, 38 }); font.symbols[226] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 255, 0 }); font.symbols[227] = new Symbol(8, new int[8] { 255, 0, 7, 4, 69, 100, 245, 101 }); font.symbols[228] = new Symbol(8, new int[8] { 255, 0, 255, 0, 192, 64, 192, 0 }); font.symbols[229] = new Symbol(8, new int[8] { 255, 0, 255, 0, 3, 1, 1, 1 }); font.symbols[230] = new Symbol(8, new int[8] { 255, 0, 224, 32, 34, 38, 47, 38 }); font.symbols[231] = new Symbol(8, new int[8] { 255, 0, 0, 0, 0, 0, 255, 0 }); font.symbols[232] = new Symbol(8, new int[8] { 252, 4, 4, 4, 69, 100, 245, 101 }); font.symbols[233] = new Symbol(2, new int[8] { 0, 0, 0, 0, 192, 64, 192, 0 }); font.symbols[234] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[235] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[236] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[237] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[238] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[239] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[240] = new Symbol(8, new int[8] { 3, 0, 255, 0, 255, 0, 0, 0 }); font.symbols[241] = new Symbol(8, new int[8] { 162, 32, 224, 0, 255, 0, 0, 0 }); font.symbols[242] = new Symbol(8, new int[8] { 0, 0, 0, 0, 255, 0, 0, 0 }); font.symbols[243] = new Symbol(8, new int[8] { 69, 4, 4, 4, 252, 0, 0, 0 }); font.symbols[244] = new Symbol(2, new int[8] { 192, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[245] = new Symbol(8, new int[8] { 3, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[246] = new Symbol(8, new int[8] { 162, 32, 32, 32, 63, 0, 0, 0 }); font.symbols[247] = new Symbol(8, new int[8] { 0, 0, 0, 0, 255, 0, 0, 0 }); font.symbols[248] = new Symbol(8, new int[8] { 69, 4, 7, 0, 255, 0, 0, 0 }); font.symbols[249] = new Symbol(8, new int[8] { 192, 0, 255, 0, 255, 0, 0, 0 }); font.symbols[250] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[251] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[252] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[253] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[254] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); font.symbols[255] = new Symbol(0, new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }); }
private static void Processing() { while(running) { byte command = (byte)int8(); if((Command)command == Command.SET_COLOR) { //Console.WriteLine("SetColor"); SetColor((uint)int8()); } else if((Command)command == Command.SET_PALETTE) { Console.WriteLine("SetPalette"); SetPalette((byte)int8(), (ushort)int16()); } else if((Command)command == Command.FILL_REGION) { //Console.WriteLine("FillRegion"); FillRegion(int16(), int8(), int16(), int8()); } else if((Command)command == Command.END_SCENE) { //Console.WriteLine("EndScene"); EndScene(); running = false; } else if((Command)command == Command.DRAW_HLINE) { //Console.WriteLine("DrawHLine"); DrawHLine(int8(), int16(), int16()); } else if((Command)command == Command.DRAW_VLINE) { //Console.WriteLine("DrawVLine"); DrawVLine(int16(), int8(), int8()); } else if((Command)command == Command.SET_POINT) { //Console.WriteLine("SetPoint"); SetPoint(int16(), int8()); } else if((Command)command == Command.DRAW_SIGNAL_POINTS) { int x0 = int16(); //Console.WriteLine("DRAW_SIGNAL_POINTS"); for(int i = 0; i < 281; i++) { SetPoint(x0 + i, int8()); } //Console.WriteLine("EXIT DRAW_SIGNAL_POINTS"); } else if((Command)command == Command.DRAW_SIGNAL_LINES) { int x0 = int16(); int prevX = int8(); //Console.WriteLine("DRAW_SIGNAL_LINES"); for(int i = 0; i < 280; i++) { int nextX = int8(); DrawVLine(x0 + i, prevX, nextX); prevX = nextX; } //Console.WriteLine("EXIT DRAW_SIGNAL_LINES"); } else if((Command)command == Command.DRAW_MULTI_HPOINT_LINES_2) { //Console.WriteLine("DRAW_MULTI_HPOINT_LINES_2"); int numLines = int8(); int x0 = int16(); int numPoints = int8(); int dX = int8(); for(int i = 0; i < numLines; i++) { int y = int8(); for(int point = 0; point < numPoints; point++) { SetPoint(x0 + dX * point, y); } } //Console.WriteLine("EXIT DRAW_MULTI_HPOINT_LINES_2"); } else if((Command)command == Command.DRAW_MULTI_VPOINT_LINES) { //Console.WriteLine("DRAW_MULTI_VPOINT_LINES"); int numLines = int8(); int y0 = int8(); int numPoints = int8(); int dY = int8(); int8(); for(int i = 0; i < numLines; i++) { int x = int16(); for(int point = 0; point < numPoints; point++) { SetPoint(x, y0 + dY * point); } } //Console.WriteLine("EXIT DRAW_MULTI_VPOINT_LIINES"); } else if((Command)command == Command.DRAW_VLINES_ARRAY) { //Console.WriteLine("DRAW_VLINES_ARRAY"); int x0 = int16(); int numLines = int8(); for(int i = 0; i < numLines; i++) { DrawVLine(x0 + i, int8(), int8()); } //Console.WriteLine("EXIT DRAW_VLINES_ARRAY"); } else if((Command)command == Command.LOAD_FONT) { //Console.WriteLine("LOAD_FONT"); int typeFont = int8(); if (typeFont < 4) { fonts[typeFont] = new MyFont(); fonts[typeFont].height = int8(); int8(); int8(); int8(); for (int i = 0; i < 256; i++) { fonts[typeFont].symbols[i] = new Symbol(); fonts[typeFont].symbols[i].width = int8(); for (int j = 0; j < 8; j++) { fonts[typeFont].symbols[i].bytes[j] = int8(); } } } //Console.WriteLine("EXIT LOAD_FONT"); } else if((Command)command == Command.SET_FONT) { //Console.WriteLine("SET_FONT"); currentFont = int8(); } else if((Command)command == Command.DRAW_TEXT) { //Console.WriteLine("DRAW_TEXT"); int x0 = int16(); int y0 = int8(); int numSymbols = int8(); char[] str = new char[numSymbols]; for(int i = 0; i < numSymbols; i++) { str[i] = (char)int8(); } DrawText(x0, y0, str); } else { Console.WriteLine("Неизвестная команда " + command); } } if (needForEndDrawing == false) { SendEndFrameEvent(); } }
private void ShowMenuOptions() { LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Options"); LinkedList <Vector2> mainMenuOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Main Menu"); LinkedList <Vector2> option1Option = MyFont.GetWord(GlobalValues.FontScaleSize, "Manage Maps"); LinkedList <Vector2> option2Option = MyFont.GetWord(GlobalValues.FontScaleSize, "Change Volume"); LinkedList <Vector2> option3Option = MyFont.GetWord(GlobalValues.FontScaleSize, "Change Resolution"); LinkedList <Vector2> option4Option = MyFont.GetWord(GlobalValues.FontScaleSize, "Change Difficulty"); LinkedList <Vector2> option5Option = MyFont.GetWord(GlobalValues.FontScaleSize, "Change Gravity"); Vector2 screenTitlePos = new Vector2(GlobalValues.GetWordCenterPos("Options", true).X, 100); Vector2 mainMenuOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Main Menu", false).X, GlobalValues.ScreenCenter.Y - (GlobalValues.FontYSpacer * 2)); Vector2 option1OptionPos = new Vector2(GlobalValues.GetWordCenterPos("Manage Maps", false).X, GlobalValues.ScreenCenter.Y - GlobalValues.FontYSpacer); Vector2 option2OptionPos = new Vector2(GlobalValues.GetWordCenterPos("Change Volume", false).X, GlobalValues.ScreenCenter.Y); Vector2 option3OptionPos = new Vector2(GlobalValues.GetWordCenterPos("Change Resolution", false).X, GlobalValues.ScreenCenter.Y + GlobalValues.FontYSpacer); Vector2 option4OptionPos = new Vector2(GlobalValues.GetWordCenterPos("Change Difficulty", false).X, GlobalValues.ScreenCenter.Y + (GlobalValues.FontYSpacer * 2)); Vector2 option5OptionPos = new Vector2(GlobalValues.GetWordCenterPos("Change Gravity", false).X, GlobalValues.ScreenCenter.Y + (GlobalValues.FontYSpacer * 3)); List <Vector2> positions = new List <Vector2>() { mainMenuOptionPos, option1OptionPos, option2OptionPos, option3OptionPos, option4OptionPos, option5OptionPos }; ShowSelectedIcon(positions); #region Foreach foreach (Vector2 v2 in screenTitle) { pb.AddVertex(v2 + screenTitlePos, Color.White); } foreach (Vector2 v2 in mainMenuOption) { pb.AddVertex(v2 + mainMenuOptionPos, Color.White); } foreach (Vector2 v2 in option1Option) { pb.AddVertex(v2 + option1OptionPos, Color.White); } foreach (Vector2 v2 in option2Option) { pb.AddVertex(v2 + option2OptionPos, Color.White); } foreach (Vector2 v2 in option3Option) { pb.AddVertex(v2 + option3OptionPos, Color.White); } foreach (Vector2 v2 in option4Option) { pb.AddVertex(v2 + option4OptionPos, Color.White); } foreach (Vector2 v2 in option5Option) { pb.AddVertex(v2 + option5OptionPos, Color.White); } #endregion }