Exemplo n.º 1
0
        public static float MeasureStringWidth(string str, Font font, float scale)
        {
            int         screenw = Screen.Resolution.Width;
            int         screenh = Screen.Resolution.Height;
            const float height  = 1080f;
            float       ratio   = (float)screenw / screenh;
            float       width   = height * ratio;

            return(MeasureStringWidthNoConvert(str, font, scale) * width);
        }
Exemplo n.º 2
0
 public UIResText(string caption, Point position, float scale, Color color, Font font, Alignment justify)
     : base(caption, position, scale, color, font, GTA.UI.Alignment.Center)
 {
     Alignment = justify;
 }
Exemplo n.º 3
0
 public static float MeasureStringWidthNoConvert(string str, Font font, float scale)
 {
     Function.Call((Hash)0x54CE8AC98E120CAB, "STRING");
     AddLongString(str);
     return(Function.Call <float>((Hash)0x85F061DA64ED2F67, (int)font) * scale);
 }