Пример #1
0
        public static void DrawCrosshair(string atlas, MyAtlasTextureCoordinate textureCoord, MyHudCrosshair crosshair)
        {
            Vector2 rightVector = new Vector2(crosshair.UpVector.Y, crosshair.UpVector.X);

            float hudSizeX = MyGuiManager.GetSafeFullscreenRectangle().Width / MyGuiManager.GetHudSize().X;
            float hudSizeY = MyGuiManager.GetSafeFullscreenRectangle().Height / MyGuiManager.GetHudSize().Y;
            var   pos      = crosshair.Position;

            if (MyVideoSettingsManager.IsTripleHead())
            {
                pos.X += 1.0f;
            }

            VRageRender.MyRenderProxy.DrawSpriteAtlas(
                atlas,
                pos,
                textureCoord.Offset,
                textureCoord.Size,
                rightVector,
                new Vector2(hudSizeX, hudSizeY),
                crosshair.Color,
                crosshair.HalfSize);
        }
Пример #2
0
        public static void DrawCrosshair(string atlas, MyAtlasTextureCoordinate textureCoord, MyHudCrosshair crosshair)
        {
            Vector2 rightVector = new Vector2(crosshair.UpVector.Y, crosshair.UpVector.X);

            float hudSizeX = MyGuiManager.GetSafeFullscreenRectangle().Width / MyGuiManager.GetHudSize().X;
            float hudSizeY = MyGuiManager.GetSafeFullscreenRectangle().Height / MyGuiManager.GetHudSize().Y;
            var pos = crosshair.Position;
            if (MyVideoSettingsManager.IsTripleHead())
                pos.X += 1.0f;

            VRageRender.MyRenderProxy.DrawSpriteAtlas(
                atlas,
                pos,
                textureCoord.Offset,
                textureCoord.Size,
                rightVector,
                new Vector2(hudSizeX, hudSizeY),
                crosshair.Color,
                crosshair.HalfSize);
        }