FillScreen() public method

public FillScreen ( System.Color color ) : void
color System.Color
return void
Beispiel #1
0
        /// <summary>
        /// Draws to the supplied cube.
        /// </summary>
        /// <param name='cube'>
        /// The cube to which the room should be drawn.
        /// </param>
        public void DrawTo(Cube cube)
        {
            // draw the background
            cube.FillScreen(bgColor);

            // draw the center
            cube.FillRect(passageColor, segmentSize, segmentSize, segmentSize, segmentSize);

            // draw open passages
            for (int i=0; i<entryStates.Length; i++)
            {
                if (entryStates[i] == EntryState.Closed) continue;
                int x=segmentSize, y=segmentSize;
                switch ((Cube.Side)i)
                {
                case Cube.Side.BOTTOM:
                    y = 2*segmentSize;
                    break;
                case Cube.Side.LEFT:
                    x = 0;
                    break;
                case Cube.Side.RIGHT:
                    x = 2*segmentSize;
                    break;
                case Cube.Side.TOP:
                    y = 0;
                    break;
                }
                cube.FillRect(passageColor, x, y, segmentSize, segmentSize);
            }

            // paint the cube
            cube.Paint();
        }
 void AddCubeToArray(Cube c, int index)
 {
     if (index < 0 || index >= cubes.Length)
         return;
     RemoveCubeFromArray (c);
     if (cubes[index] != null)
         RemoveCubeFromArray (cubes[index]);
     c.FillScreen(Color.Black);
     c.Image("heart_"+heartChar+"_"+index, 0, 0, 0, 0, 128, 128, 1, 0);
     c.Paint();
     cubes[index] = c;
 }
Beispiel #3
0
 private static void ChangeCubeImage(Cube cube, Color color)
 {
     cube.FillScreen(color);
     cube.Paint();
 }
Beispiel #4
0
        public void Draw(Cube c, DoomGuy g)
        {
            c.FillScreen(Color.White);
              Util.DrawString(c, 5, 5, "Group:" + this._Name);
              Util.DrawString(c, 5, 15, "Devices: " + this.DeviceCount.ToString() + " (" + this.MaintenanceCount.ToString() + ")");
              Util.DrawString(c, 5, 25, "Info:" + this.Info.ToString());
              Util.DrawString(c, 5, 35, "Warn:" + this.Warning.ToString());
              Util.DrawString(c, 5, 45, "Error:" + this.Error.ToString());

              c.Image("zenoss", 5, 60, 0, 0, 32, 42);

              if ( this.DeviceCount == 0 )
            {
              g.Draw(c, DoomGuy.Face.GameOver, DoomGuy.FaceStatus.Normal, 50, 60);
            }
              else
            {

              if ( this.Error >= 10 )
            {
              g.Draw(c, DoomGuy.Face.Health5, DoomGuy.FaceStatus.Normal, 50, 60);
            }
              else if ( this.Error >= 1 )
            {
              g.Draw(c, DoomGuy.Face.Health4, DoomGuy.FaceStatus.Normal, 50, 60);
            }
              else if ( this.Warning >= 10 )
            {
              g.Draw(c, DoomGuy.Face.Health3, DoomGuy.FaceStatus.Normal, 50, 60);
            }
              else if ( this.Warning >= 1 )
            {
              g.Draw(c, DoomGuy.Face.Health2, DoomGuy.FaceStatus.Normal, 50, 60);
            }
              else
            {
              g.Draw(c, DoomGuy.Face.Health1, DoomGuy.FaceStatus.Normal, 50, 60);
            }
            }
        }
Beispiel #5
0
 private void OnPress(Cube cube)
 {
     cube.FillScreen(new Color(255, 0, 0)); // red
     cube.Paint();
 }
Beispiel #6
0
 private void OffShake(Cube cube, int duration)
 {
     cube.FillScreen(Color.White);
     cube.Paint();
 }
 private void DrawBlankCube(Cube c)
 {
     c.FillScreen(Color.White);
       c.Image("difficulties", 0, 16, 0, 0);
 }
 /// <summary>
 /// Removes the Cube from the Array. Also clears Cube's screen.
 /// </summary>
 /// <returns>
 /// <c>true</c> iff the Cube was previously in the Array
 /// </returns>
 /// <param name='c'>
 /// The specific Cube object to remove from the Array
 /// </param>
 bool RemoveCubeFromArray(Cube c)
 {
     int index = IsCubeInArray (c);
     if (index >= 0){
         cubes[index] = null;
         c.FillScreen(Color.White);
         c.Paint();
         return true;
     }
     return false;
 }
Beispiel #9
0
        public void Draw(Cube c, DoomGuy g)
        {
            c.FillScreen(Color.White);
               Util.DrawString(c, 5, 5, "Job:" + this.Name);
               Util.DrawString(c, 5, 15, "Score:" + this.Score.ToString());
               Util.DrawString(c, 5, 25, "Last Success:" + this.LastSuccess.ToString());
            Util.DrawString(c, 5, 35, "Last Fail:" + this.LastFail.ToString());

            c.Image("jenkins", 5, 60, 0, 0, 32, 44);
             			if ( this.Score == 100 )
                {
                    g.Draw(c, DoomGuy.Face.Health1, DoomGuy.FaceStatus.Normal, 50, 60);
                }
            else if ( this.Score >= 80 )
                {
                    g.Draw(c, DoomGuy.Face.Health2, DoomGuy.FaceStatus.Normal, 50, 60);
                }
            else if ( this.Score >= 60 )
                {
                    g.Draw(c, DoomGuy.Face.Health3, DoomGuy.FaceStatus.Normal, 50, 60);
                }
            else if ( this.Score >= 30 )
                {
                    g.Draw(c, DoomGuy.Face.Health4, DoomGuy.FaceStatus.Normal, 50, 60);
                }
            else if ( this.Score > 0 )
                {
                    g.Draw(c, DoomGuy.Face.Health5, DoomGuy.FaceStatus.Normal, 50, 60);
                }
            else
                {
                    g.Draw(c, DoomGuy.Face.GameOver, DoomGuy.FaceStatus.Normal, 50, 60);
                }
        }
Beispiel #10
0
 public void ShowImage(Cube cube, String name)
 {
     cube.FillScreen(Color.Black);
     cube.Image(name, 0, 0, 0, 0, 128, 128, 1, 0);
     cube.Paint();
 }
Beispiel #11
0
        private static void ChangeCubeImage(Cube cube, Color color)
        {
            cube.FillScreen(color);
            string cubeChar = ((CubeData) cube.userData).CubeChar;
            string imageSource;

            if ("" != cubeChar)
                imageSource = cubeChar + ".png";
            else
                imageSource = "wat.png";

            cube.Image(imageSource, x: _cubeX, y: _cubeY, sourceX: _sourceX, sourceY: _sourceY, w: _width, h: _height,
                       scale: _scale, rotation: _rotation);
            cube.Paint();
        }
        private void ChangeCubeImg(Cube cube, Fraction fraction, Color color)
        {
            cube.FillScreen(color);

            //            _imageSourceNum = fraction.GetNumerator() + ".png";
            //            _imageSourceDen = fraction.GetDenominator() + ".png";
            switch (fraction.GetNumerator())
            {
                case 1:
                    _imageSourceNum = "1.png";
                    break;
                case 2:
                    _imageSourceNum = "2.png";
                    break;
                case 3:
                    _imageSourceNum = "3.png";
                    break;
                case 4:
                    _imageSourceNum = "4.png";
                    break;
                case 5:
                    _imageSourceNum = "5.png";
                    break;
                case 6:
                    _imageSourceNum = "6.png";
                    break;
                case 7:
                    _imageSourceNum = "7.png";
                    break;
                case 8:
                    _imageSourceNum = "8.png";
                    break;
                case 9:
                    _imageSourceNum = "9.png";
                    break;
                case 10:
                    _imageSourceNum = "10.png";
                    break;
            }

            switch (fraction.GetDenominator())
            {
                case 1:
                    _imageSourceDen = "1.png";
                    break;
                case 2:
                    _imageSourceDen = "2.png";
                    break;
                case 3:
                    _imageSourceDen = "3.png";
                    break;
                case 4:
                    _imageSourceDen = "4.png";
                    break;
                case 5:
                    _imageSourceDen = "5.png";
                    break;
                case 6:
                    _imageSourceDen = "6.png";
                    break;
                case 7:
                    _imageSourceDen = "7.png";
                    break;
                case 8:
                    _imageSourceDen = "8.png";
                    break;
                case 9:
                    _imageSourceDen = "9.png";
                    break;
                case 10:
                    _imageSourceDen = "10.png";
                    break;
            }

            cube.Image(_imageSourceNum, _cubeX, _cubeYNum, _sourceX, _sourceY, _width, _height, _scale,
                       _rotation);
            cube.Image(_imageSourceDen, _cubeX, _cubeYDen, _sourceX, _sourceY, _width, _height, _scale,
                       _rotation);
            cube.FillRect(Color.Black, _cubeX, _cubeYDen - 10, 65, 10);
            cube.Paint();
        }
 public void PaintCube(Cube cube)
 {
     //Paint this cube
     if (cube != null) {
         //cube.FillScreen (cubeBackground);
         cube.FillScreen (Color.Black);
         //cube.Image ("Spade_96x96-32", 0, 0, 0, 0, 96, 96, 1, 0);
         cube.Image ("buddy", 40, 24, 0, 48, 32, 48, 1, 0);
         cube.Paint ();
     } else {
         //Handle this exception
     }
 }