示例#1
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);
        }
示例#2
0
文件: SCANui.cs 项目: BenChung/SCAN
 public static void drawOrbitIcon(int x, int y, OrbitIcon icon, Color col, int width, bool outline)
 {
     pos_icon.x = x - width / 2;
     pos_icon.y = y - width / 2;
     pos_icon.width = width;
     pos_icon.height = width;
     tc_icon.width = 0.2f;
     tc_icon.height = 0.2f;
     tc_icon.x = 0.2f * ((int)icon % 5);
     tc_icon.y = 0.2f * (4 - (int)icon / 5);
     Color cold = GUI.color;
     if(outline) {
         GUI.color = Color.black;
         pos_icon.x -= 1;
         GUI.DrawTextureWithTexCoords(pos_icon, MapView.OrbitIconsMap, tc_icon);
         pos_icon.x += 2;
         GUI.DrawTextureWithTexCoords(pos_icon, MapView.OrbitIconsMap, tc_icon);
         pos_icon.x -= 1;
         pos_icon.y -= 1;
         GUI.DrawTextureWithTexCoords(pos_icon, MapView.OrbitIconsMap, tc_icon);
         pos_icon.y += 2;
         GUI.DrawTextureWithTexCoords(pos_icon, MapView.OrbitIconsMap, tc_icon);
         pos_icon.y -= 1;
     }
     GUI.color = col;
     GUI.DrawTextureWithTexCoords(pos_icon, MapView.OrbitIconsMap, tc_icon);
     GUI.color = cold;
 }
示例#3
0
文件: SCANicon.cs 项目: DBT85/SCANsat
		internal static void drawOrbitIcon(int x, int y, OrbitIcon icon, Color c, int size = 32 /*px*/, bool outline = false)
		{
			var old = GUI.color;

			// 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.drawMapIcon(pos_icon, MapView.OrbitIconsMap, outline, c, true, grid_pos, true);
		}