Beispiel #1
0
 public Game_Manager(Platform current_platform, Drawvisitor drawvisitor, iInputhandler inputhandler)
 {
     this.EmptyTile = new Tile(this, new Position(-1, -1), false);
     this.drawvisitor = drawvisitor;
     this.level = new leveldata(this, Dificulty.normal);
     this.inputhandler = inputhandler;
     latestinput = inputhandler.getinput();
     this.SelectedTile = EmptyTile;
     this.selectionbuttons = new SelectionButtons(this);
     this.current_platform = current_platform;
     if (this.current_platform == Platform.windows)
     {
         SelectionButtonsEnabled = false;
     }
     else
     {
         SelectionButtonsEnabled = true;
     }
 }
Beispiel #2
0
        public void DrawTileSelectionButtons(SelectionButtons selectionbuttons)
        {
            /*
             * int local_square_size = 0;
             * if ((width / 2) > (height))
             * {
             *  local_square_size = ((height / 5));
             * }
             * else {
             *  local_square_size = ((width / 5));
             * }
             */
            int squareheight = (height / 3);
            int squarewidth  = (width / 5) * 2;

            selectionbuttons.real_mark_position = new Position(0, height - (int)(squareheight * 1.3));
            selectionbuttons.real_mark_size     = new Size(squarewidth, squareheight);
            selectionbuttons.real_open_position = new Position(width - squarewidth, height - (int)(squareheight * 1.3));
            selectionbuttons.real_open_size     = new Size(squarewidth, squareheight);

            Color markcolor = Color.Gray;
            Color opencolor = Color.Gray;

            if (selectionbuttons.mark_highlighted)
            {
                markcolor = Color.LightGray;
            }
            if (selectionbuttons.open_highlighted)
            {
                opencolor = Color.LightGray;
            }

            spritebatch.Draw(White_transparent_texture, new Rectangle(selectionbuttons.real_mark_position.x, selectionbuttons.real_mark_position.y, selectionbuttons.real_mark_size.x, selectionbuttons.real_mark_size.y), markcolor);
            if (selectionbuttons.openvisible)
            {
                spritebatch.Draw(White_transparent_texture, new Rectangle(selectionbuttons.real_open_position.x, selectionbuttons.real_open_position.y, selectionbuttons.real_open_size.x, selectionbuttons.real_open_size.y), opencolor);
            }
        }