コード例 #1
0
        public override void DrawOn2DControlOrthographicView()
        {
            (double x, double y, double z, double angle) = GetPositionAngle().GetValues();
            (float xPosPixels, float yPosPixels)         = MapUtilities.ConvertCoordsForControlOrthographicView((float)x, (float)y, (float)z);
            float angleDegrees = Rotates ? MapUtilities.ConvertAngleForControl(angle) : 0;
            SizeF size         = MapUtilities.ScaleImageSizeForControl(Image.Size, Size);

            MapUtilities.DrawTexture(TextureId, new PointF(xPosPixels, yPosPixels), size, angleDegrees, Opacity);
        }
コード例 #2
0
        public override void DrawOn2DControlTopDownView()
        {
            List <(PointF loc, SizeF size)> dimensions = GetDimensions();
            float angle = InternalRotates ? MapUtilities.ConvertAngleForControl(0) : 0;

            foreach ((PointF loc, SizeF size) in dimensions)
            {
                MapUtilities.DrawTexture(TextureId, loc, size, angle, Opacity);
            }
        }
コード例 #3
0
        public override void DrawOn2DControlOrthographicView(MapObjectHoverData hoverData)
        {
            (double x, double y, double z, double angle) = GetPositionAngle().GetValues();
            (float xPosPixels, float yPosPixels)         = MapUtilities.ConvertCoordsForControlOrthographicView((float)x, (float)y, (float)z, UseRelativeCoordinates);
            float  angleDegrees = Rotates ? MapUtilities.ConvertAngleForControl(angle) : 0;
            SizeF  size         = MapUtilities.ScaleImageSizeForControl(Image.Size, GetSize(), Scales);
            double opacity      = Opacity;

            if (this == hoverData?.MapObject)
            {
                opacity = MapUtilities.GetHoverOpacity();
            }
            MapUtilities.DrawTexture(TextureId, new PointF(xPosPixels, yPosPixels), size, angleDegrees, opacity);
        }
コード例 #4
0
        public override void DrawOn2DControlOrthographicView()
        {
            List <(float x, float y, float z, float angle, int tex)> data = GetData();

            data.Reverse();
            foreach (var dataPoint in data)
            {
                (float x, float y, float z, float angle, int tex) = dataPoint;
                (float x, float z)positionOnControl = MapUtilities.ConvertCoordsForControlOrthographicView(x, y, z);
                float  angleDegrees = Rotates ? MapUtilities.ConvertAngleForControl(angle) : 0;
                SizeF  size         = MapUtilities.ScaleImageSizeForControl(Config.ObjectAssociations.BlueMarioMapImage.Size, Size);
                PointF point        = new PointF(positionOnControl.x, positionOnControl.z);
                MapUtilities.DrawTexture(tex, point, size, angleDegrees, Opacity);
            }
        }
コード例 #5
0
        public override void DrawOn2DControlOrthographicView(MapObjectHoverData hoverData)
        {
            List <(float x, float y, float z, float angle, bool rotates, Image image, int tex, uint objAddress)> data = GetData();

            data.Reverse();
            foreach (var dataPoint in data)
            {
                (float x, float y, float z, float angle, bool rotates, Image image, int tex, uint objAddress) = dataPoint;
                (float x, float z)positionOnControl = MapUtilities.ConvertCoordsForControlOrthographicView(x, y, z, UseRelativeCoordinates);
                float  angleDegrees = (CustomRotates ?? rotates) ? MapUtilities.ConvertAngleForControl(angle) : 0;
                SizeF  size         = MapUtilities.ScaleImageSizeForControl(image.Size, Size, Scales);
                PointF point        = new PointF(positionOnControl.x, positionOnControl.z);
                double opacity      = Opacity;
                if (this == hoverData?.MapObject && dataPoint.objAddress == hoverData?.ObjAddress)
                {
                    opacity = MapUtilities.GetHoverOpacity();
                }
                MapUtilities.DrawTexture(tex, point, size, angleDegrees, opacity);
            }
        }
コード例 #6
0
        public override void DrawOn2DControlOrthographicView(MapObjectHoverData hoverData)
        {
            List <(float x, float y, float z, float angle, int tex)> data = GetData();

            for (int i = data.Count - 1; i >= 0; i--)
            {
                var dataPoint = data[i];
                (float x, float y, float z, float angle, int tex) = dataPoint;
                (float x, float z)positionOnControl = MapUtilities.ConvertCoordsForControlOrthographicView(x, y, z, UseRelativeCoordinates);
                float  angleDegrees = Rotates ? MapUtilities.ConvertAngleForControl(angle) : 0;
                SizeF  size         = MapUtilities.ScaleImageSizeForControl(Config.ObjectAssociations.BlueMarioMapImage.Size, Size, Scales);
                PointF point        = new PointF(positionOnControl.x, positionOnControl.z);
                double opacity      = Opacity;
                if (this == hoverData?.MapObject && i == hoverData?.Index)
                {
                    opacity = MapUtilities.GetHoverOpacity();
                }
                MapUtilities.DrawTexture(tex, point, size, angleDegrees, opacity);
            }
        }
コード例 #7
0
        public override void DrawOn2DControlOrthographicView()
        {
            List <(float x, float y, float z, float angle, int tex, bool show)> data = GetData();

            foreach (var dataPoint in data)
            {
                (float x, float y, float z, float angle, int tex, bool show) = dataPoint;
                if (!show)
                {
                    continue;
                }
                (float x, float z)positionOnControl = MapUtilities.ConvertCoordsForControlOrthographicView(x, y, z);
                float  angleDegrees = Rotates ? MapUtilities.ConvertAngleForControl(angle) : 0;
                SizeF  size         = MapUtilities.ScaleImageSizeForControl(Config.ObjectAssociations.BlueMarioMapImage.Size, Size);
                PointF point        = new PointF(positionOnControl.x, positionOnControl.z);
                MapUtilities.DrawTexture(tex, point, size, angleDegrees, Opacity);
            }

            if (OutlineWidth != 0)
            {
                GL.BindTexture(TextureTarget.Texture2D, -1);
                GL.MatrixMode(MatrixMode.Modelview);
                GL.LoadIdentity();
                GL.Color4(OutlineColor.R, OutlineColor.G, OutlineColor.B, OpacityByte);
                GL.LineWidth(OutlineWidth);
                GL.Begin(PrimitiveType.Lines);
                for (int i = 0; i < data.Count - 1; i++)
                {
                    (float x1, float y1, float z1, float angle1, int tex1, bool show1) = data[i];
                    (float x2, float y2, float z2, float angle2, int tex2, bool show2) = data[i + 1];
                    (float x, float z)vertex1ForControl = MapUtilities.ConvertCoordsForControlOrthographicView(x1, y1, z1);
                    (float x, float z)vertex2ForControl = MapUtilities.ConvertCoordsForControlOrthographicView(x2, y2, z2);
                    GL.Vertex2(vertex1ForControl.x, vertex1ForControl.z);
                    GL.Vertex2(vertex2ForControl.x, vertex2ForControl.z);
                }
                GL.End();
                GL.Color4(1, 1, 1, 1.0f);
            }
        }