Esempio n. 1
0
        protected override void LoadContent()
        {
            cTextureDict = new Dictionary <Textures, Texture2D>();
            foreach (Textures CurrTexture in Enum.GetValues(typeof(Textures)))
            {
                cTextureDict.Add(CurrTexture, Content.Load <Texture2D>(Tools.EnumTools.GetEnumDescriptionAttribute(CurrTexture)));
            }

            cDevConsole              = new GameConsole(cGraphDevMgr.GraphicsDevice, Content, Tools.EnumTools.GetEnumDescriptionAttribute(Textures.Font), 0, 0, cGraphDevMgr.GraphicsDevice.Viewport.Bounds.Width, cGraphDevMgr.GraphicsDevice.Viewport.Bounds.Height / 2);
            cDevConsole.CommandSent += new CommandSentEventHandler(CommandSentEventHandler);
            cDevConsole.OpenEffect   = DisplayEffect.SlideDown;
            cDevConsole.CloseEffect  = DisplayEffect.SlideUp;
            cDevConsole.AccessKey    = Keys.OemTilde;
            cDevConsole.UseAccessKey = true;

            cSquares = new MarchingSquares2D(cGraphDevMgr.GraphicsDevice, cGraphDevMgr.GraphicsDevice.Viewport.Height, cGraphDevMgr.GraphicsDevice.Viewport.Height + (cGraphDevMgr.GraphicsDevice.Viewport.Height / 10));
            cSquares.CornerTexture       = cTextureDict[Textures.Circle];
            cSquares.WallTexture         = cTextureDict[Textures.Squares];
            cSquares.Top                 = 0;
            cSquares.Left                = 0;
            cSquares.Visible             = true;
            cSquares.ColumnCount         = 11 * 4;
            cSquares.RowCount            = 10 * 4;
            cSquares.SendMouseEvents     = true;
            cSquares.CellDisplayHeight   = 150;
            cSquares.CellDisplayWidth    = 150;
            cSquares.DisplayCenterCoords = new Vector2(0, 0);
            cSquares.MouseUp            += new ContainerMouseButtonEventHandler(SquaresClick);

            cNewMap = new Button(cGraphDevMgr.GraphicsDevice, null, 10, cSquares.Width + 40, 50, 150);
            cNewMap.BackgroundColor = Color.BlueViolet;
            cNewMap.Text            = "New Map";
            cNewMap.Font            = new TextureFont(cTextureDict[Textures.Font]);
            cNewMap.FontColor       = Color.White;
            cNewMap.Visible         = true;
            cNewMap.Click          += NewMapClicked;

            cFlyMap = new Button(cGraphDevMgr.GraphicsDevice, null, 70, cSquares.Width + 40, 50, 150);
            cFlyMap.BackgroundColor = Color.BlueViolet;
            cFlyMap.Text            = "Fly Map";
            cFlyMap.Font            = new TextureFont(cTextureDict[Textures.Font]);
            cFlyMap.FontColor       = Color.White;
            cFlyMap.Visible         = true;
            cFlyMap.Click          += FlyMapClicked;

            //Call monogame base
            base.LoadContent();
        }
Esempio n. 2
0
		protected override void LoadContent() {
			cTextureDict = new Dictionary<Textures, Texture2D>();
			foreach (Textures CurrTexture in Enum.GetValues(typeof(Textures))) {
				cTextureDict.Add(CurrTexture, Content.Load<Texture2D>(Tools.Tools.GetEnumDescriptionAttribute(CurrTexture)));
			}

			cDevConsole = new GameConsole(cGraphDevMgr.GraphicsDevice, Content, Tools.Tools.GetEnumDescriptionAttribute(Textures.Font), 0, 0, cGraphDevMgr.GraphicsDevice.Viewport.Bounds.Width, cGraphDevMgr.GraphicsDevice.Viewport.Bounds.Height / 2);
			cDevConsole.CommandSent += new CommandSentEventHandler(CommandSentEventHandler);
			cDevConsole.OpenEffect = DisplayEffect.SlideDown;
			cDevConsole.CloseEffect = DisplayEffect.SlideUp;
			cDevConsole.AccessKey = Keys.OemTilde;
			cDevConsole.UseAccessKey = true;

			cSquares = new MarchingSquares2D(cGraphDevMgr.GraphicsDevice, cGraphDevMgr.GraphicsDevice.Viewport.Height, cGraphDevMgr.GraphicsDevice.Viewport.Height + (cGraphDevMgr.GraphicsDevice.Viewport.Height / 10));
			cSquares.CornerTexture = cTextureDict[Textures.Circle];
			cSquares.WallTexture = cTextureDict[Textures.Squares];
			cSquares.Top = 0;
			cSquares.Left = 0;
			cSquares.Visible = true;
			cSquares.ColumnCount = 11 * 4;
			cSquares.RowCount = 10 * 4;
			cSquares.SendMouseEvents = true;
			cSquares.CellDisplayHeight = 150;
			cSquares.CellDisplayWidth = 150;
			cSquares.DisplayCenterCoords = new Vector2(0, 0);
			cSquares.MouseUp += new ContainerMouseButtonEventHandler(SquaresClick);

			cNewMap = new Button(cGraphDevMgr.GraphicsDevice, null, 10, cSquares.Width + 40, 50, 150);
			cNewMap.BackgroundColor = Color.BlueViolet;
			cNewMap.Text = "New Map";
			cNewMap.Font = new TextureFont(cTextureDict[Textures.Font]);
			cNewMap.FontColor = Color.White;
			cNewMap.Visible = true;
			cNewMap.Click += NewMapClicked;

			cFlyMap = new Button(cGraphDevMgr.GraphicsDevice, null, 70, cSquares.Width + 40, 50, 150);
			cFlyMap.BackgroundColor = Color.BlueViolet;
			cFlyMap.Text = "Fly Map";
			cFlyMap.Font = new TextureFont(cTextureDict[Textures.Font]);
			cFlyMap.FontColor = Color.White;
			cFlyMap.Visible = true;
			cFlyMap.Click += FlyMapClicked;

			//Call monogame base
			base.LoadContent();
		}