Exemplo n.º 1
0
        private void DrawIcon(SCANwaypoint p, Color iconColor)
        {
            Rect pos = new Rect((float)(longitudeToPixels(p.Longitude, p.Latitude)), (float)(latitudeToPixels(p.Longitude, p.Latitude)), 16, 16);

            if (!p.LandingTarget)
            {
                pos.x -= 8;
                pos.y -= 16;
                SCANuiUtil.drawMapIconGL(pos, SCANskins.SCAN_WaypointIcon, iconColor, iconMaterial, iconColorShadowValue, true);
            }
            else
            {
                pos.x -= 8;
                pos.y -= 8;
                SCANuiUtil.drawMapIconGL(pos, SCANcontroller.controller.mechJebTargetSelection ? SCANskins.SCAN_MechJebIcon : SCANskins.SCAN_TargetIcon, iconColor, iconMaterial, iconColorShadowValue, true);
            }
        }
Exemplo n.º 2
0
        internal static void drawOrbitIconGL(int x, int y, OrbitIcon icon, Color c, Color shadow, Material iconMat, int size = 32 /*px*/, bool outline = false)
        {
            // PX [0..n]
            // ORIGIN: NorthWest
            pos_icon.x      = x - (size / 2);
            pos_icon.y      = y - (size / 2);
            pos_icon.width  = size;
            pos_icon.height = size;

            // UV [0..1]
            // Origin: SouthWest
            grid_pos.width  = 0.2f;
            grid_pos.height = 0.2f;
            grid_pos.x      = 0.2f * ((int)icon % 5);
            grid_pos.y      = 0.2f * (4 - (int)icon / 5);

            SCANuiUtil.drawMapIconGL(pos_icon, MapView.OrbitIconsMap, c, iconMat, shadow, outline, grid_pos, true);
        }