コード例 #1
0
        public QuantityDisplayBar(Vector2 DIMENSIONS, int BORDER, Color COLOR)
        {
            border = BORDER;
            color  = COLOR;

            bar           = new Basic2d("2d/misc/solid", new Vector2(0, 0), new Vector2(DIMENSIONS.X - border * 2, DIMENSIONS.Y - border * 2));
            barBackground = new Basic2d("2d/misc/shade", new Vector2(0, 0), new Vector2(DIMENSIONS.X, DIMENSIONS.Y));
        }
コード例 #2
0
        public UI(PassObject RESET_WORLD)
        {
            pauseOverlay = new Basic2d("2d/misc/PauseOverlay", new Vector2(Globals.screenWidth / 2, Globals.screenHeight / 2), new Vector2(300, 300));

            font = Globals.content.Load <SpriteFont>("2d/Fonts/Arial16");

            resetButton = new Button2d("2d/misc/SimpleBtn", new Vector2(0, 0), new Vector2(96, 32), "2d/Fonts/Arial16", "Reset", RESET_WORLD, null);

            // total width including the background of the bar
            healthBar = new QuantityDisplayBar(new Vector2(104, 16), 2, Color.Red);
        }
コード例 #3
0
        public MainMenu(PassObject PLAY_CLICK_DELETE, PassObject EXIT_CLICK_DELETE)
        {
            PlayClickDelete = PLAY_CLICK_DELETE;
            ExitClickDelete = EXIT_CLICK_DELETE;

            background = new Basic2d("2d/UI/Backgrounds/MainMenuBkg", new Vector2(Globals.screenWidth / 2, Globals.screenHeight / 2), new Vector2(Globals.screenWidth, Globals.screenHeight));

            buttons.Add(new Button2d("2d/misc/SimpleBtn", new Vector2(0, 0), new Vector2(96, 32), "2d/Fonts/Arial16", "Play", PlayClickDelete, 1));;

            buttons.Add(new Button2d("2d/misc/SimpleBtn", new Vector2(0, 0), new Vector2(96, 32), "2d/Fonts/Arial16", "Exit", ExitClickDelete, null));;
        }
コード例 #4
0
ファイル: Main.cs プロジェクト: hokushrine/top-down-shooter
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            Globals.content     = this.Content;
            Globals.spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here

            cursor           = new Basic2d("2d\\Misc\\CursorArrow", new Vector2(0, 0), new Vector2(28, 28));
            Globals.keyboard = new McKeyboard();
            Globals.mouse    = new McMouseControl();
            world            = new World();
        }
コード例 #5
0
ファイル: Main.cs プロジェクト: bgwest/top-down-shooter
        protected override void LoadContent()
        {
            Globals.content     = Content;
            Globals.spriteBatch = new SpriteBatch(GraphicsDevice);

            cursor = new Basic2d("2d/misc/CursorArrow", new Vector2(0, 0), new Vector2(28, 28));

            Globals.normalEffect = Globals.content.Load <Effect>("2d/Effects/NormalFlat");

            Globals.keyboard = new McKeyboard();
            Globals.mouse    = new McMouseControl();

            mainMenu = new MainMenu(ChangeGameState, ExitGame);
            gamePlay = new GamePlay(ChangeGameState);
        }
コード例 #6
0
ファイル: SquareGrid.cs プロジェクト: bgwest/top-down-shooter
        public SquareGrid(Vector2 SLOTDIMS, Vector2 STARTPOS, Vector2 TOTALDIMS)
        {
            showGrid = false;

            slotDims = SLOTDIMS;

            // rare instances where decimal numbers will cause issues
            // the int concatenation is a safety measure to prevent that
            physicalStartPos  = new Vector2((int)STARTPOS.X, (int)STARTPOS.Y);
            totalPhysicalDims = new Vector2((int)TOTALDIMS.X, (int)TOTALDIMS.Y);

            currentHoverSlot = new Vector2(-1, -1);

            SetBaseGrid();

            // param2 note:
            // slotDims/2 because our slots location begin in the top left corner of the slot
            // this places it directly in the center
            // param3 note:
            // the -2's are because without the -2, the lines will all blur together at the point
            // in which the touch
            // the -2 gives it the spacing it needs the slots to be "grid like"
            gridImg = new Basic2d("2d/misc/shade", slotDims / 2, new Vector2(slotDims.X - 2, slotDims.Y - 2));
        }