Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.49 KB | None | 0 0
  1. #region background
  2.  
  3. float descWidth = Width / Main.ScreenWidth;
  4. float descHeight = MenuItems[CurrentIndex].GetDescriptionHeight();
  5. float descX = (Position.X + (Width / 2f)) / Main.ScreenWidth;
  6. float descY = (2f + MenuItemsYOffset + ((descHeight / 2f) * Main.ScreenHeight)) / Main.ScreenHeight + (28f / Main.ScreenHeight);
  7.  
  8. //DrawRect()
  9. SetScriptGfxAlign(LeftAligned ? 76 : 82, 84);
  10. SetScriptGfxAlignParams(0f, 0f, 0f, 0f);
  11. DrawRect(descX, descY - descHeight / 2f, descWidth, 4f / Main.ScreenHeight, 0, 0, 0, 200);
  12. DrawSprite(Main._texture_dict, "gradient_bgd", descX, descY, descWidth, descHeight, 0f, 255, 255, 255, 255);
  13. ResetScriptGfxAlign();
  14. #endregion
  15.  
  16. #region description text
  17. int font = 0;
  18. float size = 0.35f;
  19.  
  20. SetScriptGfxAlign(76, 84);
  21. SetScriptGfxAlignParams(0f, 0f, 0f, 0f);
  22.  
  23. BeginTextCommandDisplayText("CELL_EMAIL_BCON");
  24. SetTextFont(font);
  25. SetTextScale(size, size);
  26. SetTextJustification(1);
  27. string text = MenuItems[CurrentIndex].Description;
  28. string[] strings = CitizenFX.Core.UI.Screen.StringToArray(text);
  29. foreach (string s in strings)
  30. {
  31.     AddTextComponentSubstringPlayerName(s);
  32. }
  33.  
  34. if (LeftAligned)
  35. {
  36.     SetTextWrap(0f, 500f / Main.ScreenWidth);
  37.     EndTextCommandDisplayText(descX, descY);
  38. }
  39. else
  40. {
  41.     SetTextWrap(0f, GetSafeZoneSize() - (15f / Main.ScreenWidth));
  42.     EndTextCommandDisplayText((Main.ScreenWidth - 485f) / Main.ScreenWidth - (1f - GetSafeZoneSize()), descY - (descHeight / 2f) + (4f / Main.ScreenHeight));
  43. }
  44.  
  45. ResetScriptGfxAlign();
  46.  
  47. #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement