public void setSprite(colours c)
    {
        switch (c) {
            case colours.RED:
                GetComponent<Image>().sprite = red;
                break;
            case colours.GREEN:
                GetComponent<Image>().sprite = green;
                break;

            case colours.YELLOW:
                GetComponent<Image>().sprite = yellow;
                break;
            default:
                GetComponent<Image>().sprite = null;
                break;
        }
    }
Esempio n. 2
0
 public void setBackgroundColour(colours colour)
 {
     System.Drawing.Color c = System.Drawing.Color.White;
     switch(colour){
         case colours.red:
             c = System.Drawing.Color.Red;
             break;
         case colours.blue:
             c = System.Drawing.Color.Blue;
             break;
         case colours.green:
             c = System.Drawing.Color.Green;
             break;
         default:
             Console.WriteLine("[EAL] Invalid Colour: " + colour);
             break;
     }
     f.Hide();
     f.BackColor = c;
     f.Show();
 }
Esempio n. 3
0
        /// <summary>
        /// Draws a line to the graphics window
        /// </summary>
        /// <param name="startX">The starting coordinate of X</param>
        /// <param name="startY">The starting coordinate of Y</param>
        /// <param name="endX">The end coordinate of X</param>
        /// <param name="endY">The end coordinate of Y</param>
        /// <param name="color">The colour of the line</param>
        public void draw(int startX, int startY, int endX, int endY, colours color)
        {
            System.Drawing.Point p1 = new System.Drawing.Point();
            p1.X = startX;
            p1.Y = startY;
            System.Drawing.Point p2 = new System.Drawing.Point();
            p2.X = endX;
            p2.Y = endY;

            System.Drawing.Pen p = System.Drawing.Pens.Black;
            switch(color){

                case(colours.red):
                    p = System.Drawing.Pens.Red;
                    break;
                case(colours.blue):
                    p = System.Drawing.Pens.Blue;
                    break;
                case(colours.green):
                    p = System.Drawing.Pens.Green;
                    break;
                case(colours.white):
                    p = System.Drawing.Pens.White;
                    break;
                default:
                    p = System.Drawing.Pens.Black;
                    break;
            }

            g.DrawLine(p, p1, p2);
        }