NativeUI.Sprite.DrawTexture C# (CSharp) 메소드

DrawTexture() 공개 정적인 메소드

Draw a custom texture from a file on a 1080-pixels height base.
public static DrawTexture ( string path, Point position, Size size ) : void
path string Path to texture file.
position Point
size System.Drawing.Size
리턴 void
        public static void DrawTexture(string path, Point position, Size size)
        {
            int screenw = Game.ScreenResolution.Width;
            int screenh = Game.ScreenResolution.Height;

            const float height = 1080f;
            float ratio = (float)screenw / screenh;
            float width = height * ratio;

            float reduceX = UI.WIDTH / width;
            float reduceY = UI.HEIGHT / height;

            Point extra = new Point(0, 0);
            if (screenw == 1914 && screenh == 1052) //TODO: Fix this when ScriptHookVDotNet 1.2 comes out.
                extra = new Point(15, 0);

            UI.DrawTexture(path, 1, 1, 60,
                new Point(Convert.ToInt32(position.X * reduceX) + extra.X, Convert.ToInt32(position.Y * reduceY) + extra.Y),
                new PointF(0f, 0f),
                new Size(Convert.ToInt32(size.Width * reduceX), Convert.ToInt32(size.Height * reduceY)),
                0f, Color.White);
        }

Same methods

Sprite::DrawTexture ( string path, Point position, Size size, float rotation, Color color ) : void