示例#1
0
 // Author: DeAngelo Wilson
 public Block(DrawColor.Shade color, int x, int y)
 {
     //default color of blocks -- set when attached to a GameShape
     this.color = color;
     this.x     = x;
     this.y     = y;
 }
示例#2
0
 // Author: DeAngelo Wilson
 public Block(int x, int y)
 {
     //default color of blocks -- set when attached to a GameShape
     this.color = DrawColor.Shade.COLOR_GREY;
     this.x     = x;
     this.y     = y;
 }
示例#3
0
        public static void drawBox(int xPos, int yPos, DrawColor.Shade inColor)
        {
            // This is draw in painted order
            // Draw the color big box first, then the inside.
            int x = (xPos + 1) * Constants.BOX_SIZE + Constants.BOX_SIZE_HALF;
            int y = (yPos + 1) * Constants.BOX_SIZE + Constants.BOX_SIZE_HALF;

            drawInternal(x, y, inColor);
        }
示例#4
0
        static public void drawInternal(int xPos, int yPos, DrawColor.Shade inColor)
        {
            // This is draw in painted order
            // Draw the color big box first, then the inside..
            Azul.SpriteSolidBox smallBlock = new Azul.SpriteSolidBox(new Azul.Rect(xPos, yPos, Constants.BOX_SIZE - 4, Constants.BOX_SIZE - 4),
                                                                     DrawColor.getColor(inColor));
            smallBlock.Update();

            Azul.SpriteSolidBox bigBlock = new Azul.SpriteSolidBox(new Azul.Rect(xPos, yPos, Constants.BOX_SIZE, Constants.BOX_SIZE),
                                                                   DrawColor.getColor(DrawColor.Shade.COLOR_GREY));
            bigBlock.Update();

            // Draw
            bigBlock.Render();
            smallBlock.Render();
        }
示例#5
0
        static public void drawPreviewWindow(int xPos, int yPos, int sizeX, int sizeY, DrawColor.Shade inColor, DrawColor.Shade outColor)
        {
            // This is draw in painted order
            // Draw the color big box first, then the inside..

            Azul.SpriteSolidBox smallBlock = new Azul.SpriteSolidBox(new Azul.Rect(xPos, yPos, sizeX - 4, sizeY - 4),
                                                                     DrawColor.getColor(inColor));
            smallBlock.Update();

            Azul.SpriteSolidBox bigBlock = new Azul.SpriteSolidBox(new Azul.Rect(xPos, yPos, sizeX, sizeY),
                                                                   DrawColor.getColor(DrawColor.Shade.COLOR_GREY));
            bigBlock.Update();

            // draw
            bigBlock.Render();
            smallBlock.Render();
        }
示例#6
0
        public static Azul.Color getColor(DrawColor.Shade color)
        {
            Azul.Color tmp;

            switch (color)
            {
            case DrawColor.Shade.COLOR_ORANGE:
                tmp = new Azul.Color(1.0f, 0.6f, 0.0f);
                break;

            case DrawColor.Shade.COLOR_DK_ORANGE:
                tmp = new Azul.Color(0.85f, 0.45f, 0.0f);
                break;

            case DrawColor.Shade.COLOR_BLUE:
                tmp = new Azul.Color(0.0f, 0.0f, 1.0f);
                break;

            case DrawColor.Shade.COLOR_DK_BLUE:
                tmp = new Azul.Color(0.0f, 0.0f, 0.80f);
                break;

            case DrawColor.Shade.COLOR_PURPLE:
                tmp = new Azul.Color(0.95f, 0.0f, 0.9f);
                break;

            case DrawColor.Shade.COLOR_DK_PURPLE:
                tmp = new Azul.Color(0.8f, 0.0f, 0.7f);
                break;

            case DrawColor.Shade.COLOR_LT_GREEN:
                tmp = new Azul.Color(0.25f, 1.0f, 0.25f);
                break;

            case DrawColor.Shade.COLOR_DK_GREEN:
                tmp = new Azul.Color(0.0f, 0.75f, 0.0f);
                break;

            case DrawColor.Shade.COLOR_LT_BLUE:
                tmp = new Azul.Color(0.25f, 0.25f, 1.0f);
                break;

            case DrawColor.Shade.COLOR_YELLOW:
                tmp = new Azul.Color(1.0f, 1.0f, 0.0f);
                break;

            case DrawColor.Shade.COLOR_DK_YELLOW:
                tmp = new Azul.Color(0.75f, 0.75f, 0.0f);
                break;

            case DrawColor.Shade.COLOR_RED:
                tmp = new Azul.Color(1.0f, 0.2f, 0.2f);
                break;

            case DrawColor.Shade.COLOR_DK_RED:
                tmp = new Azul.Color(0.9f, 0.10f, 0.10f);
                break;

            case DrawColor.Shade.COLOR_CYAN:
                tmp = new Azul.Color(0.0f, 1.0f, 1.0f);
                break;

            case DrawColor.Shade.COLOR_DK_CYAN:
                tmp = new Azul.Color(0.0f, 0.75f, 0.75f);
                break;

            case DrawColor.Shade.COLOR_GREY:
                tmp = new Azul.Color(0.5f, 0.5f, 0.5f);
                break;

            case DrawColor.Shade.COLOR_DK_GREY:
                tmp = new Azul.Color(0.75f, 0.75f, 0.75f);
                break;

            case DrawColor.Shade.COLOR_BACKGROUND_CUSTOM:
                tmp = new Azul.Color(0.2f, 0.2f, 0.25f);
                break;

            default:
                tmp = new Azul.Color(1.0f, 1.0f, 1.0f);
                break;
            }

            return(tmp);
        }
示例#7
0
 public void SetColor(DrawColor.Shade c)
 {
     this.color = c;
 }
示例#8
0
 public Block(Block block)
 {
     x     = block.GetX();
     y     = block.GetY();
     color = block.color;
 }
示例#9
0
 public void draw(DrawColor.Shade color)
 {
     SOM.drawBox(x, y, color);
 }
示例#10
0
 public Box(int dx, int dy, DrawColor.Shade c)
 {
     x     = dx;
     y     = dy;
     color = c;
 }